Module: TypeScript::Source
- Defined in:
- lib/typescript.rb
Class Method Summary collapse
- .bare_option ⇒ Object
- .compiler_path ⇒ Object
- .contents ⇒ Object
- .context ⇒ Object
- .lib_contents ⇒ Object
- .lib_path ⇒ Object
- .path ⇒ Object
- .path=(path) ⇒ Object
- .version ⇒ Object
Class Method Details
.bare_option ⇒ Object
38 39 40 |
# File 'lib/typescript.rb', line 38 def self. @bare_option ||= 'bare' end |
.compiler_path ⇒ Object
13 14 15 |
# File 'lib/typescript.rb', line 13 def self.compiler_path @compiler_path ||= ENV['TYPESCRIPT_COMPILER_PATH'] || compiler_bundled_path end |
.contents ⇒ Object
26 27 28 |
# File 'lib/typescript.rb', line 26 def self.contents @contents ||= "#{File.read(path)}\n#{File.read(compiler_path)}" end |
.context ⇒ Object
42 43 44 |
# File 'lib/typescript.rb', line 42 def self.context @context ||= ExecJS.compile(contents) end |
.lib_contents ⇒ Object
30 31 32 |
# File 'lib/typescript.rb', line 30 def self.lib_contents @lib_contents ||= File.read(lib_path) end |
.lib_path ⇒ Object
17 18 19 |
# File 'lib/typescript.rb', line 17 def self.lib_path @lib_path ||= ENV['TYPESCRIPT_LIB_PATH'] || lib_bundled_path end |
.path ⇒ Object
9 10 11 |
# File 'lib/typescript.rb', line 9 def self.path @path ||= ENV['TYPESCRIPT_SOURCE_PATH'] || bundled_path end |
.path=(path) ⇒ Object
21 22 23 24 |
# File 'lib/typescript.rb', line 21 def self.path=(path) @contents = @version = @bare_option = @context = nil @path = path end |
.version ⇒ Object
34 35 36 |
# File 'lib/typescript.rb', line 34 def self.version @version ||= '0.8.0' end |