Sha256: 7d8e9320fa2ab75b49e86e416a4bb7dbd51cf88675cb6855d7e718cf25c1d064

Contents?: true

Size: 955 Bytes

Versions: 21

Compression:

Stored size: 955 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, options = {})
      runtime.exec(source, options)
    end

    def eval(source, options = {})
      runtime.eval(source, options)
    end

    def compile(source, options = {})
      runtime.compile(source, options)
    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

21 entries across 21 versions & 7 rubygems

Version Path
execjs-2.10.0 lib/execjs/module.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/execjs-2.9.1/lib/execjs/module.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/execjs-2.9.1/lib/execjs/module.rb
execjs-2.9.1 lib/execjs/module.rb
execjs-2.9.0 lib/execjs/module.rb
execjs-2.8.1 lib/execjs/module.rb
execjs-2.8.0 lib/execjs/module.rb
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/execjs-2.7.0/lib/execjs/module.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/execjs-2.7.0/lib/execjs/module.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/execjs-2.7.0/lib/execjs/module.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/execjs-2.7.0/lib/execjs/module.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/execjs-2.7.0/lib/execjs/module.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/execjs-2.7.0/lib/execjs/module.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/execjs-2.7.0/lib/execjs/module.rb
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/execjs-2.7.0/lib/execjs/module.rb
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/execjs-2.7.0/lib/execjs/module.rb
zuora_connect_ui-0.7.1 vendor/ruby/2.6.0/gems/execjs-2.7.0/lib/execjs/module.rb
zuora_connect_ui-0.7.0 vendor/ruby/2.6.0/gems/execjs-2.7.0/lib/execjs/module.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/execjs-2.7.0/lib/execjs/module.rb
arcabouco-0.2.13 vendor/bundle/gems/execjs-2.7.0/lib/execjs/module.rb