Class: ExecJS::ExternalRuntime
- Inherits:
-
Object
- Object
- ExecJS::ExternalRuntime
- Defined in:
- lib/bpm/execjs_ext.rb
Instance Method Summary collapse
- #exec_runtime(filename) ⇒ Object
-
#initialize(options) ⇒ ExternalRuntime
constructor
A new instance of ExternalRuntime.
Constructor Details
#initialize(options) ⇒ ExternalRuntime
Returns a new instance of ExternalRuntime.
8 9 10 11 12 13 14 15 16 |
# File 'lib/bpm/execjs_ext.rb', line 8 def initialize() @name = [:name] @command = [:command] @runner_path = [:runner_path] @test_args = [:test_args] @test_match = [:test_match] @encoding = [:encoding] @binary = locate_binary end |
Instance Method Details
#exec_runtime(filename) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/bpm/execjs_ext.rb', line 18 def exec_runtime(filename) output = sh("#{@binary} #{filename} 2>&1") if $?.success? output else raise RuntimeError, output end end |