Module: ExecJS::Xtrn

Defined in:
lib/execjs/xtrn/version.rb,
lib/execjs/xtrn/init.rb

Defined Under Namespace

Classes: Child, Engine, Error, Node, Nvm, Wsh

Constant Summary collapse

VERSION =
"1.0.0"
Engines =
[Nvm, Node, Wsh]

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.engine ⇒ Object

Returns the value of attribute engine.



6
7
8
# File 'lib/execjs/xtrn/init.rb', line 6

def engine
  @engine
end

Class Method Details

.init ⇒ Object

Install into ExecJS



13
14
15
16
17
# File 'lib/execjs/xtrn/init.rb', line 13

def self.init
  slf=self
  sc=(class<<ExecJS;self;end)
  Engine.methods(false).each{|m| sc.instance_eval{define_method(m){|*args| slf.engine.send m, *args }}}
end

.stats ⇒ Object



21
22
23
# File 'lib/execjs/xtrn/init.rb', line 21

def self.stats
  Hash[([Child, Engine]+Engines).map{|k| [k.name.sub(/.*\W/, ''), k.stats]}]
end