From 910ba90fb774efa28e89f72b85ae544c4c11a508 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Mon, 7 Feb 2011 12:27:00 -0600 Subject: [PATCH] Shift the paths aronud some more --- execjs.gemspec | 6 +++--- lib/execjs.rb | 4 ++++ lib/execjs/runtimes.rb | 12 ++++-------- .../{runners/basic.js => support/basic_runner.js} | 0 .../{runners/node.js => support/node_runner.js} | 0 5 files changed, 11 insertions(+), 11 deletions(-) rename lib/execjs/{runners/basic.js => support/basic_runner.js} (100%) rename lib/execjs/{runners/node.js => support/node_runner.js} (100%) 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