Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

40 lines (31 sloc) 0.835 kB
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
attr_accessor :json_options
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
Jump to Line
Something went wrong with that request. Please try again.