guard 1.8.1 → 1.8.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/CHANGELOG.md +16 -1
- data/README.md +2 -1
- data/lib/guard.rb +31 -12
- data/lib/guard/cli.rb +2 -2
- data/lib/guard/interactor.rb +5 -3
- data/lib/guard/notifier.rb +1 -1
- data/lib/guard/notifiers/tmux.rb +1 -1
- data/lib/guard/version.rb +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8fb762e56c86e00c5fd53652c39889555015b3b
|
4
|
+
data.tar.gz: d812a81ec1891b959909135b2e4f4f62d83139cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7451a09fc44f143356690ede3f094d1a5d6b0d46d0ed74958b21d9422f87ba6950b408f5c98122c0afac8080cfc28e9d7eff5c68c651aa896a1eade79b3a496b
|
7
|
+
data.tar.gz: 3d233757055d728a941375914c2070175490ea6759f23606955bb7b24783f8f5d768ba641cbd73f3aae77080c87961f3faa2c1d75348e739e94929219090ca47
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
## Master
|
2
2
|
|
3
|
-
No changes.
|
3
|
+
No changes yet.
|
4
|
+
|
5
|
+
## 1.8.2 - 30 July, 2013
|
6
|
+
|
7
|
+
### Bug fix
|
8
|
+
|
9
|
+
- [#443][] Escape `notify-send` arguments. ([@netzpirat][])
|
10
|
+
|
11
|
+
### Improvements
|
12
|
+
|
13
|
+
- [#460][], [#463][] Better Windows support. ([@cablegram][])
|
14
|
+
- [#450][] Allow multiple watch directories. ([@timmfin][])
|
4
15
|
|
5
16
|
## 1.8.1 - 17 June, 2013
|
6
17
|
|
@@ -776,7 +787,10 @@ The Listen integration has been supervised by [@thibaudgg][] and executed by [@M
|
|
776
787
|
[#414]: https://github.com/guard/guard/issues/414
|
777
788
|
[#416]: https://github.com/guard/guard/issues/416
|
778
789
|
[#443]: https://github.com/guard/guard/issues/443
|
790
|
+
[#450]: https://github.com/guard/guard/issues/450
|
779
791
|
[#453]: https://github.com/guard/guard/issues/453
|
792
|
+
[#460]: https://github.com/guard/guard/issues/460
|
793
|
+
[#463]: https://github.com/guard/guard/issues/463
|
780
794
|
[@Gazer]: https://github.com/Gazer
|
781
795
|
[@Maher4Ever]: https://github.com/Maher4Ever
|
782
796
|
[@Nerian]: https://github.com/Nerian
|
@@ -860,6 +874,7 @@ The Listen integration has been supervised by [@thibaudgg][] and executed by [@M
|
|
860
874
|
[@tarsolya]: https://github.com/tarsolya
|
861
875
|
[@thibaudgg]: https://github.com/thibaudgg
|
862
876
|
[@thierryhenrio]: https://github.com/thierryhenrio
|
877
|
+
[@timmfin]: https://github.com/timmfin
|
863
878
|
[@tinogomes]: https://github.com/tinogomes
|
864
879
|
[@tomas-zemres]: https://github.com/tomas-zemres
|
865
880
|
[@tpope]: https://github.com/tpope
|
data/README.md
CHANGED
@@ -218,10 +218,11 @@ $ guard -d # shortcut
|
|
218
218
|
|
219
219
|
#### `-w`/`--watchdir` option
|
220
220
|
|
221
|
-
Guard can watch any
|
221
|
+
Guard can watch any number of directories instead of only the current directory:
|
222
222
|
|
223
223
|
```bash
|
224
224
|
$ guard --watchdir ~/your/fancy/project
|
225
|
+
$ guard -w ~/your/fancy/project ~/your/fancier/project2 #multiple directories
|
225
226
|
$ guard -w ~/your/fancy/project # shortcut
|
226
227
|
```
|
227
228
|
|
data/lib/guard.rb
CHANGED
@@ -38,20 +38,25 @@ module Guard
|
|
38
38
|
# @option options [Boolean] notify if system notifications should be shown
|
39
39
|
# @option options [Boolean] debug if debug output should be shown
|
40
40
|
# @option options [Array<String>] group the list of groups to start
|
41
|
-
# @option options [String] watchdir the
|
41
|
+
# @option options [Array<String>] watchdir the directories to watch
|
42
42
|
# @option options [String] guardfile the path to the Guardfile
|
43
43
|
# @deprecated @option options [Boolean] watch_all_modifications watches all file modifications if true
|
44
44
|
# @deprecated @option options [Boolean] no_vendor ignore vendored dependencies
|
45
45
|
#
|
46
46
|
def setup(options = {})
|
47
|
-
@running
|
48
|
-
@lock
|
49
|
-
@options
|
50
|
-
@
|
51
|
-
@
|
52
|
-
|
53
|
-
|
54
|
-
|
47
|
+
@running = true
|
48
|
+
@lock = Mutex.new
|
49
|
+
@options = options.dup
|
50
|
+
@runner = ::Guard::Runner.new
|
51
|
+
@scope = { :plugins => [], :groups => [] }
|
52
|
+
|
53
|
+
@watchdirs = [Dir.pwd]
|
54
|
+
|
55
|
+
if options[:watchdir]
|
56
|
+
# Ensure we have an array
|
57
|
+
@watchdirs = Array(options[:watchdir]).map { |dir| File.expand_path dir }
|
58
|
+
end
|
59
|
+
|
55
60
|
::Guard::UI.clear(:force => true)
|
56
61
|
setup_debug
|
57
62
|
deprecated_options_warning
|
@@ -99,6 +104,19 @@ module Guard
|
|
99
104
|
#
|
100
105
|
def setup_listener
|
101
106
|
listener_callback = lambda do |modified, added, removed|
|
107
|
+
|
108
|
+
# Convert to relative paths (respective to the watchdir it came from)
|
109
|
+
@watchdirs.each do |watchdir|
|
110
|
+
[modified, added, removed].each do |paths|
|
111
|
+
paths.map! do |path|
|
112
|
+
if path.start_with? watchdir
|
113
|
+
path.sub "#{watchdir}#{File::SEPARATOR}", ''
|
114
|
+
else
|
115
|
+
path
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
102
120
|
::Guard::Dsl.reevaluate_guardfile if ::Guard::Watcher.match_guardfile?(modified)
|
103
121
|
|
104
122
|
::Guard.within_preserved_state do
|
@@ -106,12 +124,13 @@ module Guard
|
|
106
124
|
end
|
107
125
|
end
|
108
126
|
|
109
|
-
listener_options = {
|
127
|
+
listener_options = {}
|
110
128
|
%w[latency force_polling].each do |option|
|
111
129
|
listener_options[option.to_sym] = options[option] if options.key?(option)
|
112
130
|
end
|
113
131
|
|
114
|
-
|
132
|
+
listen_args = @watchdirs + [listener_options]
|
133
|
+
@listener = Listen.to(*listen_args).change(&listener_callback)
|
115
134
|
end
|
116
135
|
|
117
136
|
# Sets up traps to catch signals used to control Guard.
|
@@ -190,7 +209,7 @@ module Guard
|
|
190
209
|
within_preserved_state do
|
191
210
|
::Guard::UI.debug 'Guard starts all plugins'
|
192
211
|
runner.run(:start)
|
193
|
-
::Guard::UI.info "Guard is now watching at '#{ @
|
212
|
+
::Guard::UI.info "Guard is now watching at '#{ @watchdirs.join "', '" }'"
|
194
213
|
listener.start
|
195
214
|
end
|
196
215
|
end
|
data/lib/guard/cli.rb
CHANGED
@@ -48,9 +48,9 @@ module Guard
|
|
48
48
|
:banner => 'Run only the passed plugins'
|
49
49
|
|
50
50
|
method_option :watchdir,
|
51
|
-
:type => :
|
51
|
+
:type => :array,
|
52
52
|
:aliases => '-w',
|
53
|
-
:banner => 'Specify the
|
53
|
+
:banner => 'Specify the directories to watch'
|
54
54
|
|
55
55
|
method_option :guardfile,
|
56
56
|
:type => :string,
|
data/lib/guard/interactor.rb
CHANGED
@@ -89,6 +89,7 @@ module Guard
|
|
89
89
|
Pry.config.should_load_local_rc = false
|
90
90
|
Pry.config.history.file = File.expand_path(self.class.options[:history_file] || HISTORY_FILE)
|
91
91
|
|
92
|
+
@stty_exists = nil
|
92
93
|
add_hooks
|
93
94
|
|
94
95
|
replace_reset_command
|
@@ -120,7 +121,7 @@ module Guard
|
|
120
121
|
|
121
122
|
if stty_exists?
|
122
123
|
Pry.config.hooks.add_hook :after_eval, :restore_visibility do
|
123
|
-
system(
|
124
|
+
system("stty echo 2>#{ DEV_NULL }")
|
124
125
|
end
|
125
126
|
end
|
126
127
|
end
|
@@ -240,7 +241,7 @@ module Guard
|
|
240
241
|
|
241
242
|
store_terminal_settings if stty_exists?
|
242
243
|
|
243
|
-
if !@thread ||
|
244
|
+
if !@thread || !['sleep', 'run'].include?(@thread.status)
|
244
245
|
::Guard::UI.debug 'Start interactor'
|
245
246
|
|
246
247
|
@thread = Thread.new do
|
@@ -270,7 +271,8 @@ module Guard
|
|
270
271
|
# @return [Boolean] the status of stty
|
271
272
|
#
|
272
273
|
def stty_exists?
|
273
|
-
@stty_exists ||= system('hash', 'stty')
|
274
|
+
@stty_exists ||= system('hash', 'stty') ? true : false if @stty_exists.nil?
|
275
|
+
@stty_exists
|
274
276
|
end
|
275
277
|
|
276
278
|
# Stores the terminal settings so we can resore them
|
data/lib/guard/notifier.rb
CHANGED
@@ -104,7 +104,7 @@ module Guard
|
|
104
104
|
ENV['GUARD_NOTIFY'] = 'false'
|
105
105
|
else
|
106
106
|
notifications.each do |notification|
|
107
|
-
::Guard::UI.info "Guard
|
107
|
+
::Guard::UI.info "Guard is using #{ get_notifier_module(notification[:name]).to_s.split('::').last } to send notifications."
|
108
108
|
notifier = get_notifier_module(notification[:name])
|
109
109
|
notifier.turn_on(notification[:options]) if notifier.respond_to?(:turn_on)
|
110
110
|
end
|
data/lib/guard/notifiers/tmux.rb
CHANGED
data/lib/guard/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thibaud Guillaume-Gentil
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -98,16 +98,16 @@ dependencies:
|
|
98
98
|
name: rspec
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - '>='
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 2.
|
103
|
+
version: 2.14.1
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - '>='
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 2.
|
110
|
+
version: 2.14.1
|
111
111
|
description: Guard is a command line tool to easily handle events on file system modifications.
|
112
112
|
email:
|
113
113
|
- thibaud@thibaud.me
|
@@ -161,7 +161,8 @@ files:
|
|
161
161
|
- man/guard.1.html
|
162
162
|
- README.md
|
163
163
|
homepage: http://guardgem.org
|
164
|
-
licenses:
|
164
|
+
licenses:
|
165
|
+
- MIT
|
165
166
|
metadata: {}
|
166
167
|
post_install_message:
|
167
168
|
rdoc_options: []
|