module Babel::Transpiler
Constants
- VERSION
Public Class Methods
context()
click to toggle source
# File lib/babel/transpiler.rb, line 23 def self.context @context ||= ExecJS.compile("var self = this; " + File.read(script_path)) end
script_path()
click to toggle source
# File lib/babel/transpiler.rb, line 19 def self.script_path File.join(source_path, "babel.js") end
source_path()
click to toggle source
# File lib/babel/transpiler.rb, line 15 def self.source_path Source::PATH end
source_version()
click to toggle source
# File lib/babel/transpiler.rb, line 11 def self.source_version Source::VERSION end
transform(code, options = {})
click to toggle source
# File lib/babel/transpiler.rb, line 27 def self.transform(code, options = {}) context.call('babel.transform', code, options.merge('ast' => false)) end
version()
click to toggle source
# File lib/babel/transpiler.rb, line 7 def self.version VERSION end