1
0
Fork 0
mirror of https://github.com/rails/execjs synced 2023-03-27 23:21:20 -04:00

Rename for clarity

This commit is contained in:
Sam Stephenson 2011-02-09 00:30:39 -06:00
parent 9e8f986631
commit 4746921afd
5 changed files with 22 additions and 21 deletions

View file

@ -5,10 +5,10 @@ module ExecJS
class RuntimeError < Error; end
class ProgramError < Error; end
autoload :ExternalRuntime, "execjs/external_runtime"
autoload :RhinoRuntime, "execjs/rhino_runtime"
autoload :Runtimes, "execjs/runtimes"
autoload :V8Runtime, "execjs/v8_runtime"
autoload :ExternalRuntime, "execjs/external_runtime"
autoload :RubyRacerRuntime, "execjs/ruby_racer_runtime"
autoload :RubyRhinoRuntime, "execjs/ruby_rhino_runtime"
autoload :Runtimes, "execjs/runtimes"
def self.exec(source)
runtime.exec(source)

View file

@ -1,5 +1,5 @@
module ExecJS
class V8Runtime
class RubyRacerRuntime
def initialize(options)
end

View file

@ -1,5 +1,5 @@
module ExecJS
class RhinoRuntime
class RubyRhinoRuntime
def initialize(options)
end

View file

@ -14,13 +14,13 @@ module ExecJS
const_set(name, runtime)
end
define_runtime :RubyRacer,
:as => RubyRacerRuntime
define_runtime :RubyRhino,
:as => RubyRhinoRuntime
define_runtime :V8,
:as => V8Runtime
define_runtime :Rhino,
:as => RhinoRuntime
define_runtime :ExternalV8,
:command => "v8",
:test_args => "--help",
:test_match => /--crankshaft/,
@ -30,7 +30,7 @@ module ExecJS
:command => ["nodejs", "node"],
:runner_path => ExecJS.root + "/support/node_runner.js"
define_runtime :JSC,
define_runtime :JavaScriptCore,
:command => "/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc",
:runner_path => ExecJS.root + "/support/basic_runner.js"

View file

@ -45,15 +45,16 @@ module TestRuntime
end
end
def test_runtime(name)
def test_runtime(name, description = nil)
runtime = ExecJS::Runtimes.const_get(name)
title = [name, description].join(" ")
ok = runtime.available?
warn "%s %-14s %s" %
warn "%s %-16s %s" %
if ok
["", name, "Found"]
["", title, "Found"]
else
[" ", name, "Not found"]
[" ", title, "Not found"]
end
if ok
@ -72,11 +73,11 @@ def test_runtime(name)
end
warn "Runtime support:"
test_runtime :RubyRacer, "(V8)"
test_runtime :RubyRhino
test_runtime :V8
test_runtime :Rhino
test_runtime :ExternalV8
test_runtime :Node
test_runtime :JSC
test_runtime :Node, "(V8)"
test_runtime :JavaScriptCore
test_runtime :Spidermonkey
test_runtime :JScript
warn ""