Class: Tilt::ES6ModuleTranspilerTemplate
- Inherits:
-
Template
- Object
- Template
- Tilt::ES6ModuleTranspilerTemplate
- Defined in:
- lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Instance Method Summary collapse
Instance Attribute Details
#node ⇒ Object (readonly)
Returns the value of attribute node.
4 5 6 |
# File 'lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb', line 4 def node @node end |
Instance Method Details
#evaluate(scope, locals, &block) ⇒ Object
15 16 17 |
# File 'lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb', line 15 def evaluate(scope, locals, &block) @output ||= @node.exec(generate_source(scope)) end |
#prepare ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb', line 6 def prepare @node = ::ExecJS::ExternalRuntime.new( name: 'Node.js (V8)', command: ['nodejs', 'node'], runner_path: File.('../../support/es6_node_runner.js', __FILE__), encoding: 'UTF-8' ) end |