Class: Lanes::API::Es6Compiler
Instance Method Summary
collapse
#prepare, register, #wrap_js
Instance Method Details
#evaluate(scope, locals, &block) ⇒ Object
87
88
89
90
91
92
93
94
95
|
# File 'lib/lanes/api/javascript_processor.rb', line 87
def evaluate(scope, locals, &block)
cmd = "#{Lanes.config.es6_transpiler_path} #{Lanes.config.es6_transpiler_options}"
stdout, stderr, _status = Open3.capture3(cmd, stdin_data: data)
if stderr.empty?
wrap_js scope, stdout
else
raise TranspileError, stderr
end
end
|