Sha256: 70be5ad73842d1281477c206b2021f5435a0c60e215e07e760c0828d5d0e55c4

Contents?: true

Size: 1012 Bytes

Versions: 1

Compression:

Stored size: 1012 Bytes

Contents

require 'json'
require 'pathname'
require 'typescript-src/version'

module TypeScript
  module Src
    class << self
      # @return [Pathname]
      def typescript_path
        @typescript_path ||= ::Pathname.new(File.dirname(__FILE__)).join('typescript-src/support/typescript')
      end

      # @return [Pathname]
      def tsc_path
        typescript_path.join('bin/tsc')
      end

      # @return [Pathname]
      def js_path
        typescript_path.join('bin/typescript.js')
      end

      # @return [Pathname]
      def package_json_path
        typescript_path.join('package.json')
      end

      # @return [Pathname]
      def license_path
        typescript_path.join('LICENSE.txt')
      end

      ### contents

      # @return [String]
      def js_content
        js_path.read
      end

      # @return [Hash]
      def package_info
        JSON.parse(package_json_path.read)
      end

      # @return [String]
      def version
        package_info['version']
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
typescript-src-1.0.1.2 lib/typescript-src.rb