guard 2.2.5 → 2.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b5c095e15ffd825f5b44a76fccc7876c3720c17
4
- data.tar.gz: 17adc2900e6ba19bd56b266c45d8ab36a11ef9c1
3
+ metadata.gz: 9a9c7c3c069655878f11c259de0b8f30c0e97914
4
+ data.tar.gz: df85000a6061c14ba2df3231d5ce2297a39c61b5
5
5
  SHA512:
6
- metadata.gz: 3ebe13bbb141439cec3005cca533ab37c6b4d8352ea680cc432ecc32808796f057039870c7cba7848a2bcbdc8f87713a230cf11f9b91614eaee7ebe92e6a2c89
7
- data.tar.gz: fb246be778aadad200aa3ca328c35c542aef5c639cd249a58eef920bd50c0358645c5ff30b97aa64a8cfd7de4ac5b0ec52b39a3f544a246c6c3beed22a7e3341
6
+ metadata.gz: 3a16582451f68776b47e8d71740858f2d5135ae33e5d3e507204719a86a668f97c0488ba7b7bccd4de555070e7020ca52ca3eaa45f589003a05f4a036b74c97a
7
+ data.tar.gz: 2abaeda0d2a2387ce3da9ea64f1080c32226f59a3d82bb10f7c4990a67a9f1f375e1efaed76b19d9e9b29933e9c1910704549cf2df7cc2ea3f7afb850c7abb7c
data/README.md CHANGED
@@ -197,12 +197,12 @@ $ bundle exec guard -g group_name another_group_name # shortcut
197
197
 
198
198
  See the Guardfile DSL below for creating groups.
199
199
 
200
- #### `-P`/`--plugins` option
200
+ #### `-P`/`--plugin` option
201
201
 
202
202
  Scope Guard to certain plugins on start:
203
203
 
204
204
  ```bash
205
- $ bundle exec guard --plugins plugin_name another_plugin_name
205
+ $ bundle exec guard --plugin plugin_name another_plugin_name
206
206
  $ bundle exec guard -P plugin_name another_plugin_name # shortcut
207
207
  ```
208
208
 
@@ -253,6 +253,10 @@ $ bundle exec guard start -B
253
253
  $ bundle exec guard start --no-bundler-warning
254
254
  ```
255
255
 
256
+ #### `--show-deprecations`
257
+
258
+ Turn on deprecation warnings.
259
+
256
260
  #### `-l`/`--latency` option
257
261
 
258
262
  Overwrite Listen's default latency, useful when your hard-drive / system is slow.
@@ -271,6 +275,15 @@ $ bundle exec guard start -p
271
275
  $ bundle exec guard start --force-polling
272
276
  ```
273
277
 
278
+ #### `-y`/`--wait-for-delay` option
279
+
280
+ Overwrite Listen's default wait_for_delay, useful for kate-like editors through ssh access.
281
+
282
+ ```bash
283
+ $ bundle exec guard start -y 1
284
+ $ bundle exec guard start --wait-for-delay 1
285
+ ```
286
+
274
287
  ### List
275
288
 
276
289
  You can list the available plugins with the `list` task:
data/lib/guard/cli.rb CHANGED
@@ -86,6 +86,11 @@ module Guard
86
86
  aliases: '-p',
87
87
  banner: 'Force usage of the Listen polling listener'
88
88
 
89
+ method_option :wait_for_delay,
90
+ type: :numeric,
91
+ aliases: '-y',
92
+ banner: 'Overwrite Listen\'s default wait_for_delay'
93
+
89
94
  # Start Guard by initializing the defined Guard plugins and watch the file system.
90
95
  # This is the default task, so calling `guard` is the same as calling `guard start`.
91
96
  #
@@ -17,7 +17,12 @@ module Guard
17
17
  GUARDFILE_TEMPLATE = File.expand_path('../../../guard/templates/Guardfile', __FILE__)
18
18
 
19
19
  # The location of user defined templates
20
- HOME_TEMPLATES = File.expand_path('~/.guard/templates')
20
+ begin
21
+ HOME_TEMPLATES = File.expand_path('~/.guard/templates')
22
+ rescue ArgumentError => e
23
+ # home isn't defined. Set to the root of the drive. Trust that there won't be user defined templates there
24
+ HOME_TEMPLATES = File.expand_path('/')
25
+ end
21
26
 
22
27
  # Initialize a new `Guard::Guardfile::Generator` object.
23
28
  #
@@ -18,8 +18,11 @@ module Guard
18
18
  # @example Add the `:terminal_notifier` notifier to your `Guardfile`
19
19
  # notification :terminal_notifier
20
20
  #
21
- # @example Add the `:terminal_notifier` notifier with configuration options to your `Guardfile`
22
- # notification :terminal_notifier, app_name: "MyApp"
21
+ # @example Display application name as subtitle
22
+ # notification :terminal_notifier, subtitle: MyApp"
23
+ #
24
+ # @example Use iTerm2 for notifications
25
+ # notification :terminal_notifier, activate: "com.googlecode.iterm2"
23
26
  #
24
27
  class TerminalNotifier < Base
25
28
 
@@ -29,6 +29,7 @@ module Guard
29
29
  display_message: false,
30
30
  default_message_format: '%s - %s',
31
31
  default_message_color: 'white',
32
+ display_on_all_clients: false,
32
33
  display_title: false,
33
34
  default_title_format: '%s - %s',
34
35
  line_separator: ' - ',
@@ -89,6 +90,8 @@ module Guard
89
90
  # color notification
90
91
  # @option opts [Boolean] display_message whether to display a message
91
92
  # or not
93
+ # @option opts [Boolean] display_on_all_clients whether to display a
94
+ # message on all tmux clients or not
92
95
  #
93
96
  def notify(message, opts = {})
94
97
  super
@@ -99,7 +102,7 @@ module Guard
99
102
  color = tmux_color(opts[:type], opts)
100
103
 
101
104
  color_locations.each do |color_location|
102
- _run_client "set -q #{ color_location } #{ color }"
105
+ _run_client "set","-q #{ color_location } #{ color }"
103
106
  end
104
107
  end
105
108
 
@@ -135,9 +138,9 @@ module Guard
135
138
  display_title = title_format % [title, teaser_message]
136
139
 
137
140
  if _tmux_version >= 1.7
138
- _run_client "set-option -q set-titles-string '#{ display_title }'"
141
+ _run_client "set-option", "-q set-titles-string '#{ display_title }'"
139
142
  else
140
- _run_client "set-option set-titles-string '#{ display_title }'"
143
+ _run_client "set-option", "set-titles-string '#{ display_title }'"
141
144
  end
142
145
  end
143
146
 
@@ -179,11 +182,11 @@ module Guard
179
182
  formatted_message = message.split("\n").join(separator)
180
183
  display_message = message_format % [title, formatted_message]
181
184
 
182
- _run_client "set -q display-time #{ display_time * 1000 }"
183
- _run_client "set -q message-fg #{ message_color }"
184
- _run_client "set -q message-bg #{ color }"
185
- _run_client "display-message '#{ display_message }'"
186
- end
185
+ _run_client "set", "-q display-time #{ display_time * 1000 }"
186
+ _run_client "set", "-q message-fg #{ message_color }"
187
+ _run_client "set", "-q message-bg #{ color }"
188
+ _run_client "display-message", "'#{ display_message }'"
189
+ end
187
190
 
188
191
  # Get the Tmux color for the notification type.
189
192
  # You can configure your own color by overwriting the defaults.
@@ -204,11 +207,13 @@ module Guard
204
207
  def turn_on
205
208
  unless @options_stored
206
209
  _reset_options_store
207
- `#{ DEFAULTS[:client] } show`.each_line do |line|
208
- option, _, setting = line.chomp.partition(' ')
209
- options_store[option] = setting
210
+ _clients.each do |client|
211
+ options_store[client] ||= {}
212
+ `#{ DEFAULTS[:client] } show -t #{ client }`.each_line do |line|
213
+ option, _, setting = line.chomp.partition(' ')
214
+ @options_store[client][option] = setting
215
+ end
210
216
  end
211
-
212
217
  @options_stored = true
213
218
  end
214
219
  end
@@ -219,11 +224,13 @@ module Guard
219
224
  #
220
225
  def turn_off
221
226
  if @options_stored
222
- @options_store.each do |key, value|
223
- if value
224
- _run_client "set -q #{ key } #{ value }"
225
- else
226
- _run_client "set -q -u #{ key }"
227
+ @options_store.each do |client, options|
228
+ options.each do |key, value|
229
+ if value
230
+ `#{ DEFAULTS[:client] } set -t #{ client } -q #{ key } #{ value }`
231
+ else
232
+ `#{ DEFAULTS[:client] } set -t #{ client } -q -u #{ key }`
233
+ end
227
234
  end
228
235
  end
229
236
  _reset_options_store
@@ -241,23 +248,51 @@ module Guard
241
248
  super
242
249
  end
243
250
 
244
- def _run_client(args)
245
- system("#{ DEFAULTS[:client] } #{args}")
251
+ def _clients
252
+ %x( #{DEFAULTS[:client]} list-clients -F '\#{client_tty}').split(/\n/);
253
+ end
254
+
255
+ def _run_client(cmd, args)
256
+ if @options.fetch(:display_on_all_clients, DEFAULTS[:display_on_all_clients])
257
+ _clients.each do |client|
258
+ system("#{ DEFAULTS[:client] } #{ cmd } #{ _client_cmd_flag(cmd) } #{ client.strip } #{ args }")
259
+ end
260
+ else
261
+ system("#{ DEFAULTS[:client] } #{ cmd } #{ args }")
262
+ end
263
+ end
264
+
265
+ def _client_cmd_flag(cmd)
266
+ case cmd
267
+ when 'set', 'set-option' then '-t'
268
+ when 'display-message' then '-c'
269
+ end
246
270
  end
247
271
 
248
272
  # Reset the internal Tmux options store defaults.
249
273
  #
250
274
  def _reset_options_store
251
275
  @options_stored = false
252
- @options_store = {
253
- 'status-left-bg' => nil,
254
- 'status-right-bg' => nil,
255
- 'status-left-fg' => nil,
256
- 'status-right-fg' => nil,
257
- 'message-bg' => nil,
258
- 'message-fg' => nil,
259
- 'display-time' => nil
260
- }
276
+ @options_store = {}
277
+ _clients.each do | client |
278
+ @options_store[client] = {
279
+ 'status-left-bg' => nil,
280
+ 'status-right-bg' => nil,
281
+ 'status-left-fg' => nil,
282
+ 'status-right-fg' => nil,
283
+ 'message-bg' => nil,
284
+ 'message-fg' => nil,
285
+ 'display-time' => nil
286
+ }
287
+ end
288
+ end
289
+
290
+ # Remove clients which no longer exist from options store
291
+ #
292
+ def _remove_old_clients
293
+ (options_store.keys - _clients).each do | old_client |
294
+ options_store.delete old_client
295
+ end
261
296
  end
262
297
 
263
298
  def _tmux_version
data/lib/guard/setuper.rb CHANGED
@@ -18,7 +18,8 @@ module Guard
18
18
  no_bundler_warning: false,
19
19
  show_deprecations: false,
20
20
  latency: nil,
21
- force_polling: false
21
+ force_polling: false,
22
+ wait_for_delay: nil
22
23
  }
23
24
  DEFAULT_GROUPS = [:default]
24
25
 
@@ -191,7 +192,7 @@ module Guard
191
192
  end
192
193
 
193
194
  listener_options = {}
194
- [:latency, :force_polling].each do |option|
195
+ [:latency, :force_polling, :wait_for_delay].each do |option|
195
196
  listener_options[option] = options[option] if options[option]
196
197
  end
197
198
 
data/lib/guard/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Guard
2
- VERSION = '2.2.5'
2
+ VERSION = '2.3.0'
3
3
  end
data/man/guard.1 CHANGED
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "GUARD" "1" "September 2013" "" ""
4
+ .TH "GUARD" "1" "January 2014" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBguard\fR \- Guard keeps an eye on your file modifications\.
@@ -27,15 +27,15 @@ The following options are available:
27
27
  \fB\-n\fR, \fB\-\-notify\fR \fIFLAG\fR Disable notifications (Growl or Libnotify depending on your system)\. Notifications can be disabled globally by setting a GUARD_NOTIFY environment variable to false\. FLAG can be \fBtrue\fR/\fBfalse\fR or \fBt\fR/\fBf\fR\.
28
28
  .
29
29
  .P
30
- \fB\-d\fR, \fB\-\-debug\fR Runs Guard in debug mode\.
31
- .
32
- .P
33
30
  \fB\-g\fR, \fB\-\-group\fR \fIGROUP1\fR \fIGROUP2\fR\.\.\. Scopes the Guard actions to the groups specified by GROUP1, GROUP2, etc\. Group names should be separated by spaces\. Plugins that don\'t belong to a group are considered global and are always run\.
34
31
  .
35
32
  .P
36
33
  \fB\-P\fR, \fB\-\-plugin\fR \fIPLUGIN1\fR \fIPLUGIN2\fR\.\.\. Scopes the Guard actions to the plugins specified by PLUGIN1, PLUGIN2, etc\. Plugin names should be separated by spaces\.
37
34
  .
38
35
  .P
36
+ \fB\-d\fR, \fB\-\-debug\fR Runs Guard in debug mode\.
37
+ .
38
+ .P
39
39
  \fB\-w\fR, \fB\-\-watchdir\fR \fIPATH\fR Tells Guard to watch PATH instead of \fB\./\fR\.
40
40
  .
41
41
  .P
@@ -56,6 +56,9 @@ The following options are available:
56
56
  .P
57
57
  \fB\-p\fR, \fB\-\-force\-polling\fR Force usage of the Listen polling listener\.
58
58
  .
59
+ .P
60
+ \fB\-y\fR, \fB\-\-wait\-for\-delay\fR Overwrite Listen\'s default \fBwait_for_delay\fR, useful for kate\-like editors through ssh access\.
61
+ .
59
62
  .SS "init [GUARDS]"
60
63
  If no Guardfile is present in the current directory, creates an empty Guardfile\.
61
64
  .
data/man/guard.1.html CHANGED
@@ -98,9 +98,6 @@
98
98
  Notifications can be disabled globally by setting a GUARD_NOTIFY environment variable to false.
99
99
  FLAG can be <code>true</code>/<code>false</code> or <code>t</code>/<code>f</code>.</p>
100
100
 
101
- <p><code>-d</code>, <code>--debug</code>
102
- Runs Guard in debug mode.</p>
103
-
104
101
  <p><code>-g</code>, <code>--group</code> <var>GROUP1</var> <var>GROUP2</var>...
105
102
  Scopes the Guard actions to the groups specified by GROUP1, GROUP2, etc.
106
103
  Group names should be separated by spaces.
@@ -110,6 +107,9 @@
110
107
  Scopes the Guard actions to the plugins specified by PLUGIN1, PLUGIN2, etc.
111
108
  Plugin names should be separated by spaces.</p>
112
109
 
110
+ <p><code>-d</code>, <code>--debug</code>
111
+ Runs Guard in debug mode.</p>
112
+
113
113
  <p><code>-w</code>, <code>--watchdir</code> <var>PATH</var>
114
114
  Tells Guard to watch PATH instead of <code>./</code>.</p>
115
115
 
@@ -131,6 +131,9 @@
131
131
  <p><code>-p</code>, <code>--force-polling</code>
132
132
  Force usage of the Listen polling listener.</p>
133
133
 
134
+ <p><code>-y</code>, <code>--wait-for-delay</code>
135
+ Overwrite Listen's default <code>wait_for_delay</code>, useful for kate-like editors through ssh access.</p>
136
+
134
137
  <h3 id="init-GUARDS-">init [GUARDS]</h3>
135
138
 
