Class: ExecJS::Xtrn::Node

Inherits:
Engine
  • Object
show all
Defined in:
lib/execjs/xtrn/node.rb

Direct Known Subclasses

Nvm

Constant Summary collapse

Run =
{
  args: %w(? .),
  path: 'node',
}
Names =
%w(nodejs node iojs)
Valid =
valid?

Constants inherited from Engine

Engine::Error, Engine::PathX

Class Method Summary collapse

Methods inherited from Engine

#call, compile, #eval, eval, #exec, exec, #load, load, stats, #stats

Class Method Details

.valid?Boolean

Returns:

  • (Boolean)


12
13
14
15
16
17
18
19
# File 'lib/execjs/xtrn/node.rb', line 12

def self.valid?
  Names.each do |n|
    Run[:args][0] = n
    return true if {"ok"=>42} === bear.say('return 7*6') rescue nil
  end
  Run[:args][0]='!'
  false
end