guard 2.4.0 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 92ad4b938632516836b137027518c5ce1b078ede
4
- data.tar.gz: 106f21643bca890f75c08c49a618497577e057b4
3
+ metadata.gz: 98a3fc471df7b3e194904fe3683b10761d31ea2e
4
+ data.tar.gz: ec5da505e7e94fde3dbb30acd55323f36e0ffd05
5
5
  SHA512:
6
- metadata.gz: cfa0c07f4c42e02df37ba8efca2cc0d4b28b67c83d827c601d7066840d994bb166fa66eeb41a840132e6bf193a94eb14672b124c834d7676c7d8c55265a943c5
7
- data.tar.gz: fcc4854eeefb682c40ad6c11081c5214217ed7eaa13c30123b5d02befd96926fb30a15df110e0f41eef0dd405d8b89d3bbd3faf925da547413b97867b168fe1c
6
+ metadata.gz: 3ba515d04987c1a6e03750779adce1a75b49cd6a71482a38792c761eb31f2be61a3c6cb49172aa23241f7a0f3901ac43a23c5408d5958a84a6a36262b309b0e1
7
+ data.tar.gz: 0de9ec279063925cb7648dd7016da8c658676936f67eb24209b824bb45126dccb4e6bb8acea17bca2ddf126af01bc47aec3c0aaa3548969e2fd36799fb9b1e78
data/README.md CHANGED
@@ -284,6 +284,30 @@ $ bundle exec guard start -y 1
284
284
  $ bundle exec guard start --wait-for-delay 1
285
285
  ```
286
286
 
287
+ #### `-o`/`--listen-on` option
288
+
289
+ Use Listen's network functionality to receive file change events from the network. This is most useful for virtual machines (e.g. Vagrant) which have problems firing native filesystem events on the guest OS.
290
+
291
+ ##### Suggested use:
292
+
293
+ On the host OS, you need to listen to filesystem events and forward them to your VM using the `listen` script:
294
+
295
+ ```bash
296
+ $ listen -f 127.0.0.1:4000
297
+ ```
298
+
299
+ Remember to configure your VM to forward the appropriate ports, e.g. in Vagrantfile:
300
+
301
+ ```ruby
302
+ config.vm.network :forwarded_port, guest: 4000, host: 4000
303
+ ```
304
+
305
+ Then, on your guest OS, listen to the network events but ensure you specify the *host* path
306
+
307
+ ```bash
308
+ $ bundle exec guard -o '10.0.2.2:4000' -w '/projects/myproject'
309
+ ```
310
+
287
311
  ### List
288
312
 
289
313
  You can list the available plugins with the `list` task:
@@ -91,6 +91,12 @@ module Guard
91
91
  aliases: '-y',
92
92
  banner: 'Overwrite Listen\'s default wait_for_delay'
93
93
 
94
+ method_option :listen_on,
95
+ type: :string,
96
+ aliases: '-o',
97
+ default: '10.0.2.2:4000',
98
+ banner: 'Specify a network address to Listen on for file change events (e.g. for use in VMs)'
99
+
94
100
  # Start Guard by initializing the defined Guard plugins and watch the file system.
95
101
  # This is the default task, so calling `guard` is the same as calling `guard start`.
96
102
  #
@@ -19,7 +19,8 @@ module Guard
19
19
  show_deprecations: false,
20
20
  latency: nil,
21
21
  force_polling: false,
22
- wait_for_delay: nil
22
+ wait_for_delay: nil,
23
+ listen_on: nil
23
24
  }
24
25
  DEFAULT_GROUPS = [:default]
25
26
 
@@ -191,13 +192,16 @@ module Guard
191
192
  end
192
193
  end
193
194
 
194
- listener_options = {}
195
- [:latency, :force_polling, :wait_for_delay].each do |option|
196
- listener_options[option] = options[option] if options[option]
195
+ if options[:listen_on]
196
+ @listener = Listen.on(options[:listen_on], &listener_callback)
197
+ else
198
+ listener_options = {}
199
+ [:latency, :force_polling, :wait_for_delay].each do |option|
200
+ listener_options[option] = options[option] if options[option]
201
+ end
202
+ listen_args = @watchdirs + [listener_options]
203
+ @listener = Listen.to(*listen_args, &listener_callback)
197
204
  end
198
-
199
- listen_args = @watchdirs + [listener_options]
200
- @listener = Listen.to(*listen_args, &listener_callback)
201
205
  end
202
206
 
203
207
  # Sets up traps to catch signals used to control Guard.
@@ -1,3 +1,3 @@
1
1
  module Guard
2
- VERSION = '2.4.0'
2
+ VERSION = '2.5.0'
3
3
  end
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: 2.4.0
4
+ version: 2.5.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: 2014-02-06 00:00:00.000000000 Z
11
+ date: 2014-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.1'
33
+ version: '2.6'
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
- version: '2.1'
40
+ version: '2.6'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: pry
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -193,9 +193,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
193
193
  version: '0'
194
194
  requirements: []
195
195
  rubyforge_project:
196
- rubygems_version: 2.2.0
196
+ rubygems_version: 2.2.1
197
197
  signing_key:
198
198
  specification_version: 4
199
199
  summary: Guard keeps an eye on your file modifications
200
200
  test_files: []
201
- has_rdoc: