Module: TypeScript::Src

Defined in:
lib/typescript-src.rb

Class Method Summary collapse

Class Method Details

.const_missing(name) ⇒ Object

to lazy loading

Parameters:

  • name (Symbol)

Returns:

  • (Object)


47
48
49
# File 'lib/typescript-src.rb', line 47

def const_missing(name)
  package_info[name.downcase.to_s]
end

.js_contentString

Returns:

  • (String)


35
36
37
# File 'lib/typescript-src.rb', line 35

def js_content
  js_path.read
end

.js_pathPathname

Returns:

  • (Pathname)


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

def js_path
  typescript_path.join('bin/typescript.js')
end

.license_pathPathname

Returns:

  • (Pathname)


28
29
30
# File 'lib/typescript-src.rb', line 28

def license_path
  typescript_path.join('LICENSE.txt')
end

.package_infoHash

Returns:

  • (Hash)


40
41
42
# File 'lib/typescript-src.rb', line 40

def package_info
  JSON.parse(package_json_path.read)
end

.package_json_pathPathname

Returns:

  • (Pathname)


23
24
25
# File 'lib/typescript-src.rb', line 23

def package_json_path
  typescript_path.join('package.json')
end

.tsc_pathPathname

Returns:

  • (Pathname)


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

def tsc_path
  typescript_path.join('bin/tsc')
end

.typescript_pathPathname

Returns:

  • (Pathname)


8
9
10
# File 'lib/typescript-src.rb', line 8

def typescript_path
  @typescript_path ||= ::Pathname.new(File.dirname(__FILE__)).join('typescript-src/support/typescript')
end