diff --git a/execjs.gemspec b/execjs.gemspec index fd13f9f..1a194e7 100644 --- a/execjs.gemspec +++ b/execjs.gemspec @@ -13,10 +13,10 @@ Gem::Specification.new do |s| "lib/execjs.rb", "lib/execjs/external_runtime.rb", "lib/execjs/rhino_runtime.rb", - "lib/execjs/runners", - "lib/execjs/runners/basic.js", - "lib/execjs/runners/node.js", "lib/execjs/runtimes.rb", + "lib/execjs/support", + "lib/execjs/support/basic_runner.js", + "lib/execjs/support/node_runner.js", "lib/execjs/v8_runtime.rb" ] diff --git a/lib/execjs.rb b/lib/execjs.rb index f310d5d..cfdc1df 100644 --- a/lib/execjs.rb +++ b/lib/execjs.rb @@ -19,4 +19,8 @@ module ExecJS def self.runtime @runtime ||= Runtimes.best_available end + + def self.root + @root ||= File.expand_path("../execjs", __FILE__) + end end diff --git a/lib/execjs/runtimes.rb b/lib/execjs/runtimes.rb index e7a8e33..e5ab354 100644 --- a/lib/execjs/runtimes.rb +++ b/lib/execjs/runtimes.rb @@ -14,10 +14,6 @@ module ExecJS const_set(name, runtime) end - def self.runner_path(path) - File.expand_path("../runners/#{path}", __FILE__) - end - define_runtime :V8, :as => V8Runtime @@ -28,18 +24,18 @@ module ExecJS :command => "v8", :test_args => "--help", :test_match => /--crankshaft/, - :runner_path => runner_path("basic.js") + :runner_path => ExecJS.root + "/support/basic_runner.js" define_runtime :Node, :command => ["nodejs", "node"], - :runner_path => runner_path("node.js") + :runner_path => ExecJS.root + "/support/node_runner.js" define_runtime :JSC, :command => "/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc", - :runner_path => runner_path("basic.js") + :runner_path => ExecJS.root + "/support/basic_runner.js" define_runtime :Spidermonkey, :command => "js", - :runner_path => runner_path("basic.js") + :runner_path => ExecJS.root + "/support/basic_runner.js" end end diff --git a/lib/execjs/runners/basic.js b/lib/execjs/support/basic_runner.js similarity index 100% rename from lib/execjs/runners/basic.js rename to lib/execjs/support/basic_runner.js diff --git a/lib/execjs/runners/node.js b/lib/execjs/support/node_runner.js similarity index 100% rename from lib/execjs/runners/node.js rename to lib/execjs/support/node_runner.js