sass 3.3.0 → 3.3.1
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/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/lib/sass/importers/filesystem.rb +3 -3
- data/lib/sass/plugin/compiler.rb +95 -52
- data/lib/sass/script/functions.rb +1 -1
- data/lib/sass/source/map.rb +3 -3
- data/lib/sass/util.rb +16 -1
- data/vendor/listen/CHANGELOG.md +175 -35
- data/vendor/listen/Gemfile +5 -15
- data/vendor/listen/README.md +111 -77
- data/vendor/listen/Rakefile +0 -42
- data/vendor/listen/lib/listen.rb +33 -19
- data/vendor/listen/lib/listen/adapter.rb +193 -82
- data/vendor/listen/lib/listen/adapters/bsd.rb +27 -64
- data/vendor/listen/lib/listen/adapters/darwin.rb +21 -58
- data/vendor/listen/lib/listen/adapters/linux.rb +23 -55
- data/vendor/listen/lib/listen/adapters/polling.rb +25 -34
- data/vendor/listen/lib/listen/adapters/windows.rb +50 -46
- data/vendor/listen/lib/listen/directory_record.rb +96 -61
- data/vendor/listen/lib/listen/listener.rb +135 -37
- data/vendor/listen/lib/listen/turnstile.rb +9 -5
- data/vendor/listen/lib/listen/version.rb +1 -1
- data/vendor/listen/listen.gemspec +6 -0
- data/vendor/listen/spec/listen/adapter_spec.rb +37 -82
- data/vendor/listen/spec/listen/adapters/polling_spec.rb +8 -8
- data/vendor/listen/spec/listen/directory_record_spec.rb +81 -56
- data/vendor/listen/spec/listen/listener_spec.rb +128 -39
- data/vendor/listen/spec/listen_spec.rb +15 -21
- data/vendor/listen/spec/spec_helper.rb +4 -0
- data/vendor/listen/spec/support/adapter_helper.rb +52 -15
- data/vendor/listen/spec/support/directory_record_helper.rb +7 -5
- data/vendor/listen/spec/support/listeners_helper.rb +30 -7
- metadata +3 -23
- data/ext/mkrf_conf.rb +0 -27
- data/vendor/listen/lib/listen/dependency_manager.rb +0 -126
- data/vendor/listen/lib/listen/multi_listener.rb +0 -143
- data/vendor/listen/spec/listen/dependency_manager_spec.rb +0 -107
- data/vendor/listen/spec/listen/multi_listener_spec.rb +0 -174
data/vendor/listen/Gemfile
CHANGED
@@ -1,30 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
source :rubygems
|
1
|
+
source 'https://rubygems.org'
|
4
2
|
|
5
3
|
gemspec
|
6
4
|
|
7
5
|
gem 'rake'
|
8
6
|
|
9
|
-
|
10
|
-
gem '
|
11
|
-
gem 'rb-inotify', '~> 0.9.0' if RbConfig::CONFIG['target_os'] =~ /linux/i
|
12
|
-
gem 'wdm', '~> 0.0.3' if RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i
|
7
|
+
require 'rbconfig'
|
8
|
+
gem 'wdm', '>= 0.1.0' if RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i
|
13
9
|
|
14
10
|
group :development do
|
15
|
-
platform :ruby do
|
16
|
-
gem 'coolline'
|
17
|
-
end
|
18
|
-
|
19
|
-
gem 'guard'
|
20
11
|
gem 'guard-rspec'
|
21
12
|
gem 'yard'
|
22
13
|
gem 'redcarpet'
|
23
|
-
gem '
|
24
|
-
|
25
|
-
gem 'vagrant'
|
14
|
+
gem 'pimpmychangelog'
|
26
15
|
end
|
27
16
|
|
28
17
|
group :test do
|
29
18
|
gem 'rspec'
|
19
|
+
gem 'coveralls', :require => false
|
30
20
|
end
|
data/vendor/listen/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Listen [](http://travis-ci.org/guard/listen)
|
1
|
+
# Listen [](http://badge.fury.io/rb/listen) [](http://travis-ci.org/guard/listen) [](https://gemnasium.com/guard/listen) [](https://codeclimate.com/github/guard/listen) [](https://coveralls.io/r/guard/listen)
|
2
2
|
|
3
3
|
The Listen gem listens to file modifications and notifies you about the changes.
|
4
4
|
|
@@ -9,24 +9,60 @@ The Listen gem listens to file modifications and notifies you about the changes.
|
|
9
9
|
* OS-specific adapters for Mac OS X 10.6+, Linux, *BSD and Windows.
|
10
10
|
* Automatic fallback to polling if OS-specific adapter doesn't work.
|
11
11
|
* Detects file modification, addition and removal.
|
12
|
-
*
|
12
|
+
* File content checksum comparison for modifications made under the same second.
|
13
13
|
* Allows supplying regexp-patterns to ignore and filter paths for better results.
|
14
|
-
* Tested on all Ruby environments via [
|
14
|
+
* Tested on all Ruby environments via [Travis CI](https://travis-ci.org/guard/listen).
|
15
|
+
|
16
|
+
## Pending features
|
17
|
+
|
18
|
+
Still not implemented, pull requests are welcome.
|
19
|
+
|
20
|
+
* Symlinks support. [#25](https://github.com/guard/listen/issues/25)
|
21
|
+
* Signal handling. [#105](https://github.com/guard/listen/issues/105)
|
22
|
+
* Non-recursive directory scanning. [#111](https://github.com/guard/listen/issues/111)
|
15
23
|
|
16
24
|
## Install
|
17
25
|
|
18
|
-
|
19
|
-
|
26
|
+
### Using Bundler
|
27
|
+
|
28
|
+
The simplest way to install Listen is to use Bundler.
|
29
|
+
|
30
|
+
Add Listen to your Gemfile:
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
group :development do
|
34
|
+
gem 'listen'
|
35
|
+
end
|
36
|
+
```
|
37
|
+
|
38
|
+
and install it by running Bundler:
|
39
|
+
|
40
|
+
```bash
|
41
|
+
$ bundle
|
42
|
+
```
|
43
|
+
|
44
|
+
### Install the gem with RubyGems
|
45
|
+
|
46
|
+
```bash
|
47
|
+
$ gem install listen
|
48
|
+
```
|
49
|
+
|
50
|
+
### On Windows
|
51
|
+
|
52
|
+
If your are on Windows and using Ruby MRI >= 1.9.2 you can try to use the [`wdm`](https://github.com/Maher4Ever/wdm) instead of polling.
|
53
|
+
Please add the following to your Gemfile:
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
require 'rbconfig'
|
57
|
+
gem 'wdm', '>= 0.1.0' if RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i
|
20
58
|
```
|
21
59
|
|
22
60
|
## Usage
|
23
61
|
|
24
62
|
There are **two ways** to use Listen:
|
25
63
|
|
26
|
-
1. Call `Listen.to
|
27
|
-
2. Create a `listener` object and use it in
|
28
|
-
|
29
|
-
Feel free to give your feeback via [Listen issues](https://github.com/guard/listen/issues)
|
64
|
+
1. Block API: Call `Listen.to`/`Listen.to!` with either a single directory or multiple directories, then define the `change` callback in a block.
|
65
|
+
2. "Object" API: Create a `listener` object and use it in a chainable way.
|
30
66
|
|
31
67
|
### Block API
|
32
68
|
|
@@ -51,11 +87,13 @@ listener = listener.filter(/\.rb$/)
|
|
51
87
|
listener = listener.latency(0.5)
|
52
88
|
listener = listener.force_polling(true)
|
53
89
|
listener = listener.polling_fallback_message(false)
|
90
|
+
listener = listener.force_adapter(Listen::Adapters::Linux)
|
54
91
|
listener = listener.change(&callback)
|
55
|
-
listener.start
|
92
|
+
listener.start
|
56
93
|
```
|
57
94
|
|
58
|
-
|
95
|
+
**Note**: All the "Object" API methods except `start`/`start!` return the listener
|
96
|
+
and are thus chainable:
|
59
97
|
|
60
98
|
``` ruby
|
61
99
|
Listen.to('dir/path/to/listen')
|
@@ -65,7 +103,7 @@ Listen.to('dir/path/to/listen')
|
|
65
103
|
.force_polling(true)
|
66
104
|
.polling_fallback_message('custom message')
|
67
105
|
.change(&callback)
|
68
|
-
.start
|
106
|
+
.start
|
69
107
|
```
|
70
108
|
|
71
109
|
### Pause/Unpause
|
@@ -74,35 +112,11 @@ Listener can also easily be paused/unpaused:
|
|
74
112
|
|
75
113
|
``` ruby
|
76
114
|
listener = Listen.to('dir/path/to/listen')
|
77
|
-
listener.start
|
115
|
+
listener.start # non-blocking mode
|
78
116
|
listener.pause # stop listening to changes
|
79
117
|
listener.paused? # => true
|
80
|
-
listener.unpause
|
81
|
-
listener.stop
|
82
|
-
```
|
83
|
-
|
84
|
-
## Listening to changes on multiple directories
|
85
|
-
|
86
|
-
The Listen gem provides the `MultiListener` class to watch multiple directories and
|
87
|
-
handle their changes from a single listener:
|
88
|
-
|
89
|
-
```ruby
|
90
|
-
listener = Listen::MultiListener.new('app/css', 'app/js')
|
91
|
-
listener.latency(0.5)
|
92
|
-
|
93
|
-
# Configure the listener to your needs...
|
94
|
-
|
95
|
-
listener.start # blocks execution!
|
96
|
-
````
|
97
|
-
|
98
|
-
For an easier access, the `Listen.to` method can also be used to create a multi-listener:
|
99
|
-
|
100
|
-
``` ruby
|
101
|
-
listener = Listen.to('app/css', 'app/js')
|
102
|
-
.ignore(%r{^vendor/}) # both js/vendor and css/vendor will be ignored
|
103
|
-
.change(&assets_callback)
|
104
|
-
|
105
|
-
listener.start # blocks execution!
|
118
|
+
listener.unpause # start listening to changes again
|
119
|
+
listener.stop # stop completely the listener
|
106
120
|
```
|
107
121
|
|
108
122
|
## Changes callback
|
@@ -112,7 +126,7 @@ The registered callback gets invoked, when there are changes, with **three** par
|
|
112
126
|
`modified_paths`, `added_paths` and `removed_paths` in that particular order.
|
113
127
|
|
114
128
|
You can register a callback in two ways. The first way is by passing a block when calling
|
115
|
-
the `Listen.to
|
129
|
+
the `Listen.to`/`Listen.to!` method or when initializing a listener object:
|
116
130
|
|
117
131
|
```ruby
|
118
132
|
Listen.to('path/to/app') do |modified, added, removed|
|
@@ -127,7 +141,7 @@ end
|
|
127
141
|
|
128
142
|
```
|
129
143
|
|
130
|
-
The second way to register a callback is
|
144
|
+
The second way to register a callback is by calling the `#change` method on a
|
131
145
|
listener passing it a block:
|
132
146
|
|
133
147
|
```ruby
|
@@ -139,7 +153,7 @@ end
|
|
139
153
|
listener = Listen.to('dir')
|
140
154
|
listener.change(&callback) # convert the callback to a block and register it
|
141
155
|
|
142
|
-
listener.start
|
156
|
+
listener.start
|
143
157
|
```
|
144
158
|
|
145
159
|
### Paths in callbacks
|
@@ -168,7 +182,7 @@ Listen.to('/home/user/app/css', :relative_paths => true) do |modified, added, re
|
|
168
182
|
end
|
169
183
|
```
|
170
184
|
|
171
|
-
Passing the `:relative_paths => true` option won't work when
|
185
|
+
Passing the `:relative_paths => true` option won't work when listening to multiple
|
172
186
|
directories:
|
173
187
|
|
174
188
|
```ruby
|
@@ -181,29 +195,33 @@ end
|
|
181
195
|
|
182
196
|
## Options
|
183
197
|
|
184
|
-
|
198
|
+
All the following options can be set through the `Listen.to`/`Listen.to!` params
|
199
|
+
or via ["Object" API](#object-api) methods:
|
185
200
|
|
186
201
|
```ruby
|
187
|
-
:
|
188
|
-
|
202
|
+
:ignore => %r{app/CMake/}, /\.pid$/ # Ignore a list of paths (root directory or sub-dir)
|
203
|
+
# default: See DEFAULT_IGNORED_DIRECTORIES and DEFAULT_IGNORED_EXTENSIONS in Listen::DirectoryRecord
|
204
|
+
|
205
|
+
:filter => /\.rb$/, /\.coffee$/ # Filter files to listen to via a regexps list.
|
206
|
+
# default: none
|
189
207
|
|
190
|
-
:
|
191
|
-
|
208
|
+
:latency => 0.5 # Set the delay (**in seconds**) between checking for changes
|
209
|
+
# default: 0.25 sec (1.0 sec for polling)
|
192
210
|
|
193
|
-
:
|
194
|
-
|
211
|
+
:force_adapter => Listen::Adapters::Linux # Force the use of a particular adapter class
|
212
|
+
# default: none
|
195
213
|
|
196
|
-
:
|
197
|
-
|
214
|
+
:force_polling => true # Force the use of the polling adapter
|
215
|
+
# default: none
|
198
216
|
|
199
|
-
:
|
200
|
-
|
217
|
+
:polling_fallback_message => 'custom message' # Set a custom polling fallback message (or disable it with false)
|
218
|
+
# default: "Listen will be polling for changes. Learn more at https://github.com/guard/listen#polling-fallback."
|
201
219
|
|
202
|
-
:
|
203
|
-
|
220
|
+
:relative_paths => true # Enable the use of relative paths in the callback.
|
221
|
+
# default: false
|
204
222
|
```
|
205
223
|
|
206
|
-
###
|
224
|
+
### Note on the patterns for ignoring and filtering paths
|
207
225
|
|
208
226
|
Just like the unix convention of beginning absolute paths with the
|
209
227
|
directory-separator (forward slash `/` in unix) and with no prefix for relative paths,
|
@@ -217,53 +235,68 @@ and not `%r{/build/}`.
|
|
217
235
|
|
218
236
|
Use `#filter!` and `#ignore!` methods to overwrites default patterns.
|
219
237
|
|
220
|
-
|
238
|
+
## Blocking listening to changes
|
221
239
|
|
222
|
-
|
223
|
-
|
240
|
+
Calling `Listen.to` with a block doesn't block the current thread. If you want
|
241
|
+
to block the current thread instead until the listener is stopped (which needs
|
242
|
+
to be done from another thread), you can use `Listen.to!`.
|
224
243
|
|
225
|
-
|
226
|
-
|
227
|
-
the listener (be it `Listener` or `MultiListener`) needs to be called with `false` as a parameter.
|
244
|
+
Similarly, if you're using the "Object" API, you can use `#start!` instead of `#start` to block the
|
245
|
+
current thread until the listener is stopped.
|
228
246
|
|
229
|
-
Here is an example of using a listener in the
|
247
|
+
Here is an example of using a listener in the blocking mode:
|
248
|
+
|
249
|
+
```ruby
|
250
|
+
Listen.to!('dir/path/to/listen') # block execution
|
251
|
+
|
252
|
+
# Code here will not run until the listener is stopped
|
253
|
+
|
254
|
+
```
|
255
|
+
|
256
|
+
Here is an example of using a listener started with the "Object" API in blocking mode:
|
230
257
|
|
231
258
|
```ruby
|
232
259
|
listener = Listen.to('dir/path/to/listen')
|
233
|
-
listener.start
|
260
|
+
listener.start! # block execution
|
234
261
|
|
235
|
-
# Code here will run
|
262
|
+
# Code here will not run until the listener is stopped
|
236
263
|
|
237
264
|
```
|
238
265
|
|
239
|
-
**
|
240
|
-
|
266
|
+
**Note**: Using the `Listen.to!` helper-method with or without a callback-block
|
267
|
+
will always start the listener right away and block execution of the current thread.
|
241
268
|
|
242
269
|
## Listen adapters
|
243
270
|
|
244
271
|
The Listen gem has a set of adapters to notify it when there are changes.
|
245
|
-
There are
|
246
|
-
as they use some system-calls to implement the notifying function.
|
272
|
+
There are 4 OS-specific adapters to support Mac, Linux, *BSD and Windows.
|
273
|
+
These adapters are fast as they use some system-calls to implement the notifying function.
|
247
274
|
|
248
275
|
There is also a polling adapter which is a cross-platform adapter and it will
|
249
276
|
work on any system. This adapter is unfortunately slower than the rest of the adapters.
|
250
277
|
|
251
278
|
The Listen gem will choose the best and working adapter for your machine automatically. If you
|
252
279
|
want to force the use of the polling adapter, either use the `:force_polling` option
|
253
|
-
while initializing the listener or call the
|
280
|
+
while initializing the listener or call the `#force_polling` method on your listener
|
254
281
|
before starting it.
|
255
282
|
|
283
|
+
It is also possible to force the use of a particular adapter, by using the `:force_adapter`
|
284
|
+
option. This option skips the usual adapter choosing mechanism and uses the given
|
285
|
+
adapter class instead. The adapter choosing mechanism requires write permission
|
286
|
+
to your watched directories and will needlessly load code, which isn't always desirable.
|
287
|
+
|
256
288
|
## Polling fallback
|
257
289
|
|
258
290
|
When a OS-specific adapter doesn't work the Listen gem automatically falls back to the polling adapter.
|
259
291
|
Here are some things you could try to avoid the polling fallback:
|
260
292
|
|
261
293
|
* [Update your Dropbox client](http://www.dropbox.com/downloading) (if used).
|
262
|
-
* Increase latency. (Please [open an issue](https://github.com/guard/listen/issues/new)
|
294
|
+
* Increase latency. (Please [open an issue](https://github.com/guard/listen/issues/new)
|
295
|
+
if you think that default is too low.)
|
263
296
|
* Move or rename the listened folder.
|
264
297
|
* Update/reboot your OS.
|
265
298
|
|
266
|
-
If your application keeps using the polling-adapter and you can't figure out why, feel free to [open an issue](https://github.com/guard/listen/issues/new) (and be sure to give all the details).
|
299
|
+
If your application keeps using the polling-adapter and you can't figure out why, feel free to [open an issue](https://github.com/guard/listen/issues/new) (and be sure to [give all the details](https://github.com/guard/listen/blob/master/CONTRIBUTING.md)).
|
267
300
|
|
268
301
|
## Development [](https://gemnasium.com/guard/listen)
|
269
302
|
|
@@ -273,16 +306,16 @@ If your application keeps using the polling-adapter and you can't figure out why
|
|
273
306
|
Pull requests are very welcome! Please try to follow these simple rules if applicable:
|
274
307
|
|
275
308
|
* Please create a topic branch for every separate change you make.
|
276
|
-
* Make sure your patches are well tested. All specs
|
309
|
+
* Make sure your patches are well tested. All specs must pass on [Travis CI](https://travis-ci.org/guard/listen).
|
277
310
|
* Update the [Yard](http://yardoc.org/) documentation.
|
278
|
-
* Update the README.
|
279
|
-
* Update the CHANGELOG for noteworthy changes
|
311
|
+
* Update the [README](https://github.com/guard/listen/blob/master/README.md).
|
312
|
+
* Update the [CHANGELOG](https://github.com/guard/listen/blob/master/CHANGELOG.md) for noteworthy changes (don't forget to run `bundle exec pimpmychangelog` and watch the magic happen)!
|
280
313
|
* Please **do not change** the version number.
|
281
314
|
|
282
315
|
For questions please join us in our [Google group](http://groups.google.com/group/guard-dev) or on
|
283
316
|
`#guard` (irc.freenode.net).
|
284
317
|
|
285
|
-
##
|
318
|
+
## Acknowledgments
|
286
319
|
|
287
320
|
* [Michael Kessler (netzpirat)][] for having written the [initial specs](https://github.com/guard/listen/commit/1e457b13b1bb8a25d2240428ce5ed488bafbed1f).
|
288
321
|
* [Travis Tilley (ttilley)][] for this awesome work on [fssm][] & [rb-fsevent][].
|
@@ -311,5 +344,6 @@ For questions please join us in our [Google group](http://groups.google.com/grou
|
|
311
344
|
[rb-inotify]: https://github.com/nex3/rb-inotify
|
312
345
|
[stereobooster]: https://github.com/stereobooster
|
313
346
|
[rb-fchange]: https://github.com/stereobooster/rb-fchange
|
347
|
+
[rb-kqueue]: https://github.com/mat813/rb-kqueue
|
314
348
|
[Yehuda Katz (wycats)]: https://github.com/wycats
|
315
349
|
[vigilo]: https://github.com/wycats/vigilo
|
data/vendor/listen/Rakefile
CHANGED
@@ -3,45 +3,3 @@ require 'rspec/core/rake_task'
|
|
3
3
|
|
4
4
|
RSpec::Core::RakeTask.new(:spec)
|
5
5
|
task :default => :spec
|
6
|
-
|
7
|
-
require 'rbconfig'
|
8
|
-
namespace(:spec) do
|
9
|
-
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/i
|
10
|
-
desc "Run all specs on multiple ruby versions (requires pik)"
|
11
|
-
task(:portability) do
|
12
|
-
%w[187 192 161].each do |version|
|
13
|
-
system "cmd /c echo -----------#{version}------------ & " +
|
14
|
-
"pik use #{version} & " +
|
15
|
-
"bundle install & " +
|
16
|
-
"bundle exec rspec spec"
|
17
|
-
end
|
18
|
-
end
|
19
|
-
else
|
20
|
-
desc "Run all specs on multiple ruby versions (requires rvm)"
|
21
|
-
task(:portability) do
|
22
|
-
travis_config_file = File.expand_path("../.travis.yml", __FILE__)
|
23
|
-
begin
|
24
|
-
travis_options ||= YAML::load_file(travis_config_file)
|
25
|
-
rescue => ex
|
26
|
-
puts "Travis config file '#{travis_config_file}' could not be found: #{ex.message}"
|
27
|
-
return
|
28
|
-
end
|
29
|
-
|
30
|
-
travis_options['rvm'].each do |version|
|
31
|
-
system <<-BASH
|
32
|
-
bash -c 'source ~/.rvm/scripts/rvm;
|
33
|
-
rvm #{version};
|
34
|
-
ruby_version_string_size=`ruby -v | wc -m`
|
35
|
-
echo;
|
36
|
-
for ((c=1; c<$ruby_version_string_size; c++)); do echo -n "="; done
|
37
|
-
echo;
|
38
|
-
echo "`ruby -v`";
|
39
|
-
for ((c=1; c<$ruby_version_string_size; c++)); do echo -n "="; done
|
40
|
-
echo;
|
41
|
-
RBXOPT="-Xrbc.db" bundle install;
|
42
|
-
RBXOPT="-Xrbc.db" bundle exec rspec spec -f doc 2>&1;'
|
43
|
-
BASH
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
data/vendor/listen/lib/listen.rb
CHANGED
@@ -1,24 +1,20 @@
|
|
1
|
-
|
1
|
+
require 'listen/turnstile'
|
2
|
+
require 'listen/listener'
|
3
|
+
require 'listen/directory_record'
|
4
|
+
require 'listen/adapter'
|
2
5
|
|
3
|
-
|
4
|
-
autoload :Listener, 'listen/listener'
|
5
|
-
autoload :MultiListener, 'listen/multi_listener'
|
6
|
-
autoload :DirectoryRecord, 'listen/directory_record'
|
7
|
-
autoload :DependencyManager, 'listen/dependency_manager'
|
8
|
-
autoload :Adapter, 'listen/adapter'
|
6
|
+
module Listen
|
9
7
|
|
10
8
|
module Adapters
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
autoload :Windows, 'listen/adapters/windows'
|
15
|
-
autoload :Polling, 'listen/adapters/polling'
|
9
|
+
Adapter::ADAPTERS.each do |adapter|
|
10
|
+
require "listen/adapters/#{adapter.downcase}"
|
11
|
+
end
|
16
12
|
end
|
17
13
|
|
18
|
-
# Listens to
|
14
|
+
# Listens to file system modifications on a either single directory or multiple directories.
|
15
|
+
# When calling this method, the current thread is not blocked.
|
19
16
|
#
|
20
17
|
# @param (see Listen::Listener#new)
|
21
|
-
# @param (see Listen::MultiListener#new)
|
22
18
|
#
|
23
19
|
# @yield [modified, added, removed] the changed files
|
24
20
|
# @yieldparam [Array<String>] modified the list of modified files
|
@@ -28,13 +24,31 @@ module Listen
|
|
28
24
|
# @return [Listen::Listener] the file listener if no block given
|
29
25
|
#
|
30
26
|
def self.to(*args, &block)
|
31
|
-
listener =
|
32
|
-
Listener.new(*args, &block)
|
33
|
-
else
|
34
|
-
MultiListener.new(*args, &block)
|
35
|
-
end
|
27
|
+
listener = _init_listener(*args, &block)
|
36
28
|
|
37
29
|
block ? listener.start : listener
|
38
30
|
end
|
39
31
|
|
32
|
+
# Listens to file system modifications on a either single directory or multiple directories.
|
33
|
+
# When calling this method, the current thread is blocked.
|
34
|
+
#
|
35
|
+
# @param (see Listen::Listener#new)
|
36
|
+
#
|
37
|
+
# @yield [modified, added, removed] the changed files
|
38
|
+
# @yieldparam [Array<String>] modified the list of modified files
|
39
|
+
# @yieldparam [Array<String>] added the list of added files
|
40
|
+
# @yieldparam [Array<String>] removed the list of removed files
|
41
|
+
#
|
42
|
+
# @since 1.0.0
|
43
|
+
#
|
44
|
+
def self.to!(*args, &block)
|
45
|
+
_init_listener(*args, &block).start!
|
46
|
+
end
|
47
|
+
|
48
|
+
# @private
|
49
|
+
#
|
50
|
+
def self._init_listener(*args, &block)
|
51
|
+
Listener.new(*args, &block)
|
52
|
+
end
|
53
|
+
|
40
54
|
end
|