Module: TypeScript::Src
- Defined in:
- lib/typescript-src.rb
Class Method Summary collapse
-
.const_missing(name) ⇒ Object
to lazy loading.
- .js_content ⇒ String
- .js_path ⇒ Pathname
- .license_path ⇒ Pathname
- .package_info ⇒ Hash
- .package_json_path ⇒ Pathname
- .tsc_path ⇒ Pathname
- .typescript_path ⇒ Pathname
Class Method Details
.const_missing(name) ⇒ Object
to lazy loading
47 48 49 |
# File 'lib/typescript-src.rb', line 47 def const_missing(name) package_info[name.downcase.to_s] end |
.js_content ⇒ String
35 36 37 |
# File 'lib/typescript-src.rb', line 35 def js_content js_path.read end |
.js_path ⇒ Pathname
18 19 20 |
# File 'lib/typescript-src.rb', line 18 def js_path typescript_path.join('bin/typescript.js') end |
.license_path ⇒ Pathname
28 29 30 |
# File 'lib/typescript-src.rb', line 28 def license_path typescript_path.join('LICENSE.txt') end |
.package_info ⇒ Hash
40 41 42 |
# File 'lib/typescript-src.rb', line 40 def package_info JSON.parse(package_json_path.read) end |
.package_json_path ⇒ Pathname
23 24 25 |
# File 'lib/typescript-src.rb', line 23 def package_json_path typescript_path.join('package.json') end |
.tsc_path ⇒ Pathname
13 14 15 |
# File 'lib/typescript-src.rb', line 13 def tsc_path typescript_path.join('bin/tsc') end |
.typescript_path ⇒ 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 |