vagrant-fsevents 0.4.3 → 0.5.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 +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/vagrant-fsevents/changeEvents.rb +7 -5
- data/lib/vagrant-fsevents/paths.rb +30 -12
- data/lib/vagrant-fsevents/responder.rb +2 -2
- data/lib/vagrant-fsevents/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98217ab4f20b02c03c844a5a085062017c72b5ea12b5410ec1fc25ff0fb00d5b
|
4
|
+
data.tar.gz: 673b9b21240ba2859381cd36939f2e5f5b81ec7af262dd324bc69bcef06c690a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eceace66c2f6bac16d288069da84aa8e00265741e190c3085ee821b03334d5ae8cd777e9ed818aa3f98fa481022c36ffaa30701464ff8d1dee074a56fcb697b7
|
7
|
+
data.tar.gz: 8dd5bf1e0388d3a3aa27c304702e7b9d7d79a280c76cc127761c5b610faecf3111cfe09d2baae2e7ac58772c4d8e0f4dd57b8c5206003debd2b14549756f896d
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.5.0 - 2019-04-01
|
4
|
+
|
5
|
+
- Bugfix with new 'include' keyword - guest path wasn't always correct using includes
|
6
|
+
- Updated version to semantically indicate addition of 'include' keyword
|
7
|
+
|
3
8
|
## 0.4.3 - 2019-03-31
|
4
9
|
|
5
10
|
- Added new 'include' keyword (complimenting the 'exclude' keyword) to help work around symlink issues with guard/listen
|
@@ -7,6 +7,7 @@ module VagrantPlugins
|
|
7
7
|
attr_reader :path
|
8
8
|
attr_reader :type
|
9
9
|
attr_reader :watch
|
10
|
+
attr_reader :sync_path
|
10
11
|
attr_reader :watch_path
|
11
12
|
attr_reader :relative_path
|
12
13
|
attr_reader :full_path_on_guest
|
@@ -14,24 +15,25 @@ module VagrantPlugins
|
|
14
15
|
# Takes the output of a listen callback (as arrays of strings of
|
15
16
|
# files split by type of change) and converts them into single events
|
16
17
|
# for a specific watch definition
|
17
|
-
def self.make(mods, adds, removes,
|
18
|
+
def self.make(mods, adds, removes, watch)
|
18
19
|
change_events = []
|
19
20
|
structure = { modified: mods, added: adds, removed: removes }
|
20
21
|
structure.each do |type, files|
|
21
22
|
files.each do |path|
|
22
|
-
change_events.push new(path, type,
|
23
|
+
change_events.push new(path, type, watch)
|
23
24
|
end
|
24
25
|
end
|
25
26
|
change_events
|
26
27
|
end
|
27
28
|
|
28
|
-
def initialize(path, type,
|
29
|
+
def initialize(path, type, watch)
|
29
30
|
@path = path
|
30
31
|
@type = type
|
31
|
-
@
|
32
|
+
@sync_path = watch[:sync_path]
|
33
|
+
@watch_path = watch[:watch_path]
|
32
34
|
@watch = watch
|
33
35
|
|
34
|
-
@relative_path = path.sub(
|
36
|
+
@relative_path = path.sub(sync_path, '')
|
35
37
|
@full_path_on_guest = File.join(
|
36
38
|
(watch[:opts][:override_guestpath] || watch[:opts][:guestpath]),
|
37
39
|
@relative_path
|
@@ -21,15 +21,24 @@ module VagrantPlugins
|
|
21
21
|
folder.each do |id, opts|
|
22
22
|
next unless active_for_folder? opts[:fsevents]
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
hostpaths.each do |hostpath|
|
27
|
-
@watch[hostpath] = { id: id, machine: machine, opts: opts }
|
28
|
-
end
|
24
|
+
add_folder_to_watch(id, opts, machine)
|
29
25
|
end
|
30
26
|
end
|
31
27
|
end
|
32
28
|
|
29
|
+
# Populates `@watch` attribute from a single watch
|
30
|
+
def add_folder_to_watch(id, opts, machine)
|
31
|
+
get_paths(opts, machine).each do |paths|
|
32
|
+
@watch[paths[:hostpath]] = {
|
33
|
+
id: id,
|
34
|
+
machine: machine,
|
35
|
+
opts: opts,
|
36
|
+
sync_path: paths[:syncpath],
|
37
|
+
watch_path: paths[:hostpath]
|
38
|
+
}
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
33
42
|
# Populates `@ignore` attribute from a single VM instance
|
34
43
|
def add_folders_to_ignore(folders)
|
35
44
|
folders.values.each do |folder|
|
@@ -69,19 +78,28 @@ module VagrantPlugins
|
|
69
78
|
end
|
70
79
|
|
71
80
|
# Get the hostpath(s) for a given synced folder
|
72
|
-
def
|
81
|
+
def get_paths(options, machine)
|
73
82
|
paths = (options[:include] || [options[:hostpath]])
|
74
83
|
hostpaths = []
|
84
|
+
syncpath = get_host_path(options[:hostpath], machine)
|
75
85
|
paths.each do |path|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
hostpath += '/' unless hostpath.end_with?('/')
|
81
|
-
hostpaths << hostpath
|
86
|
+
hostpaths << {
|
87
|
+
hostpath: get_host_path(path, machine),
|
88
|
+
syncpath: syncpath
|
89
|
+
}
|
82
90
|
end
|
83
91
|
hostpaths
|
84
92
|
end
|
93
|
+
|
94
|
+
# Convert a path to a full path on the host machine
|
95
|
+
def get_host_path(path, machine)
|
96
|
+
hostpath = File.expand_path(path, machine.env.root_path)
|
97
|
+
hostpath = Vagrant::Util::Platform.fs_real_path(hostpath).to_s
|
98
|
+
|
99
|
+
# Avoid creating a nested directory
|
100
|
+
hostpath += '/' unless hostpath.end_with?('/')
|
101
|
+
hostpath
|
102
|
+
end
|
85
103
|
end
|
86
104
|
end
|
87
105
|
end
|
@@ -16,8 +16,8 @@ module VagrantPlugins
|
|
16
16
|
|
17
17
|
clear_expired_change_locks
|
18
18
|
|
19
|
-
events_to_sync = watches.map do |
|
20
|
-
events = ChangeEvents.make(mods, adds, removes,
|
19
|
+
events_to_sync = watches.map do |_, watch|
|
20
|
+
events = ChangeEvents.make(mods, adds, removes, watch)
|
21
21
|
add_locks(remove_locked_events(select_by_relevance(events)))
|
22
22
|
end
|
23
23
|
|