Sha256: f88e6e3b1eef5b6d14dca046c3bd024392af658acb1a2fd5e371ebe9b69adb8c

Contents?: true

Size: 886 Bytes

Versions: 13

Compression:

Stored size: 886 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

    def cygwin?
      @cygwin ||= RbConfig::CONFIG["host_os"] =~ /cygwin/
    end
  end
end

Version data entries

13 entries across 13 versions & 6 rubygems

Version Path
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/execjs-2.6.0/lib/execjs/module.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/execjs-2.6.0/lib/execjs/module.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/execjs-2.6.0/lib/execjs/module.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/execjs-2.6.0/lib/execjs/module.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/execjs-2.6.0/lib/execjs/module.rb
execjs-2.6.0 lib/execjs/module.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/execjs-2.5.2/lib/execjs/module.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/execjs-2.5.2/lib/execjs/module.rb
scoot-0.0.4 .bundle/gems/ruby/2.2.0/gems/execjs-2.5.2/lib/execjs/module.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/execjs-2.5.2/lib/execjs/module.rb
execjs-2.5.2 lib/execjs/module.rb
execjs-2.5.1 lib/execjs/module.rb
execjs-2.5.0 lib/execjs/module.rb