vagrant-fsevents 0.4.2 → 0.4.3

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
  SHA256:
3
- metadata.gz: 326d3106379550de3aad5696044679b3aa094be9337fe3713d658e07841e29a1
4
- data.tar.gz: 938f686595537e4a509b975a31565e5d7fced7756c51922de81da81c0a610d1b
3
+ metadata.gz: ff3c027295a82cc4458e19498c34f67405a6d7b499b9d92ce5f1734c03180fc2
4
+ data.tar.gz: 94e3895892dfe5720a339870e9b8cb51fd9400cad118b629be231156c66601cb
5
5
  SHA512:
6
- metadata.gz: 819e89512001aa1e1eb25fda02a774f11cf7db330e56929a02ba8d05b77afca734c36139b3333c0c0b76b46899e4a03775dabe18493c7816cbff996b4cc81d99
7
- data.tar.gz: d632017ea90c30f4aab7cabeefcb2895ea4ce1248d9a68a652c52c3ea3c56aa85d495fb74527d2273277096419dfa413195e448b4c7992b52d3f84669a9681b4
6
+ metadata.gz: 1d6eb87e0ca897174facbd5bbea0a2f117b6e4c956408dee6f5fec7c9b2c7fea7e8681e9bd8b6098691380a144957c69204f20bb7c94eb5c23849616781c5686
7
+ data.tar.gz: c7b42f798582d22e07d118b3140860002507afc67fba4542a970e2adacba1c6f40497c96743a131705664dd59a8c8da0fefff6b729e08a6bc74862db62d0edf7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.3 - 2019-03-31
4
+
5
+ - Added new 'include' keyword (complimenting the 'exclude' keyword) to help work around symlink issues with guard/listen
6
+
3
7
  ## 0.4.2 - 2019-03-08
4
8
 
5
9
  - Combined event alerting into single multi-line string instead of multiple single lines
data/README.md CHANGED
@@ -94,6 +94,24 @@ config.vm.synced_folder ".", "/vagrant", fsevents: true,
94
94
  This will exclude all files inside the `path1` and `some/directory`. It will
95
95
  also exclude files such as `another/directory/path1`.
96
96
 
97
+ ### Including files
98
+
99
+ By default, the entire directory tree of the synced folder on the host machine
100
+ is watched. However, there are potential [issues with symlinks][symlink-issues]
101
+ that can arise from this approach, so until a more robust fix is in place you
102
+ can work around symlink issues by overriding the default watch path(s) with the
103
+ `:include` option. This takes an array of strings (as relative paths) to folders
104
+ which must exist when the watch begins (no regexp support), and replaces the
105
+ default synced_folder path with these individual folder paths.
106
+
107
+ ```ruby
108
+ config.vm.synced_folder ".", "/vagrant", fsevents: true,
109
+ include: ["./src"]
110
+ ```
111
+
112
+ This will watch only the files inside `src`, ignoring all other files and
113
+ folders in the synced path.
114
+
97
115
  ### Guest path override
98
116
 
99
117
  If your actual path on the VM is not the same as the one in `synced_folder`, for
@@ -138,3 +156,4 @@ This plugin used [`vagrant-rsync-back`][vagrant-rsync-back] by @smerill and the
138
156
  [vagrant-bindfs]: https://github.com/gael-ian/vagrant-bindfs
139
157
  [vagrant-rsync-back]: https://github.com/smerrill/vagrant-rsync-back
140
158
  [vagrant-fsnotify]: https://github.com/adrienkohlbecker/vagrant-fsnotify
159
+ [symlink-issues]: https://github.com/guard/listen/wiki/Duplicate-directory-errors
@@ -21,13 +21,11 @@ module VagrantPlugins
21
21
  folder.each do |id, opts|
22
22
  next unless active_for_folder? opts[:fsevents]
23
23
 
24
- hostpath = File.expand_path(opts[:hostpath], machine.env.root_path)
25
- hostpath = Vagrant::Util::Platform.fs_real_path(hostpath).to_s
24
+ hostpaths = get_hostpaths(opts, machine)
26
25
 
27
- # Avoid creating a nested directory
28
- hostpath += '/' unless hostpath.end_with?('/')
29
-
30
- @watch[hostpath] = { id: id, machine: machine, opts: opts }
26
+ hostpaths.each do |hostpath|
27
+ @watch[hostpath] = { id: id, machine: machine, opts: opts }
28
+ end
31
29
  end
32
30
  end
33
31
  end
@@ -69,6 +67,21 @@ module VagrantPlugins
69
67
  )
70
68
  )
71
69
  end
70
+
71
+ # Get the hostpath(s) for a given synced folder
72
+ def get_hostpaths(options, machine)
73
+ paths = (options[:include] || [options[:hostpath]])
74
+ hostpaths = []
75
+ paths.each do |path|
76
+ hostpath = File.expand_path(path, machine.env.root_path)
77
+ hostpath = Vagrant::Util::Platform.fs_real_path(hostpath).to_s
78
+
79
+ # Avoid creating a nested directory
80
+ hostpath += '/' unless hostpath.end_with?('/')
81
+ hostpaths << hostpath
82
+ end
83
+ hostpaths
84
+ end
72
85
  end
73
86
  end
74
87
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Fsevents
3
- VERSION = '0.4.2'.freeze
3
+ VERSION = '0.4.3'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-fsevents
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wolf Hatch
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-07 00:00:00.000000000 Z
11
+ date: 2019-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler