Module: Processingjs
- Defined in:
- lib/processingjs.rb,
lib/processingjs/version.rb
Defined Under Namespace
Modules: Source
Constant Summary collapse
- EngineError =
ExecJS::RuntimeError
- CompilationError =
ExecJS::ProgramError
- VERSION =
"0.0.1"
Class Method Summary collapse
-
.compile(script, options = {}) ⇒ Object
Compile a script (String or IO) to JavaScript.
- .engine ⇒ Object
- .engine=(engine) ⇒ Object
- .version ⇒ Object
Class Method Details
.compile(script, options = {}) ⇒ Object
Compile a script (String or IO) to JavaScript.
47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/processingjs.rb', line 47 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 Source.context.call("Processing.compile", script)["sourceCode"] end |
.engine ⇒ Object
36 37 |
# File 'lib/processingjs.rb', line 36 def engine end |
.engine=(engine) ⇒ Object
39 40 |
# File 'lib/processingjs.rb', line 39 def engine=(engine) end |