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.5.14 vendor/bundle/gems/execjs-1.4.0/lib/execjs/module.rb
classiccms-0.5.14 vendor/bundle/gems/execjs-1.3.0/lib/execjs/module.rb
classiccms-0.5.13 vendor/bundle/gems/execjs-1.3.0/lib/execjs/module.rb
classiccms-0.5.13 vendor/bundle/gems/execjs-1.4.0/lib/execjs/module.rb
classiccms-0.5.13 vendor/bundle/gems/execjs-1.3.2/lib/execjs/module.rb
classiccms-0.5.12 vendor/bundle/gems/execjs-1.3.0/lib/execjs/module.rb
classiccms-0.5.12 vendor/bundle/gems/execjs-1.4.0/lib/execjs/module.rb
classiccms-0.5.12 vendor/bundle/gems/execjs-1.3.2/lib/execjs/module.rb
classiccms-0.5.11 vendor/bundle/gems/execjs-1.3.0/lib/execjs/module.rb
classiccms-0.5.11 vendor/bundle/gems/execjs-1.4.0/lib/execjs/module.rb
classiccms-0.5.11 vendor/bundle/gems/execjs-1.3.2/lib/execjs/module.rb
classiccms-0.5.10 vendor/bundle/gems/execjs-1.3.2/lib/execjs/module.rb
classiccms-0.5.10 vendor/bundle/gems/execjs-1.3.0/lib/execjs/module.rb
classiccms-0.5.10 vendor/bundle/gems/execjs-1.4.0/lib/execjs/module.rb
classiccms-0.5.9 vendor/bundle/gems/execjs-1.3.2/lib/execjs/module.rb
classiccms-0.5.9 vendor/bundle/gems/execjs-1.4.0/lib/execjs/module.rb
classiccms-0.5.9 vendor/bundle/gems/execjs-1.3.0/lib/execjs/module.rb
classiccms-0.5.8 vendor/bundle/gems/execjs-1.3.0/lib/execjs/module.rb
classiccms-0.5.8 vendor/bundle/gems/execjs-1.4.0/lib/execjs/module.rb
classiccms-0.5.8 vendor/bundle/gems/execjs-1.3.2/lib/execjs/module.rb