module TypeScript::Src

Constants

VERSION

Public Class Methods

js_content() click to toggle source

@return [String]

# File lib/tsrc.rb, line 41
def js_content
  js_path.read
end
js_path() click to toggle source

@return [Pathname]

# 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() click to toggle source

@return [Pathname]

# File lib/tsrc.rb, line 34
def license_path
  typescript_path.join('LICENSE.txt')
end
package_info() click to toggle source

@return [Hash]

# File lib/tsrc.rb, line 46
def package_info
  JSON.parse(package_json_path.read)
end
package_json_path() click to toggle source

@return [Pathname]

# File lib/tsrc.rb, line 29
def package_json_path
  typescript_path.join('package.json')
end
tsc_path() click to toggle source

@return [Pathname]

# File lib/tsrc.rb, line 14
def tsc_path
  typescript_path.join('bin/tsc')
end
typescript_path() click to toggle source

@return [Pathname]

# File lib/tsrc.rb, line 9
def typescript_path
  @typescript_path ||= ::Pathname.new(File.dirname(__FILE__)).join('tsrc/support/typescript')
end
version() click to toggle source

@return [String]

# File lib/tsrc.rb, line 51
def version
  package_info['version']
end