File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44module TypeScript
55 module Src
66 class << self
7+ VERSION = package_info [ 'version' ] + '.2'
8+
79 # @return [Pathname]
810 def typescript_path
911 @typescript_path ||= ::Pathname . new ( File . dirname ( __FILE__ ) ) . join ( 'typescript-src/support/typescript' )
@@ -41,11 +43,9 @@ def package_info
4143 JSON . parse ( package_json_path . read )
4244 end
4345
44- # to lazy loading
45- # @param name [Symbol]
46- # @return [Object]
47- def const_missing ( name )
48- package_info [ name . downcase . to_s ]
46+ # @return [String]
47+ def version
48+ package_info [ 'version' ]
4949 end
5050 end
5151 end
Original file line number Diff line number Diff line change 11require 'test/unit'
22
33class TestTypeScriptSrc < Test ::Unit ::TestCase
4- def test_version
4+ def test_gem_version
55 assert { TypeScript ::Src ::VERSION . kind_of? ( String ) }
66 end
77
8+ def test_version
9+ assert { TypeScript ::Src . version . kind_of? ( String ) }
10+ end
11+
812 def test_package_json_path
913 assert { TypeScript ::Src . package_json_path . file? }
1014 end
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
1616 spec . files = `git ls-files` . split ( $\)
1717 spec . test_files = spec . files . grep ( %r{^(test|spec|features)/} )
1818 spec . require_path = [ 'lib' ]
19- spec . version = TypeScript ::Src ::VERSION + ".1"
19+ spec . version = TypeScript ::Src ::VERSION
2020
2121 spec . add_development_dependency 'rake'
2222end
You can’t perform that action at this time.
0 commit comments