Module: TypeScript::Source

Defined in:
lib/typescript.rb

Class Method Summary collapse

Class Method Details

.bare_optionObject



38
39
40
# File 'lib/typescript.rb', line 38

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 ||= ENV['TYPESCRIPT_COMPILER_PATH'] || compiler_bundled_path
end

.contentsObject



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

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

.contextObject



42
43
44
# File 'lib/typescript.rb', line 42

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

.lib_contentsObject



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

def self.lib_contents
  @lib_contents ||= File.read(lib_path)
end

.lib_pathObject



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

def self.lib_path
  @lib_path ||= ENV['TYPESCRIPT_LIB_PATH'] || lib_bundled_path
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



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

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

.versionObject



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

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