Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rename for clarity

  • Loading branch information...
commit 4746921afdbba9aef4ad1e5c324be9f3686f9bac 1 parent 9e8f986
@sstephenson authored
View
8 lib/execjs.rb
@@ -5,10 +5,10 @@ class Error < ::StandardError; end
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
2  lib/execjs/v8_runtime.rb → lib/execjs/ruby_racer_runtime.rb
@@ -1,5 +1,5 @@
module ExecJS
- class V8Runtime
+ class RubyRacerRuntime
def initialize(options)
end
View
2  lib/execjs/rhino_runtime.rb → lib/execjs/ruby_rhino_runtime.rb
@@ -1,5 +1,5 @@
module ExecJS
- class RhinoRuntime
+ class RubyRhinoRuntime
def initialize(options)
end
View
12 lib/execjs/runtimes.rb
@@ -14,13 +14,13 @@ def self.define_runtime(name, options)
const_set(name, runtime)
end
- define_runtime :V8,
- :as => V8Runtime
+ define_runtime :RubyRacer,
+ :as => RubyRacerRuntime
- define_runtime :Rhino,
- :as => RhinoRuntime
+ define_runtime :RubyRhino,
+ :as => RubyRhinoRuntime
- define_runtime :ExternalV8,
+ define_runtime :V8,
:command => "v8",
:test_args => "--help",
:test_match => /--crankshaft/,
@@ -30,7 +30,7 @@ def self.define_runtime(name, options)
: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
17 test/test_runtimes.rb
@@ -45,15 +45,16 @@ def test_thrown_exception
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 ""
Please sign in to comment.
Something went wrong with that request. Please try again.