Module: TypeScript::Src
- Defined in:
- lib/tsrc.rb,
lib/tsrc/version.rb
Constant Summary collapse
- VERSION =
TypeScript compiler version + Gem revision
'2.1.5.0'
Class Method Summary collapse
- .js_content ⇒ String
- .js_path ⇒ Pathname
- .license_path ⇒ Pathname
- .package_info ⇒ Hash
- .package_json_path ⇒ Pathname
- .tsc_path ⇒ Pathname
- .typescript_path ⇒ Pathname
- .version ⇒ String
Class Method Details
.js_content ⇒ String
41 42 43 |
# File 'lib/tsrc.rb', line 41 def js_content js_path.read end |
.js_path ⇒ Pathname
19 20 21 22 23 24 25 26 |
# File 'lib/tsrc.rb', line 19 def js_path bin_tsc = typescript_path.join('lib/tsc.js') if ::File.exist?(bin_tsc) bin_tsc else typescript_path.join('bin/tsc.js') end end |
.license_path ⇒ Pathname
34 35 36 |
# File 'lib/tsrc.rb', line 34 def license_path typescript_path.join('LICENSE.txt') end |
.package_info ⇒ Hash
46 47 48 |
# File 'lib/tsrc.rb', line 46 def package_info JSON.parse(package_json_path.read) end |
.package_json_path ⇒ Pathname
29 30 31 |
# File 'lib/tsrc.rb', line 29 def package_json_path typescript_path.join('package.json') end |
.tsc_path ⇒ Pathname
14 15 16 |
# File 'lib/tsrc.rb', line 14 def tsc_path typescript_path.join('bin/tsc') end |
.typescript_path ⇒ Pathname
9 10 11 |
# File 'lib/tsrc.rb', line 9 def typescript_path @typescript_path ||= ::Pathname.new(File.dirname(__FILE__)).join('tsrc/support/typescript') end |
.version ⇒ String
51 52 53 |
# File 'lib/tsrc.rb', line 51 def version package_info['version'] end |