diff --git a/README.md b/README.md index b0a27c6..567ac4d 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ ExecJS supports these runtimes: embedded within Ruby * [Node.js](http://nodejs.org/) * Apple JavaScriptCore - Included with Mac OS X -* [Mozilla Spidermonkey](http://www.mozilla.org/js/spidermonkey/) +* [Mozilla SpiderMonkey](http://www.mozilla.org/js/spidermonkey/) * [Microsoft Windows Script Host](http://msdn.microsoft.com/en-us/library/9bbdkx3k.aspx) (JScript) A short example: diff --git a/lib/execjs/runtimes.rb b/lib/execjs/runtimes.rb index 83b92f6..2c04e4c 100644 --- a/lib/execjs/runtimes.rb +++ b/lib/execjs/runtimes.rb @@ -28,8 +28,8 @@ module ExecJS :conversion => { :from => "ISO8859-1", :to => "UTF-8" } ) - Spidermonkey = ExternalRuntime.new( - :name => "Spidermonkey", + SpiderMonkey = Spidermonkey = ExternalRuntime.new( + :name => "SpiderMonkey", :command => "js", :runner_path => ExecJS.root + "/support/basic_runner.js" ) @@ -57,7 +57,7 @@ module ExecJS if runtime.available? runtime if runtime.available? else - raise RuntimeUnavailable, "#{name} runtime is not available on this system" + raise RuntimeUnavailable, "#{runtime.name} runtime is not available on this system" end elsif !name.empty? raise RuntimeUnavailable, "#{name} runtime is not defined" @@ -66,7 +66,7 @@ module ExecJS end def self.names - constants + @names ||= constants.inject({}) { |h, name| h.merge(const_get(name) => name) }.values end def self.runtimes @@ -77,7 +77,7 @@ module ExecJS Mustang, Node, JavaScriptCore, - Spidermonkey, + SpiderMonkey, JScript ] end