guard-coffeescript 1.3.4 → 1.4.0
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/README.md +10 -7
- data/lib/guard/coffeescript.rb +3 -3
- data/lib/guard/coffeescript/inspector.rb +1 -1
- data/lib/guard/coffeescript/runner.rb +14 -7
- data/lib/guard/coffeescript/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4efe9a6c2d20f53277808c0ecac3363fd384c296
|
|
4
|
+
data.tar.gz: b77baf675bad3beae577351f9c6c3af593dd83f3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6f8a4f2e07387e25247dd3c6a8e590c865d40a9538b5e734a04eeeca1673278dd2dd1b1ce6d939e8336af61268d530751ddde2b4c94048a04a6371a4b80e5b39
|
|
7
|
+
data.tar.gz: fc1704c85997a7eccb89ece38c5e1dde02e21b2d759a507a7c4ff748e4fdcb0cd9d271e239aae21e7960d681991cca7ddc97d2f9f20629c44c123b5e7ba6fbb1
|
data/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Guard::CoffeeScript compiles or validates your CoffeeScripts automatically when files are modified.
|
|
4
4
|
If you're looking for a CoffeeScript merge tool, please checkout [Guard::CoffeeDripper](https://github.com/guard/guard-coffeedripper).
|
|
5
5
|
|
|
6
|
-
Tested on MRI Ruby 1.
|
|
6
|
+
Tested on MRI Ruby 1.9.3, 2.0.0, 2.1.0 and the latest versions of JRuby & Rubinius.
|
|
7
7
|
|
|
8
8
|
If you have any questions please join us on our [Google group](http://groups.google.com/group/guard-dev) or on `#guard`
|
|
9
9
|
(irc.freenode.net).
|
|
@@ -162,7 +162,8 @@ There following options can be passed to Guard::CoffeeScript:
|
|
|
162
162
|
|
|
163
163
|
```ruby
|
|
164
164
|
:input => 'coffeescripts' # Relative path to the input directory.
|
|
165
|
-
#
|
|
165
|
+
# Files will be added that match a suffix
|
|
166
|
+
# of /(.+\.(coffee|coffee\.md|litcoffee))
|
|
166
167
|
# default: nil
|
|
167
168
|
|
|
168
169
|
:output => 'javascripts' # Relative path to the output directory.
|
|
@@ -172,7 +173,8 @@ There following options can be passed to Guard::CoffeeScript:
|
|
|
172
173
|
# default: false
|
|
173
174
|
|
|
174
175
|
:bare => true # Compile without the top-level function wrapper.
|
|
175
|
-
# Provide either a boolean value or an Array of
|
|
176
|
+
# Provide either a boolean value or an Array of
|
|
177
|
+
# filenames.
|
|
176
178
|
# default: false
|
|
177
179
|
|
|
178
180
|
:shallow => true # Do not create nested output directories.
|
|
@@ -182,7 +184,8 @@ There following options can be passed to Guard::CoffeeScript:
|
|
|
182
184
|
# default: false
|
|
183
185
|
|
|
184
186
|
:source_root => 'coffeescripts' # Root path for coffeescript sources.
|
|
185
|
-
# Used in source map to determine root URL for
|
|
187
|
+
# Used in source map to determine root URL for
|
|
188
|
+
# all sources
|
|
186
189
|
# default: nil (using the `:input` directory)
|
|
187
190
|
|
|
188
191
|
:hide_success => true # Disable successful compilation messages.
|
|
@@ -191,8 +194,8 @@ There following options can be passed to Guard::CoffeeScript:
|
|
|
191
194
|
:all_on_start => true # Regenerate all files on startup
|
|
192
195
|
# default: false
|
|
193
196
|
|
|
194
|
-
:error_to_js => true # Print the Coffeescript error message directly in
|
|
195
|
-
# JavaScript file
|
|
197
|
+
:error_to_js => true # Print the Coffeescript error message directly in
|
|
198
|
+
# the JavaScript file
|
|
196
199
|
# default: false
|
|
197
200
|
```
|
|
198
201
|
|
|
@@ -329,7 +332,7 @@ For questions please join us in our [Google group](http://groups.google.com/grou
|
|
|
329
332
|
|
|
330
333
|
## Author
|
|
331
334
|
|
|
332
|
-
Developed by Michael Kessler, sponsored by [
|
|
335
|
+
Developed by Michael Kessler, sponsored by [FlinkFinger](http://www.flinkfinger.com).
|
|
333
336
|
|
|
334
337
|
If you like Guard::CoffeeScript, you can watch the repository at [GitHub](https://github.com/netzpirat/guard-coffeescript) and
|
|
335
338
|
follow [@netzpirat](https://twitter.com/#!/netzpirat) on Twitter for project updates.
|
data/lib/guard/coffeescript.rb
CHANGED
|
@@ -42,7 +42,7 @@ module Guard
|
|
|
42
42
|
|
|
43
43
|
if options[:input]
|
|
44
44
|
defaults.merge!({ :output => options[:input] })
|
|
45
|
-
watchers << ::Guard::Watcher.new(%r{^#{ options[:input] }/(.+\.coffee)$})
|
|
45
|
+
watchers << ::Guard::Watcher.new(%r{^#{ options[:input] }/(.+\.(?:coffee|coffee\.md|litcoffee))$})
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
super(watchers, defaults.merge(options))
|
|
@@ -61,7 +61,7 @@ module Guard
|
|
|
61
61
|
# @raise [:task_has_failed] when stop has failed
|
|
62
62
|
#
|
|
63
63
|
def run_all
|
|
64
|
-
|
|
64
|
+
run_on_modifications(Watcher.match_files(self, Dir.glob('**{,/*/**}/*.{coffee,coffee.md,litcoffee}')))
|
|
65
65
|
end
|
|
66
66
|
|
|
67
67
|
# Gets called when watched paths and files have changes.
|
|
@@ -69,7 +69,7 @@ module Guard
|
|
|
69
69
|
# @param [Array<String>] paths the changed paths and files
|
|
70
70
|
# @raise [:task_has_failed] when stop has failed
|
|
71
71
|
#
|
|
72
|
-
def
|
|
72
|
+
def run_on_modifications(paths)
|
|
73
73
|
changed_files, success = Runner.run(Inspector.clean(paths), watchers, options)
|
|
74
74
|
|
|
75
75
|
throw :task_has_failed unless success
|
|
@@ -31,7 +31,7 @@ module Guard
|
|
|
31
31
|
# @return [Boolean] when the file valid
|
|
32
32
|
#
|
|
33
33
|
def coffee_file?(path, options)
|
|
34
|
-
path =~
|
|
34
|
+
path =~ /\.(?:coffee|coffee\.md|litcoffee)$/ && (options[:missing_ok] || File.exists?(path))
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
end
|
|
@@ -134,15 +134,22 @@ module Guard
|
|
|
134
134
|
# Gets the CoffeeScript compilation options.
|
|
135
135
|
#
|
|
136
136
|
# @param [String] file the CoffeeScript file
|
|
137
|
-
# @param [Hash] options the options for the execution
|
|
137
|
+
# @param [Hash] options the options for the execution of all files
|
|
138
138
|
# @option options [Boolean] :bare do not wrap the output in a top level function
|
|
139
|
+
# @return [Hash] options for a particular file's execution
|
|
139
140
|
#
|
|
140
141
|
def options_for_file(file, options)
|
|
141
|
-
|
|
142
|
+
file_options = options.clone
|
|
143
|
+
|
|
144
|
+
# if :bare was provided an array of filenames, check for file's inclusion
|
|
145
|
+
if file_options[:bare].respond_to? :include?
|
|
146
|
+
filename = file[/([^\/]*)\.(?:coffee|coffee\.md|litcoffee)$/]
|
|
147
|
+
file_options[:bare] = file_options[:bare].include?(filename)
|
|
148
|
+
end
|
|
142
149
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
150
|
+
if file[/\.(?:coffee\.md|litcoffee)$/]
|
|
151
|
+
file_options[:literate] = true
|
|
152
|
+
end
|
|
146
153
|
|
|
147
154
|
file_options
|
|
148
155
|
end
|
|
@@ -158,7 +165,7 @@ module Guard
|
|
|
158
165
|
|
|
159
166
|
{
|
|
160
167
|
:sourceMap => true,
|
|
161
|
-
:generatedFile => filename.gsub(/(js\.coffee|coffee)$/, 'js'),
|
|
168
|
+
:generatedFile => filename.gsub(/((?:js\.)?(?:coffee|coffee\.md|litcoffee))$/, 'js'),
|
|
162
169
|
:sourceFiles => [filename],
|
|
163
170
|
:sourceRoot => options[:source_root] || options[:input] || '',
|
|
164
171
|
}
|
|
@@ -204,7 +211,7 @@ module Guard
|
|
|
204
211
|
# @param [String] directory the output directory
|
|
205
212
|
#
|
|
206
213
|
def javascript_file_name(file, directory)
|
|
207
|
-
File.join(directory, File.basename(file.gsub(/(js\.coffee|coffee)$/, 'js')))
|
|
214
|
+
File.join(directory, File.basename(file.gsub(/((?:js\.)?(?:coffee|coffee\.md|litcoffee))$/, 'js')))
|
|
208
215
|
end
|
|
209
216
|
|
|
210
217
|
# Detects the output directory for each CoffeeScript file. Builds
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: guard-coffeescript
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Kessler
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2014-02-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: guard
|
|
@@ -83,11 +83,15 @@ dependencies:
|
|
|
83
83
|
description: Guard::CoffeeScript automatically generates your JavaScripts from your
|
|
84
84
|
CoffeeScripts
|
|
85
85
|
email:
|
|
86
|
-
- michi@
|
|
86
|
+
- michi@flinkfinger.com
|
|
87
87
|
executables: []
|
|
88
88
|
extensions: []
|
|
89
89
|
extra_rdoc_files: []
|
|
90
90
|
files:
|
|
91
|
+
- LICENSE
|
|
92
|
+
- README.md
|
|
93
|
+
- lib/guard/coffeescript.rb
|
|
94
|
+
- lib/guard/coffeescript.rbc
|
|
91
95
|
- lib/guard/coffeescript/formatter.rb
|
|
92
96
|
- lib/guard/coffeescript/formatter.rbc
|
|
93
97
|
- lib/guard/coffeescript/inspector.rb
|
|
@@ -96,10 +100,6 @@ files:
|
|
|
96
100
|
- lib/guard/coffeescript/templates/Guardfile
|
|
97
101
|
- lib/guard/coffeescript/version.rb
|
|
98
102
|
- lib/guard/coffeescript/version.rbc
|
|
99
|
-
- lib/guard/coffeescript.rb
|
|
100
|
-
- lib/guard/coffeescript.rbc
|
|
101
|
-
- LICENSE
|
|
102
|
-
- README.md
|
|
103
103
|
homepage: http://github.com/netzpirat/guard-coffeescript
|
|
104
104
|
licenses:
|
|
105
105
|
- MIT
|
|
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
120
120
|
version: 1.3.6
|
|
121
121
|
requirements: []
|
|
122
122
|
rubyforge_project: guard-coffeescript
|
|
123
|
-
rubygems_version: 2.1
|
|
123
|
+
rubygems_version: 2.2.1
|
|
124
124
|
signing_key:
|
|
125
125
|
specification_version: 4
|
|
126
126
|
summary: Guard gem for CoffeeScript
|