136
139
  <p>If no Guardfile is present in the current directory, creates an empty Guardfile.</p>
@@ -187,7 +190,7 @@ https://github.com/guard/guard/contributors</p>
187
190
 
188
191
  <ol class='man-decor man-foot man foot'>
189
192
  <li class='tl'></li>
190
- <li class='tc'>September 2013</li>
193
+ <li class='tc'>January 2014</li>
191
194
  <li class='tr'>guard(1)</li>
192
195
  </ol>
193
196
 
metadata CHANGED
@@ -1,113 +1,113 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.5
4
+ version: 2.3.0
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-12-13 00:00:00.000000000 Z
11
+ date: 2014-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.18.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.18.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: listen
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '2.1'
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
40
  version: '2.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: pry
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: 0.9.12
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.9.12
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: lumberjack
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '1.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: formatador
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: 0.2.4
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: 0.2.4
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: bundler
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
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.14'
103
+ version: 3.0.0.beta1
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.14'
110
+ version: 3.0.0.beta1
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
@@ -116,12 +116,16 @@ executables:
116
116
  extensions: []
117
117
  extra_rdoc_files: []
118
118
  files:
119
+ - CHANGELOG.md
120
+ - LICENSE
121
+ - README.md
119
122
  - bin/fsevent_watch_guard
120
123
  - bin/guard
121
124
  - images/failed.png
122
125
  - images/guard.png
123
126
  - images/pending.png
124
127
  - images/success.png
128
+ - lib/guard.rb
125
129
  - lib/guard/cli.rb
126
130
  - lib/guard/commander.rb
127
131
  - lib/guard/commands/all.rb
@@ -137,9 +141,9 @@ files:
137
141
  - lib/guard/dsl_describer.rb
138
142
  - lib/guard/group.rb
139
143
  - lib/guard/guard.rb
144
+ - lib/guard/guardfile.rb
140
145
  - lib/guard/guardfile/evaluator.rb
141
146
  - lib/guard/guardfile/generator.rb
142
- - lib/guard/guardfile.rb
143
147
  - lib/guard/interactor.rb
144
148
  - lib/guard/notifier.rb
145
149
  - lib/guard/notifiers/base.rb
@@ -155,24 +159,20 @@ files:
155
159
  - lib/guard/notifiers/terminal_title.rb
156
160
  - lib/guard/notifiers/tmux.rb
157
161
  - lib/guard/options.rb
162
+ - lib/guard/plugin.rb
158
163
  - lib/guard/plugin/base.rb
159
164
  - lib/guard/plugin/hooker.rb
160
- - lib/guard/plugin.rb
161
165
  - lib/guard/plugin_util.rb
162
166
  - lib/guard/rake_task.rb
163
167
  - lib/guard/runner.rb
164
168
  - lib/guard/setuper.rb
165
169
  - lib/guard/templates/Guardfile
166
- - lib/guard/ui/colors.rb
167
170
  - lib/guard/ui.rb
171
+ - lib/guard/ui/colors.rb
168
172
  - lib/guard/version.rb
169
173
  - lib/guard/watcher.rb
170
- - lib/guard.rb
171
- - CHANGELOG.md
172
- - LICENSE
173
174
  - man/guard.1
174
175
  - man/guard.1.html
175
- - README.md
176
176
  homepage: http://guardgem.org
177
177
  licenses:
178
178
  - MIT
@@ -183,17 +183,17 @@ require_paths:
183
183
  - lib
184
184
  required_ruby_version: !ruby/object:Gem::Requirement
185
185
  requirements:
186
- - - '>='
186
+ - - ">="
187
187
  - !ruby/object:Gem::Version
188
188
  version: 1.9.2
189
189
  required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  requirements:
191
- - - '>='
191
+ - - ">="
192
192
  - !ruby/object:Gem::Version
193
193
  version: '0'
194
194
  requirements: []
195
195
  rubyforge_project:
196
- rubygems_version: 2.0.14
196
+ rubygems_version: 2.2.0
197
197
  signing_key:
198
198
  specification_version: 4
199
199
  summary: Guard keeps an eye on your file modifications