Module: ExecJS::Xtrn

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

Defined Under Namespace

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

Constant Summary collapse

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

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.engineObject

Returns the value of attribute engine.



8
9
10
# File 'lib/execjs/xtrn.rb', line 8

def engine
  @engine
end

Class Method Details

.initObject

Install into ExecJS



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/execjs/xtrn.rb', line 15

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

.statsObject



29
30
31
# File 'lib/execjs/xtrn.rb', line 29

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