Sha256: 3a86b7703eb380192df63b1e3de1501ba18747df152141057836b085f3332cf4

Contents?: true

Size: 803 Bytes

Versions: 188

Compression:

Stored size: 803 Bytes

Contents

require "execjs/version"
require "rbconfig"

module ExecJS
  class Error           < ::StandardError; end
  class RuntimeError              < Error; end
  class ProgramError              < Error; end
  class RuntimeUnavailable < RuntimeError; end

  class << self
    attr_reader :runtime

    def runtime=(runtime)
      raise RuntimeUnavailable, "#{runtime.name} is unavailable on this system" unless runtime.available?
      @runtime = runtime
    end

    def exec(source)
      runtime.exec(source)
    end

    def eval(source)
      runtime.eval(source)
    end

    def compile(source)
      runtime.compile(source)
    end

    def root
      @root ||= File.expand_path("..", __FILE__)
    end

    def windows?
      @windows ||= RbConfig::CONFIG["host_os"] =~ /mswin|mingw/
    end
  end
end

Version data entries

188 entries across 97 versions & 7 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/execjs-1.4.0/lib/execjs/module.rb
classiccms-0.7.5 vendor/bundle/gems/execjs-1.3.2/lib/execjs/module.rb
classiccms-0.7.5 vendor/bundle/gems/execjs-1.3.0/lib/execjs/module.rb
classiccms-0.7.4 vendor/bundle/gems/execjs-1.3.0/lib/execjs/module.rb
classiccms-0.7.4 vendor/bundle/gems/execjs-1.3.2/lib/execjs/module.rb
classiccms-0.7.4 vendor/bundle/gems/execjs-1.4.0/lib/execjs/module.rb
classiccms-0.7.3 vendor/bundle/gems/execjs-1.3.0/lib/execjs/module.rb
classiccms-0.7.3 vendor/bundle/gems/execjs-1.3.2/lib/execjs/module.rb
classiccms-0.7.3 vendor/bundle/gems/execjs-1.4.0/lib/execjs/module.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/execjs-1.4.0/lib/execjs/module.rb
execjs-2.4.0 lib/execjs/module.rb
execjs-2.3.0 lib/execjs/module.rb
execjs-2.2.2 lib/execjs/module.rb
execjs-1.4.1 lib/execjs/module.rb
execjs-2.2.1 lib/execjs/module.rb
execjs-2.2.0 lib/execjs/module.rb
execjs-2.1.0 lib/execjs/module.rb
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/execjs-2.0.2/lib/execjs/module.rb
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/execjs-2.0.2/lib/execjs/module.rb
mango-0.7.0 vendor/bundler/ruby/2.0.0/gems/execjs-2.0.2/lib/execjs/module.rb