Module: TypeScript::Source

Defined in:
lib/typescript.rb

Class Method Summary collapse

Class Method Details

.bare_optionObject



30
31
32
# File 'lib/typescript.rb', line 30

def self.bare_option
  @bare_option ||= 'bare'
end

.compiler_pathObject



13
14
15
# File 'lib/typescript.rb', line 13

def self.compiler_path
  @compiler_path ||= compiler_bundled_path
end

.contentsObject



22
23
24
# File 'lib/typescript.rb', line 22

def self.contents
  @contents ||= "#{File.read(path)}\n#{File.read(compiler_path)}"
end

.contextObject



34
35
36
# File 'lib/typescript.rb', line 34

def self.context
  @context ||= ExecJS.compile(contents)
end

.pathObject



9
10
11
# File 'lib/typescript.rb', line 9

def self.path
  @path ||= ENV['TYPESCRIPT_SOURCE_PATH'] || bundled_path
end

.path=(path) ⇒ Object



17
18
19
20
# File 'lib/typescript.rb', line 17

def self.path=(path)
  @contents = @version = @bare_option = @context = nil
  @path = path
end

.versionObject



26
27
28
# File 'lib/typescript.rb', line 26

def self.version
  @version ||= '0.8.0'
end