Module: ExecJS
- Defined in:
- lib/execjs.rb,
lib/execjs/runtimes.rb,
lib/execjs/mustang_runtime.rb,
lib/execjs/external_runtime.rb,
lib/execjs/ruby_racer_runtime.rb,
lib/execjs/ruby_rhino_runtime.rb
Defined Under Namespace
Modules: Runtimes
Classes: Error, ExternalRuntime, MustangRuntime, ProgramError, RubyRacerRuntime, RubyRhinoRuntime, RuntimeError, RuntimeUnavailable
Constant Summary
collapse
- VERSION =
"1.0.0"
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.runtime ⇒ Object
Returns the value of attribute runtime.
18
19
20
|
# File 'lib/execjs.rb', line 18
def runtime
@runtime
end
|
Class Method Details
.compile(source) ⇒ Object
28
29
30
|
# File 'lib/execjs.rb', line 28
def compile(source)
runtime.compile(source)
end
|
.eval(source) ⇒ Object
24
25
26
|
# File 'lib/execjs.rb', line 24
def eval(source)
runtime.eval(source)
end
|
.exec(source) ⇒ Object
20
21
22
|
# File 'lib/execjs.rb', line 20
def exec(source)
runtime.exec(source)
end
|
.root ⇒ Object
41
42
43
|
# File 'lib/execjs.rb', line 41
def root
@root ||= File.expand_path("../execjs", __FILE__)
end
|
.windows? ⇒ Boolean
45
46
47
|
# File 'lib/execjs.rb', line 45
def windows?
@windows ||= RbConfig::CONFIG["host_os"] =~ /mswin|mingw/
end
|