Module: ExecJS

Defined in:
lib/execjs.rb,
lib/execjs/module.rb,
lib/execjs/runtime.rb,
lib/execjs/version.rb,
lib/execjs/encoding.rb,
lib/execjs/runtimes.rb,
lib/execjs/johnson_runtime.rb,
lib/execjs/mustang_runtime.rb,
lib/execjs/disabled_runtime.rb,
lib/execjs/external_runtime.rb,
lib/execjs/ruby_racer_runtime.rb,
lib/execjs/ruby_rhino_runtime.rb

Defined Under Namespace

Modules: Encoding, Runtimes Classes: DisabledRuntime, Error, ExternalRuntime, JohnsonRuntime, MustangRuntime, ProgramError, RubyRacerRuntime, RubyRhinoRuntime, Runtime, RuntimeError, RuntimeUnavailable

Constant Summary collapse

VERSION =
"2.2.1"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.runtimeObject

Returns the value of attribute runtime.



11
12
13
# File 'lib/execjs/module.rb', line 11

def runtime
  @runtime
end

Class Method Details

.compile(source) ⇒ Object



26
27
28
# File 'lib/execjs/module.rb', line 26

def compile(source)
  runtime.compile(source)
end

.eval(source) ⇒ Object



22
23
24
# File 'lib/execjs/module.rb', line 22

def eval(source)
  runtime.eval(source)
end

.exec(source) ⇒ Object



18
19
20
# File 'lib/execjs/module.rb', line 18

def exec(source)
  runtime.exec(source)
end

.rootObject



30
31
32
# File 'lib/execjs/module.rb', line 30

def root
  @root ||= File.expand_path("..", __FILE__)
end

.runtimesObject



91
92
93
# File 'lib/execjs/runtimes.rb', line 91

def self.runtimes
  Runtimes.runtimes
end

.windows?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/execjs/module.rb', line 34

def windows?
  @windows ||= RbConfig::CONFIG["host_os"] =~ /mswin|mingw/
end