Sha256: 5fc701b78493fe2dccf14764066c1ef173191d11757f6bb662d804e804ca9398

Contents?: true

Size: 1.25 KB

Versions: 9

Compression:

Stored size: 1.25 KB

Contents

module ExecJS
  module Runtimes
    RubyRacer = RubyRacerRuntime.new

    RubyRhino = RubyRhinoRuntime.new

    Mustang = MustangRuntime.new

    Node = ExternalRuntime.new(
      :name        => "Node.js (V8)",
      :command     => ["nodejs", "node"],
      :runner_path => ExecJS.root + "/support/node_runner.js"
    )

    JavaScriptCore = ExternalRuntime.new(
      :name        => "JavaScriptCore",
      :command     => "/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc",
      :runner_path => ExecJS.root + "/support/basic_runner.js",
      :conversion => { :from => "ISO8859-1", :to => "UTF-8" }
    )

    Spidermonkey = ExternalRuntime.new(
      :name        => "Spidermonkey",
      :command     => "js",
      :runner_path => ExecJS.root + "/support/basic_runner.js"
    )

    JScript = ExternalRuntime.new(
      :name        => "JScript",
      :command     => "cscript //E:jscript //Nologo",
      :runner_path => ExecJS.root + "/support/jscript_runner.js"
    )


    def self.best_available
      runtimes.find(&:available?)
    end

    def self.runtimes
      @runtimes ||= [
        RubyRacer,
        RubyRhino,
        Mustang,
        Node,
        JavaScriptCore,
        Spidermonkey,
        JScript
      ]
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
execjs-1.0.0 lib/execjs/runtimes.rb
execjs-0.4.0 lib/execjs/runtimes.rb
execjs-0.3.4 lib/execjs/runtimes.rb
execjs-0.3.3 lib/execjs/runtimes.rb
execjs-0.3.2 lib/execjs/runtimes.rb
execjs-0.3.1 lib/execjs/runtimes.rb
execjs-0.3.0 lib/execjs/runtimes.rb
execjs-0.2.1 lib/execjs/runtimes.rb
execjs-0.2.0 lib/execjs/runtimes.rb