guard 1.8.0 → 1.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +26 -304
- data/lib/guard/dsl.rb +4 -4
- data/lib/guard/notifiers/notifysend.rb +5 -5
- data/lib/guard/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba8f46c161c351e6bea4e1e081dbdf03f3fb5d69
|
4
|
+
data.tar.gz: 72f8a3b0ebff20f11ca2965ac0048c60944c0e4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20a022bdd9430729254a79114ce133948a683a20b7612784d86b943be1529e6840b0837dfe2a911fd387fb518b9ce1bf064bf6d38bfe5b1f0d6ca72dd9cda7fd
|
7
|
+
data.tar.gz: bbc15b8533dc34a8ddf931699159e4b922c767b28e86b38461e3b57c8f929d6504dcefba2e368a2187e58d0f7cbe8851bf367dff85f558d89511dfe171cf71ba
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
## Master
|
2
|
+
|
3
|
+
No changes.
|
4
|
+
|
5
|
+
## 1.8.1 - 17 June, 2013
|
6
|
+
|
7
|
+
### Bug fixes
|
8
|
+
|
9
|
+
- [#453][] Fix a Guard error when calling `guard show` or `guard list` and
|
10
|
+
the Guardfile contains methods called directly on the listener. ([@rymai][])
|
11
|
+
- [#443][] Escape `notify-send` arguments. ([@netzpirat][])
|
12
|
+
|
1
13
|
## 1.8.0 - 20 April, 2013
|
2
14
|
|
3
15
|
### Improvements
|
@@ -763,6 +775,8 @@ The Listen integration has been supervised by [@thibaudgg][] and executed by [@M
|
|
763
775
|
[#413]: https://github.com/guard/guard/issues/413
|
764
776
|
[#414]: https://github.com/guard/guard/issues/414
|
765
777
|
[#416]: https://github.com/guard/guard/issues/416
|
778
|
+
[#443]: https://github.com/guard/guard/issues/443
|
779
|
+
[#453]: https://github.com/guard/guard/issues/453
|
766
780
|
[@Gazer]: https://github.com/Gazer
|
767
781
|
[@Maher4Ever]: https://github.com/Maher4Ever
|
768
782
|
[@Nerian]: https://github.com/Nerian
|
data/README.md
CHANGED
@@ -16,19 +16,16 @@ the following places:
|
|
16
16
|
Information on advanced topics like creating your own Guard plugin, programatic use of Guard, hooks and callbacks and
|
17
17
|
more can be found in the [Guard wiki](https://github.com/guard/guard/wiki).
|
18
18
|
|
19
|
-
Before you file an issue, make sure you have read the _[file an issue](#file-an-issue)_
|
20
|
-
important information.
|
19
|
+
Before you file an issue, make sure you have read the _[known issues](#known-issues)_ and _[file an issue](#file-an-issue)_ sections that contains some important information.
|
21
20
|
|
22
|
-
Features
|
23
|
-
--------
|
21
|
+
#### Features
|
24
22
|
|
25
23
|
* File system changes handled by our awesome [Listen](https://github.com/guard/listen) gem.
|
26
24
|
* Support for visual system notifications.
|
27
25
|
* Huge eco-system with [more than 190](https://rubygems.org/search?query=guard-) guard plugins.
|
28
26
|
* Tested against Ruby 1.8.7, 1.9.2, 1.9.3, 2.0.0, REE and the latest versions of JRuby & Rubinius.
|
29
27
|
|
30
|
-
Screencast
|
31
|
-
----------
|
28
|
+
#### Screencast
|
32
29
|
|
33
30
|
Two nice introduction screen casts to Guard are available that helps you get started:
|
34
31
|
|
@@ -40,7 +37,7 @@ Installation
|
|
40
37
|
|
41
38
|
The simplest way to install Guard is to use [Bundler](http://gembundler.com/).
|
42
39
|
|
43
|
-
Add Guard to
|
40
|
+
Add Guard (and any other dependencies) to a `Gemfile` in your project’s root:
|
44
41
|
|
45
42
|
```ruby
|
46
43
|
group :development do
|
@@ -48,7 +45,7 @@ group :development do
|
|
48
45
|
end
|
49
46
|
```
|
50
47
|
|
51
|
-
|
48
|
+
then install it by running Bundler:
|
52
49
|
|
53
50
|
```bash
|
54
51
|
$ bundle
|
@@ -60,250 +57,19 @@ Generate an empty `Guardfile` with:
|
|
60
57
|
$ guard init
|
61
58
|
```
|
62
59
|
|
63
|
-
|
64
|
-
`bundle exec` all the time, try the [Rubygems Bundler](https://github.com/mpapis/rubygems-bundler).
|
65
|
-
|
66
|
-
If you are on Mac OS X and have problems with either Guard not reacting to file changes or Pry behaving strange, then
|
67
|
-
you should [add proper Readline support to Ruby on Mac OS X](https://github.com/guard/guard/wiki/Add-proper-Readline-support-to-Ruby-on-Mac-OS-X).
|
68
|
-
|
69
|
-
## Efficient Filesystem Handling
|
70
|
-
|
71
|
-
Various operating systems are willing to notify you of changes to files, but the API to register/receive updates varies
|
72
|
-
(see [rb-fsevent](https://github.com/thibaudgg/rb-fsevent) for OS X, [rb-inotify](https://github.com/nex3/rb-inotify)
|
73
|
-
for Linux, and [rb-fchange](https://github.com/stereobooster/rb-fchange) for Windows). If you do not supply one of the
|
74
|
-
supported gems for these methods, Guard will fall back to polling, and give you a warning about it doing so.
|
75
|
-
|
76
|
-
A challenge arises when trying to make these dependencies work with [Bundler](http://gembundler.com/). If you simply put
|
77
|
-
one of these dependencies into you `Gemfile`, even if it is conditional on a platform match, the platform-specific gem
|
78
|
-
will end up in the `Gemfile.lock`, and developers will thrash the file back and forth.
|
79
|
-
|
80
|
-
There is a good solution. All three gems will successfully, quietly install on all three operating systems, and
|
81
|
-
`guard/listen` will only pull in the one you need. This is a more proper `Gemfile`:
|
82
|
-
|
83
|
-
```Ruby
|
84
|
-
group :development do
|
85
|
-
gem 'rb-inotify', :require => false
|
86
|
-
gem 'rb-fsevent', :require => false
|
87
|
-
gem 'rb-fchange', :require => false
|
88
|
-
end
|
89
|
-
```
|
90
|
-
|
91
|
-
If you're using Windows and at least Ruby 1.9.2, then [Windows Directory Monitor](https://github.com/Maher4Ever/wdm) is
|
92
|
-
more efficient than using `rb-fchange`.
|
93
|
-
|
94
|
-
```Ruby
|
95
|
-
group :development do
|
96
|
-
gem 'wdm', :platforms => [:mswin, :mingw], :require => false
|
97
|
-
end
|
98
|
-
```
|
99
|
-
|
100
|
-
## Windows Colors
|
101
|
-
|
102
|
-
If you want colors in your terminal, you'll have to add the [win32console](https://rubygems.org/gems/win32console) gem
|
103
|
-
to your `Gemfile` and install it with Bundler:
|
104
|
-
|
105
|
-
```ruby
|
106
|
-
group :development do
|
107
|
-
gem 'win32console'
|
108
|
-
end
|
109
|
-
```
|
110
|
-
|
111
|
-
## Interrupt handling
|
112
|
-
|
113
|
-
If the Pry interactor is used, then `Ctrl-C` is delegated to Pry to exit continuation and `Ctrl-D` to exit Guard.
|
114
|
-
Without interactor, `Ctrl-C` exits Guard and `Ctrl-D` is ignored.
|
115
|
-
|
116
|
-
## System notifications
|
117
|
-
|
118
|
-
You can configure Guard to make use of the following system notification libraries:
|
119
|
-
|
120
|
-
#### Ruby GNTP
|
121
|
-
|
122
|
-
* Runs on Mac OS X, Linux and Windows
|
123
|
-
* Supports [Growl](http://growl.info/) version >= 1.3, [Growl for Linux](http://mattn.github.com/growl-for-linux/),
|
124
|
-
[Growl for Windows](http://www.growlforwindows.com/gfw/default.aspx) and
|
125
|
-
[Snarl](https://sites.google.com/site/snarlapp/home)
|
126
|
-
|
127
|
-
The [ruby_gntp](https://rubygems.org/gems/ruby_gntp) gem sends system notifications over the network with the
|
128
|
-
[Growl Notification Transport Protocol](http://www.growlforwindows.com/gfw/help/gntp.aspx) and supports local and
|
129
|
-
remote notifications. To have the images be displayed, you have to use `127.0.0.1` instead of `localhost` in your GTNP
|
130
|
-
configuration.
|
131
|
-
|
132
|
-
Guard supports multiple notification channels for customizing each notification type. For Growl on Mac OS X you need
|
133
|
-
to have at least version 1.3 installed.
|
134
|
-
|
135
|
-
To use `ruby_gntp` you have to add it to your `Gemfile` and run bundler:
|
136
|
-
|
137
|
-
```ruby
|
138
|
-
group :development do
|
139
|
-
gem 'ruby_gntp'
|
140
|
-
end
|
141
|
-
```
|
142
|
-
|
143
|
-
#### Growl
|
144
|
-
|
145
|
-
* Runs on Mac OS X
|
146
|
-
* Supports all [Growl](http://growl.info/) versions
|
147
|
-
|
148
|
-
The [growl](https://rubygems.org/gems/growl) gem is compatible with all versions of Growl and uses a command line tool
|
149
|
-
[growlnotify](http://growl.info/extras.php#growlnotify) that must be separately downloaded and installed. The version of
|
150
|
-
the command line tool must match your Growl version. The `growl` gem does **not** support multiple notification
|
151
|
-
channels.
|
152
|
-
|
153
|
-
You have to download the installer for `growlnotify` from the [Growl download section](http://growl.info/downloads).
|
154
|
-
|
155
|
-
To use `growl` you have to add it to your `Gemfile` and run bundler:
|
156
|
-
|
157
|
-
```ruby
|
158
|
-
group :development do
|
159
|
-
gem 'growl'
|
160
|
-
end
|
161
|
-
```
|
162
|
-
|
163
|
-
#### Libnotify
|
164
|
-
|
165
|
-
* Runs on Linux, FreeBSD, OpenBSD and Solaris
|
166
|
-
* Supports [Libnotify](http://developer.gnome.org/libnotify/)
|
167
|
-
|
168
|
-
The [libnotify](https://rubygems.org/gems/libnotify) gem supports the Gnome libnotify notification daemon, but it can be
|
169
|
-
used on other window managers as well. You have to install the `libnotify-bin` package with your favorite package
|
170
|
-
manager.
|
171
|
-
|
172
|
-
To use `libnotify` you have to add it to your `Gemfile` and run bundler:
|
173
|
-
|
174
|
-
```ruby
|
175
|
-
group :development do
|
176
|
-
gem 'libnotify'
|
177
|
-
end
|
178
|
-
```
|
179
|
-
|
180
|
-
If you are unable to build the `libnotify` gem on your system, Guard
|
181
|
-
also has a built in notifier - `notifysend` - that shells out to the
|
182
|
-
`notify-send` utility that comes with `libnotify-bin`.
|
183
|
-
|
184
|
-
#### Notifu
|
185
|
-
|
186
|
-
* Runs on Windows
|
187
|
-
* Supports [Notifu](http://www.paralint.com/projects/notifu/)
|
188
|
-
|
189
|
-
The [rb-notifu](https://rubygems.org/gems/rb-notifu) gem supports Windows system tray notifications.
|
190
|
-
|
191
|
-
To use `rb-notifu` you have to add it to your `Gemfile` and run bundler:
|
192
|
-
|
193
|
-
```ruby
|
194
|
-
group :development do
|
195
|
-
gem 'rb-notifu'
|
196
|
-
end
|
197
|
-
```
|
198
|
-
|
199
|
-
#### GrowlNotify
|
200
|
-
|
201
|
-
* Runs on Mac OS X
|
202
|
-
* Supports [Growl](http://growl.info/) version >= 1.3
|
203
|
-
* Doesn't support JRuby and MacRuby.
|
204
|
-
* Doesn't work when forking, e.g. with [Spork](https://github.com/sporkrb/spork).
|
205
|
-
|
206
|
-
The [growl_notify](https://rubygems.org/gems/growl_notify) gem uses AppleScript to send Growl notifications.
|
207
|
-
The gem needs a native C extension to make use of AppleScript and does not run on JRuby and MacRuby.
|
208
|
-
|
209
|
-
Guard supports multiple notification channels for customizing each notification type and you need to have at least
|
210
|
-
Growl version 1.3 installed.
|
60
|
+
Run Guard through Bundler with:
|
211
61
|
|
212
|
-
|
213
|
-
|
214
|
-
```ruby
|
215
|
-
group :development do
|
216
|
-
gem 'growl_notify'
|
217
|
-
end
|
218
|
-
```
|
219
|
-
|
220
|
-
#### Terminal Notifier
|
221
|
-
|
222
|
-
* Runs on Mac OS X 10.8 only
|
223
|
-
|
224
|
-
The [terminal-notifier-guard](https://github.com/Springest/terminal-notifier-guard) sends notifications to the OS X
|
225
|
-
Notification Center.
|
226
|
-
|
227
|
-
To use `terminal-notifier-guard` you have to add it to your `Gemfile` and run bundler:
|
228
|
-
|
229
|
-
```ruby
|
230
|
-
group :development do
|
231
|
-
gem 'terminal-notifier-guard'
|
232
|
-
end
|
233
|
-
```
|
234
|
-
|
235
|
-
#### Terminal Title
|
236
|
-
|
237
|
-
* Runs in every terminal supporting XTerm escape sequences to set the window title.
|
238
|
-
|
239
|
-
#### Emacs
|
240
|
-
|
241
|
-
* Runs on any platform with Emacs + emacsclient (http://www.emacswiki.org/emacs/EmacsClient)
|
242
|
-
|
243
|
-
#### TMux
|
244
|
-
|
245
|
-
* To use TMux notifications, you have to start Guard within a [TMux](http://tmux.sourceforge.net/) session.
|
246
|
-
|
247
|
-
The TMux notifier will color the background of the left part of the
|
248
|
-
status bar indicating the status of the notifications. Optionally you
|
249
|
-
can set `:display_message => true` to display the Guard notification as
|
250
|
-
'display-message' notification.
|
251
|
-
|
252
|
-
The way these messages are formatted is configurable.
|
253
|
-
|
254
|
-
```ruby
|
255
|
-
# Guardfile
|
256
|
-
notification :tmux,
|
257
|
-
:display_message => true,
|
258
|
-
:timeout => 5, # in seconds
|
259
|
-
:default_message_format => '%s >> %s',
|
260
|
-
# the first %s will show the title, the second the message
|
261
|
-
# Alternately you can also configure *success_message_format*,
|
262
|
-
# *pending_message_format*, *failed_message_format*
|
263
|
-
:line_separator => ' > ', # since we are single line we need a separator
|
264
|
-
:color_location => 'status-left-bg' # to customize which tmux element will change color
|
265
|
-
```
|
266
|
-
|
267
|
-
The result will be for RSpec using example above
|
268
|
-
|
269
|
-
RSpec >> 15 test, 0 failures > in 0.002 sec
|
270
|
-
|
271
|
-
You can use nice powerline chars here if you have that configured.
|
272
|
-
|
273
|
-
You can get the message history by using `Ctrl+b ~` (where `Ctrl+b` is your key to activate TMux).
|
274
|
-
|
275
|
-
#### File
|
276
|
-
|
277
|
-
* You can also have Guard write notifications to a file. Each notification will
|
278
|
-
overwrite the file. This allows other commands to be run based on the status
|
279
|
-
of other guard commands.
|
280
|
-
|
281
|
-
Example:
|
282
|
-
|
283
|
-
```ruby
|
284
|
-
# Guardfile
|
285
|
-
notification :file, path: '.guard_result'
|
286
|
-
|
287
|
-
guard :shell do
|
288
|
-
watch '.guard_result' do
|
289
|
-
if File.read('.guard_result').lines.first.strip == 'failed'
|
290
|
-
# ...
|
291
|
-
end
|
292
|
-
end
|
293
|
-
end
|
62
|
+
```bash
|
63
|
+
$ bundle exec guard
|
294
64
|
```
|
295
65
|
|
296
|
-
|
66
|
+
**It's important that you always run Guard through Bundler to avoid errors.** If you're getting sick of typing
|
67
|
+
`bundle exec` all the time, try the [Rubygems Bundler](https://github.com/mpapis/rubygems-bundler).
|
297
68
|
|
298
|
-
|
299
|
-
|
300
|
-
notification :file,
|
301
|
-
:path => '.guard_result', # Required, no default
|
302
|
-
:format => "result: %s\ntitle: %s\nmessage: %s\n" # Default: "%s\n%s\n%s\n"
|
303
|
-
```
|
69
|
+
If you are on Mac OS X and have problems with either Guard not reacting to file changes or Pry behaving strange, then
|
70
|
+
you should [add proper Readline support to Ruby on Mac OS X](https://github.com/guard/guard/wiki/Add-Readline-support-to-Ruby-on-Mac-OS-X).
|
304
71
|
|
305
|
-
Add Guard plugins
|
306
|
-
-----------------
|
72
|
+
#### Add Guard plugins
|
307
73
|
|
308
74
|
Guard is now ready to use and you should add some Guard plugins for your specific use. Start exploring the many Guard
|
309
75
|
plugins available by browsing the [Guard organization](https://github.com/guard) on GitHub or by searching for `guard-`
|
@@ -591,6 +357,9 @@ and extend Guard for your own needs and distribute as a gem. Please have a look
|
|
591
357
|
|
592
358
|
You can also interact with Guard by sending POSIX signals to the Guard process (all but Windows and JRuby).
|
593
359
|
|
360
|
+
If the Pry interactor is used, then `Ctrl-C` is delegated to Pry to exit continuation and `Ctrl-D` to exit Guard.
|
361
|
+
Without interactor, `Ctrl-C` exits Guard and `Ctrl-D` is ignored.
|
362
|
+
|
594
363
|
#### Pause watching
|
595
364
|
|
596
365
|
```bash
|
@@ -739,7 +508,7 @@ plural and the singular option, the plural has precedence.
|
|
739
508
|
### notification
|
740
509
|
|
741
510
|
If you don't specify any notification configuration in your `Guardfile`, Guard goes through the list of available
|
742
|
-
notifiers and
|
511
|
+
notifiers and enables all that are available. If you specify your preferred library, auto detection will not take
|
743
512
|
place:
|
744
513
|
|
745
514
|
```ruby
|
@@ -845,7 +614,7 @@ filter /\.txt$/, /.*\.zip/
|
|
845
614
|
To _replace_ any existing filter, use the `filter!` method:
|
846
615
|
|
847
616
|
```ruby
|
848
|
-
filter /\.js$/
|
617
|
+
filter! /\.js$/
|
849
618
|
```
|
850
619
|
|
851
620
|
### logger
|
@@ -877,59 +646,12 @@ the Guard plugin name that sends the log message. They cannot be specified at th
|
|
877
646
|
By default the logger uses `$stderr` as device, but you can override this by supplying the `:device` option and set
|
878
647
|
either an IO stream or a filename.
|
879
648
|
|
880
|
-
|
881
|
-
|
882
|
-
```ruby
|
883
|
-
ignore %r{^ignored/path/}, /public/
|
884
|
-
filter /\.txt$/, /.*\.zip/
|
885
|
-
|
886
|
-
notification :growl_notify
|
887
|
-
notification :gntp, :host => '192.168.1.5'
|
888
|
-
|
889
|
-
group :backend do
|
890
|
-
guard :bundler do
|
891
|
-
watch('Gemfile')
|
892
|
-
end
|
893
|
-
|
894
|
-
guard :rspec, :cli => '--color --format doc' do
|
895
|
-
watch(%r{^spec/.+_spec\.rb$})
|
896
|
-
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
897
|
-
watch(%r{^spec/models/.+\.rb$}) { ["spec/models", "spec/acceptance"] }
|
898
|
-
watch(%r{^spec/.+\.rb$}) { `say hello` }
|
899
|
-
watch('spec/spec_helper.rb') { "spec" }
|
900
|
-
end
|
901
|
-
end
|
902
|
-
|
903
|
-
group :frontend do
|
904
|
-
guard :coffeescript, :output => 'public/javascripts/compiled' do
|
905
|
-
watch(%r{^app/coffeescripts/.+\.coffee$})
|
906
|
-
end
|
907
|
-
|
908
|
-
guard :livereload do
|
909
|
-
watch(%r{^app/.+\.(erb|haml)$})
|
910
|
-
end
|
911
|
-
end
|
912
|
-
```
|
649
|
+
Issues
|
650
|
+
------
|
913
651
|
|
914
|
-
|
915
|
-
---------------------
|
652
|
+
Please check guard's [GitHub issue tracker](https://github.com/guard/guard/issues) for known issues. Additionally you should check [listen's issue tracker](https://github.com/guard/listen/issues) for issues which affect guard's behaviour; for example, there is currently a nasty [bug preventing listen from watching files inside symlinked directories](https://github.com/guard/listen/issues/25).
|
916
653
|
|
917
|
-
|
918
|
-
you have no `Guardfile` in your current directory.
|
919
|
-
|
920
|
-
If a `.guard.rb` is found in your home directory, it will be appended to the `Guardfile` in your current directory.
|
921
|
-
This can be used for tasks you want guard to handle but other users probably don't.
|
922
|
-
|
923
|
-
For example, indexing your source tree with [Ctags](http://ctags.sourceforge.net):
|
924
|
-
|
925
|
-
```ruby
|
926
|
-
guard :shell do
|
927
|
-
watch(%r{^(?:app|lib)/.+\.rb$}) { `ctags -R` }
|
928
|
-
end
|
929
|
-
```
|
930
|
-
|
931
|
-
File an issue
|
932
|
-
-------------
|
654
|
+
#### File an issue
|
933
655
|
|
934
656
|
You can report bugs and feature requests to [GitHub Issues](https://github.com/guard/guard/issues).
|
935
657
|
|
@@ -974,7 +696,7 @@ Pull requests are very welcome! Please try to follow these simple rules if appli
|
|
974
696
|
For questions please join us in our [Google group](http://groups.google.com/group/guard-dev) or on
|
975
697
|
`#guard` (irc.freenode.net).
|
976
698
|
|
977
|
-
|
699
|
+
#### Open Commit Bit
|
978
700
|
|
979
701
|
Guard has an open commit bit policy: Anyone with an accepted pull request gets added as a repository collaborator.
|
980
702
|
Please try to follow these simple rules:
|
@@ -984,17 +706,17 @@ Please try to follow these simple rules:
|
|
984
706
|
* Create a feature branch and open a pull-request early for any new features to get feedback.
|
985
707
|
* Make sure you adhere to the general pull request rules above.
|
986
708
|
|
987
|
-
|
709
|
+
#### Author
|
988
710
|
|
989
711
|
[Thibaud Guillaume-Gentil](https://github.com/thibaudgg) ([@thibaudgg](http://twitter.com/thibaudgg))
|
990
712
|
|
991
|
-
|
713
|
+
#### Core Team
|
992
714
|
|
993
715
|
* [Maher Sallam](https://github.com/Maher4Ever) ([@mahersalam](http://twitter.com/mahersalam))
|
994
716
|
* [Michael Kessler](https://github.com/netzpirat) ([@netzpirat](http://twitter.com/netzpirat), [mksoft.ch](https://mksoft.ch))
|
995
717
|
* [Rémy Coutable](https://github.com/rymai) ([@rymai](http://twitter.com/rymai), [rymai.me](http://rymai.me))
|
996
718
|
* [Thibaud Guillaume-Gentil](https://github.com/thibaudgg) ([@thibaudgg](http://twitter.com/thibaudgg), [thibaud.me](http://thibaud.me/))
|
997
719
|
|
998
|
-
|
720
|
+
#### Contributors
|
999
721
|
|
1000
722
|
[https://github.com/guard/guard/contributors](https://github.com/guard/guard/contributors)
|
data/lib/guard/dsl.rb
CHANGED
@@ -409,7 +409,7 @@ module Guard
|
|
409
409
|
# @param [Regexp] regexps a pattern for ignoring paths
|
410
410
|
#
|
411
411
|
def ignore(*regexps)
|
412
|
-
::Guard.listener = ::Guard.listener.ignore(*regexps)
|
412
|
+
::Guard.listener = ::Guard.listener.ignore(*regexps) if ::Guard.listener
|
413
413
|
end
|
414
414
|
|
415
415
|
# Replace ignored paths globally
|
@@ -420,7 +420,7 @@ module Guard
|
|
420
420
|
# @param [Regexp] regexps a pattern for ignoring paths
|
421
421
|
#
|
422
422
|
def ignore!(*regexps)
|
423
|
-
::Guard.listener = ::Guard.listener.ignore!(*regexps)
|
423
|
+
::Guard.listener = ::Guard.listener.ignore!(*regexps) if ::Guard.listener
|
424
424
|
end
|
425
425
|
|
426
426
|
# Filter certain paths globally.
|
@@ -431,7 +431,7 @@ module Guard
|
|
431
431
|
# @param [Regexp] regexps a pattern for filtering paths
|
432
432
|
#
|
433
433
|
def filter(*regexps)
|
434
|
-
::Guard.listener = ::Guard.listener.filter(*regexps)
|
434
|
+
::Guard.listener = ::Guard.listener.filter(*regexps) if ::Guard.listener
|
435
435
|
end
|
436
436
|
|
437
437
|
# Replace filtered paths globally.
|
@@ -442,7 +442,7 @@ module Guard
|
|
442
442
|
# @param [Regexp] regexps a pattern for filtering paths
|
443
443
|
#
|
444
444
|
def filter!(*regexps)
|
445
|
-
::Guard.listener = ::Guard.listener.filter!(*regexps)
|
445
|
+
::Guard.listener = ::Guard.listener.filter!(*regexps) if ::Guard.listener
|
446
446
|
end
|
447
447
|
|
448
448
|
# Configure the Guard logger.
|
@@ -48,12 +48,12 @@ module Guard
|
|
48
48
|
# @option options [Number] t the number of milliseconds to display (1000, 3000)
|
49
49
|
#
|
50
50
|
def notify(type, title, message, image, options = { })
|
51
|
-
command =
|
51
|
+
command = [title, message]
|
52
52
|
options = DEFAULTS.merge(options).merge({
|
53
53
|
:i => image
|
54
54
|
})
|
55
55
|
options[:u] ||= notifysend_urgency(type)
|
56
|
-
system(
|
56
|
+
system('notify-send', *to_arguments(command, SUPPORTED, options))
|
57
57
|
end
|
58
58
|
|
59
59
|
private
|
@@ -73,11 +73,11 @@ module Guard
|
|
73
73
|
# @param [String] command the command execute
|
74
74
|
# @param [Array] supported list of supported option flags
|
75
75
|
# @param [Hash] options additional command options
|
76
|
-
# @return [String] the command and its options converted to a shell command.
|
76
|
+
# @return [Array<String>] the command and its options converted to a shell command.
|
77
77
|
#
|
78
|
-
def
|
78
|
+
def to_arguments(command, supported, options = {})
|
79
79
|
options.reduce(command) do |cmd, (flag, value)|
|
80
|
-
supported.include?(flag) ? cmd
|
80
|
+
supported.include?(flag) ? (cmd << "-#{ flag }" << value.to_s) : cmd
|
81
81
|
end
|
82
82
|
end
|
83
83
|
end
|
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.1
|
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-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -160,7 +160,7 @@ files:
|
|
160
160
|
- man/guard.1
|
161
161
|
- man/guard.1.html
|
162
162
|
- README.md
|
163
|
-
homepage:
|
163
|
+
homepage: http://guardgem.org
|
164
164
|
licenses: []
|
165
165
|
metadata: {}
|
166
166
|
post_install_message:
|
@@ -184,3 +184,4 @@ signing_key:
|
|
184
184
|
specification_version: 4
|
185
185
|
summary: Guard keeps an eye on your file modifications
|
186
186
|
test_files: []
|
187
|
+
has_rdoc:
|