guard-typescript 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/guard/typescript.rb +1 -0
- data/lib/guard/typescript/runner.rb +12 -3
- data/lib/guard/typescript/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b852e7764f4501ae73c86b48ce08d11f7897206
|
4
|
+
data.tar.gz: bbdf55afaf86b307a41988f11e49b8df2b53638d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41618544b681dbdd017b86e1fd6b80ac556170e8f15ac08adccc49a832b65401da8b7fc5d5897d520cee4b84e4c37c7a5756d47fb66ba5bd2d0d7231ebad8f2e
|
7
|
+
data.tar.gz: 999bded7e282fe477373e76faea194b0ecd2288eb6778079a1c264cbd26f29d565130e608008b3e4953e2a628a7b36ca1cef13ff9cb1ca7d94cf280b8b1e72fb
|
data/lib/guard/typescript.rb
CHANGED
@@ -25,6 +25,7 @@ module Guard
|
|
25
25
|
# @param [Hash] options the options for the Guard
|
26
26
|
# @option options [String] :input the input directory
|
27
27
|
# @option options [String] :output the output directory
|
28
|
+
# @option options [Boolean] :concatenate combine dependencies into files
|
28
29
|
# @option options [Boolean] :shallow do not create nested directories
|
29
30
|
# @option options [Boolean] :hide_success hide success message notification
|
30
31
|
# @option options [Boolean] :all_on_start generate all JavaScripts files on start
|
@@ -119,18 +119,27 @@ module Guard
|
|
119
119
|
# @param [String] filename the TypeScript file name
|
120
120
|
# @param [Hash] options the options for the execution
|
121
121
|
# @option options [Boolean] :source_map generate the source map files
|
122
|
+
# @option options [Boolean] :concatenate concatenate dependencies into one file
|
122
123
|
# @return [Array<String, String>] the JavaScript filename and the source map filename
|
123
124
|
#
|
124
125
|
def compile(filename, directory, options)
|
125
126
|
options = options.clone
|
126
|
-
|
127
|
-
|
127
|
+
keys = [:source_map, :source_root, :target, :module]
|
128
|
+
values = options.values_at(*keys)
|
129
|
+
compile_options = Hash[keys.zip(values)]
|
130
|
+
output_filename = javascript_file_name(filename, directory)
|
131
|
+
if options[:concatenate]
|
132
|
+
compile_options[:output] = output_filename
|
133
|
+
else
|
134
|
+
compile_options[:output_dir] = File.dirname(output_filename)
|
135
|
+
end
|
136
|
+
|
137
|
+
result = ::TypeScript.compile_file(filename, compile_options)
|
128
138
|
if options[:source_map]
|
129
139
|
js, map = result[:js], result[:source_map]
|
130
140
|
else
|
131
141
|
js = result[:js]
|
132
142
|
end
|
133
|
-
|
134
143
|
[js, map]
|
135
144
|
end
|
136
145
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-typescript
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Payton Yao
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.1.
|
33
|
+
version: 0.1.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.1.
|
40
|
+
version: 0.1.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|