Module: EmberScript
- Defined in:
- lib/ember_script.rb,
lib/ember_script/version.rb
Defined Under Namespace
Modules: Source Classes: EmberScriptTemplate
Constant Summary collapse
- VERSION =
"0.0.5"
Class Method Summary collapse
-
.compile(script, options = {}) ⇒ Object
Compile an EmberScript file to JavaScript or generate the source maps.
Class Method Details
.compile(script, options = {}) ⇒ Object
Compile an EmberScript file to JavaScript or generate the source maps.
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/ember_script.rb', line 38 def compile(script, = {}) script = script.read if script.respond_to?(:read) if .key?(:bare) elsif .key?(:no_wrap) [:bare] = [:no_wrap] else [:bare] = false end = [:bare] ? "--bare" : "" Source.context.call("function() { return EmberScript.em2js.apply(EmberScript, arguments); }", script, ) end |