Class: ExecJS::Xtrn::Node
Direct Known Subclasses
Nvm
Constant Summary
collapse
- Run =
{
args: %w(? .),
path: 'node',
}
- Names =
%w(nodejs node)
- Valid =
valid?
Constants inherited
from Engine
Engine::Error
Class Method Summary
collapse
Methods inherited from Engine
#call, compile, #eval, eval, exec, #exec, stats, #stats
Class Method Details
.valid? ⇒ Boolean
12
13
14
15
16
17
18
19
|
# File 'lib/execjs/xtrn/node.rb', line 12
def self.valid?
i=Names.index do |n|
Run[:args][0]=n
{"ok"=>42}==ExecJS::Xtrn::Child.new(Run).say('return 7*6') rescue nil
end
Run[:args][0]='!' unless i
!!i
end
|