Class: Tilt::ES6ModuleTranspilerTemplate

Inherits:
Template
  • Object
show all
Defined in:
lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb

Constant Summary collapse

Node =
::ExecJS::ExternalRuntime.new(
  name: 'Node.js (V8)',
  command: ['nodejs', 'node'],
  runner_path: File.expand_path('../../support/es6_node_runner.js', __FILE__),
  encoding: 'UTF-8'
)

Instance Method Summary collapse

Instance Method Details

#evaluate(scope, locals, &block) ⇒ Object



19
20
21
# File 'lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb', line 19

def evaluate(scope, locals, &block)
  @output ||= Node.exec(generate_source(scope))
end

#prepareObject



14
15
16
17
# File 'lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb', line 14

def prepare
  # intentionally left empty
  # Tilt requires this method to be defined
end