Method: ExecJS::ExternalRuntime#exec_runtime

Defined in:
lib/execjs/external_runtime.rb

#exec_runtime(filename) ⇒ Object



144
145
146
147
148
149
150
151
152
153
154
# File 'lib/execjs/external_runtime.rb', line 144

def exec_runtime(filename)
  io = IO.popen(binary.split(' ') + [filename, {err: [:child, :out]}], @popen_options)
  output = io.read
  io.close

  if $?.success?
    output
  else
    raise RuntimeError, output
  end
end