Skip to content

Commit 535e08f

Browse files
committed
Now this gem tries to find installed typescript module and use it for .ts files compilation
1 parent 9cd0a28 commit 535e08f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

lib/typescript-src.rb

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@ module Src
77
class << self
88
# @return [Pathname]
99
def typescript_path
10-
@typescript_path ||= ::Pathname.new(File.dirname(__FILE__)).join('typescript-src/support/typescript')
10+
unless @typescript_path
11+
begin
12+
@typescript_path = ::Pathname.new(`npm root -g`.strip! + '/typescript')
13+
rescue
14+
@typescript_path = ::Pathname.new(File.dirname(__FILE__)).join('typescript-src/support/typescript')
15+
end
16+
end
17+
18+
@typescript_path
1119
end
1220

1321
# @return [Pathname]

lib/typescript-src/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module TypeScript
22
module Src
3-
VERSION = '1.0.1.2' # TypeScript compiler version + gem's revision
3+
VERSION = '1.0.1.3' # TypeScript compiler version + gem's revision
44
end
55
end

0 commit comments

Comments
 (0)