Sha256: 3286966793343a104a5fa48d14732c7122c41ccb00f62fb36ae323e8bd8b1d91
Contents?: true
Size: 1.32 KB
Versions: 1
Compression:
Stored size: 1.32 KB
Contents
require "rbconfig" module ExecJS VERSION = "1.0.0" class Error < ::StandardError; end class RuntimeError < Error; end class ProgramError < Error; end class RuntimeUnavailable < RuntimeError; end autoload :ExternalRuntime, "execjs/external_runtime" autoload :MustangRuntime, "execjs/mustang_runtime" autoload :RubyRacerRuntime, "execjs/ruby_racer_runtime" autoload :RubyRhinoRuntime, "execjs/ruby_rhino_runtime" autoload :Runtimes, "execjs/runtimes" class << self attr_reader :runtime def exec(source) runtime.exec(source) end def eval(source) runtime.eval(source) end def compile(source) runtime.compile(source) end def runtimes Runtimes.runtimes end def runtime=(runtime) raise RuntimeUnavailable, "#{runtime.name} is unavailable on this system" unless runtime.available? @runtime = runtime end def root @root ||= File.expand_path("../execjs", __FILE__) end def windows? @windows ||= RbConfig::CONFIG["host_os"] =~ /mswin|mingw/ end end # Eagerly detect runtime self.runtime ||= Runtimes.best_available || raise(RuntimeUnavailable, "Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.") end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
execjs-1.0.0 | lib/execjs.rb |