vagrant-fsnotify 0.3.1 → 0.3.2

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: afd5d14e23b69bcb7bea32dfa01294ffac09fc37b2fb16d94e3afad4a06306c2
4
- data.tar.gz: b4c61f02e38a5b7af3bf476a8cf3d8fa6e016be34dfcca7490904bc9711f0768
3
+ metadata.gz: 67c49ed58e768b8d862c56a16758935e722abd51c92f44bcba26affe5a4c8c02
4
+ data.tar.gz: 1f17acfa20d968e6b9ac1aea5aeedf2a4465859966edc54b1254e6a59d23a378
5
5
  SHA512:
6
- metadata.gz: cf5a30aec9826b8944bdb7bbe75ebfcc83ce6732726a14dfd090d75a679b820974b2c7923388c48a5ee4fa9dbae504020990952515a2164860179bdd03b06f08
7
- data.tar.gz: 1f53979826c5233e15310f557d2c309f0edf15a6e64e77b7f3bc7e9439b1d47c995288fc20c0bbfe12eb31b6624db5f65af89e6037ecf19a20cfea63bd8e1e41
6
+ metadata.gz: 8390dfed9fd75c925da986d2ef422eae14b410f55f720fab93a132231d54453452459b3c124cae077e165a541ec518db4c79b913b814011cef7e4f234de2d513
7
+ data.tar.gz: 2ca844f611778d2b139f6c792ae2c82f13dd91a5ec07f07d12532e93572c229756519eca82befead5a6b5c70ddb0f51ca0d1389d5b721f827bc052be9802de2f
data/AUTHORS CHANGED
@@ -4,3 +4,4 @@ Adrien Kohlbecker <adrien.kohlbecker@gmail.com>
4
4
  Don Morrison <github@elskwid.net>
5
5
  Leandro Facchinetti <me@leafac.com>
6
6
  Levon Hakobyan <levon.hakobyan@microbiz.com>
7
+ stice2k <>
data/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
- 0.4.0 - 2019-04-11
1
+ 0.3.2 - 2021-07-12
2
+ ==================
3
+ - Add parameter to allow selection of touch flags
4
+
5
+ 0.3.1 - 2019-04-11
2
6
  ==================
3
7
  - Update mtime as well as atime to trigger file events on the guest (#28)
4
8
 
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  group :development do
4
- gem "vagrant", git: "https://github.com/hashicorp/vagrant.git", ref: 'v2.2.4'
4
+ gem "vagrant", git: "https://github.com/hashicorp/vagrant.git", ref: 'v2.2.18'
5
5
  end
6
6
 
7
7
  group :plugins do
data/README.md CHANGED
@@ -158,6 +158,26 @@ folder, add the following to the `Vagrantfile`:
158
158
  config.vm.synced_folder ".", "/vagrant", fsnotify: [:added]
159
159
  ```
160
160
 
161
+ ### Set touch flags
162
+
163
+ By default, the touch command on the VM will be run with modification flag and access flag, setting
164
+ both modification and access attributes of the file. If only either flag should be used the `:touch`
165
+ param can be set per machine config in the `Vagrantfile`. The param supports an array with either or both
166
+ `:modification` and `:access` values.
167
+
168
+ As example, to only set the access attribute of files when they have changed on the host system set the following
169
+ in the `Vagrantfile`:
170
+
171
+ ```ruby
172
+ config.fsnotify.touch = [:access]
173
+ ```
174
+ or for instances and providers
175
+ ```ruby
176
+ config.vm.define "vm" do |instance|
177
+ instance.fsnotify.touch = [:access]
178
+ end
179
+ ```
180
+
161
181
  Development
162
182
  -------------
163
183
 
@@ -199,7 +199,8 @@ MESSAGE
199
199
  end
200
200
 
201
201
  tosync.each do |machine, files|
202
- machine.communicate.execute("touch -am '#{files.join("' '")}'")
202
+ touch_flags = get_touch_flags(machine.config.fsnotify.touch)
203
+ machine.communicate.execute("touch -#{touch_flags} '#{files.join("' '")}'")
203
204
  remove_from_this_machine = files & todelete
204
205
  unless remove_from_this_machine.empty?
205
206
  machine.communicate.execute("rm -rf '#{remove_from_this_machine.join("' '")}'")
@@ -223,5 +224,14 @@ MESSAGE
223
224
 
224
225
  end
225
226
 
227
+ def get_touch_flags(touch)
228
+ if touch.include? :modification and not touch.include? :access
229
+ return "m"
230
+ elsif not touch.include? :modification and touch.include? :access
231
+ return "a"
232
+ else
233
+ return "am"
234
+ end
235
+ end
226
236
  end
227
237
  end
@@ -0,0 +1,29 @@
1
+ begin
2
+ require "vagrant"
3
+ rescue LoadError
4
+ raise "The vagrant-fsnotify plugin must be run within Vagrant."
5
+ end
6
+
7
+ if Vagrant::VERSION < "1.7.3"
8
+ raise <<-ERROR
9
+ The vagrant-fsnotify plugin is only compatible with Vagrant 1.7.3+. If you can't
10
+ upgrade, consider installing an old version of vagrant-fsnotify with:
11
+ $ vagrant plugin install vagrant-fsnotify --plugin-version 0.0.6.
12
+ ERROR
13
+ end
14
+
15
+ module VagrantPlugins::Fsnotify
16
+
17
+ class Config < Vagrant.plugin("2", :config)
18
+ attr_accessor :touch
19
+
20
+ def initialize
21
+ @touch = UNSET_VALUE
22
+ end
23
+
24
+ def finalize!
25
+ @touch = [:modification, :access] if @touch == UNSET_VALUE
26
+ end
27
+ end
28
+
29
+ end
@@ -22,6 +22,11 @@ module VagrantPlugins::Fsnotify
22
22
  Command
23
23
  end
24
24
 
25
+ config "fsnotify" do
26
+ require_relative "config-fsnotify"
27
+ Config
28
+ end
29
+
25
30
  end
26
31
 
27
32
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Fsnotify
3
- VERSION = "0.3.1"
3
+ VERSION = "0.3.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-fsnotify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrien Kohlbecker
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-11 00:00:00.000000000 Z
11
+ date: 2021-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,6 +58,7 @@ files:
58
58
  - bin/setup
59
59
  - lib/vagrant-fsnotify.rb
60
60
  - lib/vagrant-fsnotify/command-fsnotify.rb
61
+ - lib/vagrant-fsnotify/config-fsnotify.rb
61
62
  - lib/vagrant-fsnotify/plugin.rb
62
63
  - lib/vagrant-fsnotify/version.rb
63
64
  - vagrant-fsnotify.gemspec
@@ -65,7 +66,7 @@ homepage: https://github.com/adrienkohlbecker/vagrant-fsnotify
65
66
  licenses:
66
67
  - MIT
67
68
  metadata: {}
68
- post_install_message:
69
+ post_install_message:
69
70
  rdoc_options: []
70
71
  require_paths:
71
72
  - lib
@@ -80,8 +81,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
81
  - !ruby/object:Gem::Version
81
82
  version: '0'
82
83
  requirements: []
83
- rubygems_version: 3.0.3
84
- signing_key:
84
+ rubygems_version: 3.1.4
85
+ signing_key:
85
86
  specification_version: 4
86
87
  summary: Forward filesystem change notifications to your Vagrant VM
87
88
  test_files: []