guard-typescript 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 768777f08ac87e9f77995f7eecffca81141f7697
4
- data.tar.gz: 3ecc1715b44068d885411d46248a2f7cdeeda721
3
+ metadata.gz: 0b852e7764f4501ae73c86b48ce08d11f7897206
4
+ data.tar.gz: bbdf55afaf86b307a41988f11e49b8df2b53638d
5
5
  SHA512:
6
- metadata.gz: f80ab0e2c58692791cce1578dd1eeec37d73dad816133a18c76460b30428e4472ee801cb0e0db43ab8138cfd74f5926984d73f90f3efea55175d325c68db4bf4
7
- data.tar.gz: 934edc77c8ba5299e240a3b3d7b13af59d36de947a78f5689aed5e2a3ad2cbfe2c64950a698c88932f1fcf9356eade606346133c31444c736566018553924f7f
6
+ metadata.gz: 41618544b681dbdd017b86e1fd6b80ac556170e8f15ac08adccc49a832b65401da8b7fc5d5897d520cee4b84e4c37c7a5756d47fb66ba5bd2d0d7231ebad8f2e
7
+ data.tar.gz: 999bded7e282fe477373e76faea194b0ecd2288eb6778079a1c264cbd26f29d565130e608008b3e4953e2a628a7b36ca1cef13ff9cb1ca7d94cf280b8b1e72fb
@@ -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
- options[:output] = javascript_file_name(filename, directory)
127
- result = ::TypeScript.compile_file(filename, options)
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
 
@@ -1,6 +1,6 @@
1
1
  module Guard
2
2
  module TypeScriptVersion
3
3
  # Guard::TypeScript version that is used for the Gem specification
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
6
6
  end
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.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-23 00:00:00.000000000 Z
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.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.1
40
+ version: 0.1.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement