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 +4 -4
- data/AUTHORS +1 -0
- data/CHANGELOG.md +5 -1
- data/Gemfile +1 -1
- data/README.md +20 -0
- data/lib/vagrant-fsnotify/command-fsnotify.rb +11 -1
- data/lib/vagrant-fsnotify/config-fsnotify.rb +29 -0
- data/lib/vagrant-fsnotify/plugin.rb +5 -0
- data/lib/vagrant-fsnotify/version.rb +1 -1
- metadata +7 -6
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 67c49ed58e768b8d862c56a16758935e722abd51c92f44bcba26affe5a4c8c02
         | 
| 4 | 
            +
              data.tar.gz: 1f17acfa20d968e6b9ac1aea5aeedf2a4465859966edc54b1254e6a59d23a378
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 8390dfed9fd75c925da986d2ef422eae14b410f55f720fab93a132231d54453452459b3c124cae077e165a541ec518db4c79b913b814011cef7e4f234de2d513
         | 
| 7 | 
            +
              data.tar.gz: 2ca844f611778d2b139f6c792ae2c82f13dd91a5ec07f07d12532e93572c229756519eca82befead5a6b5c70ddb0f51ca0d1389d5b721f827bc052be9802de2f
         | 
    
        data/AUTHORS
    CHANGED
    
    
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        data/Gemfile
    CHANGED
    
    
    
        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. | 
| 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
         | 
    
        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. | 
| 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:  | 
| 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. | 
| 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: []
         |