Module: TypeScript
- Defined in:
- lib/typescript.rb
Defined Under Namespace
Modules: Source
Constant Summary collapse
- EngineError =
ExecJS::RuntimeError
- CompilationError =
ExecJS::ProgramError
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.
59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/typescript.rb', line 59 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("RubyTypeScriptCompiler", Source.lib_contents, script, ) end |
.engine ⇒ Object
48 49 |
# File 'lib/typescript.rb', line 48 def engine end |
.engine=(engine) ⇒ Object
51 52 |
# File 'lib/typescript.rb', line 51 def engine=(engine) end |