diff --git a/lib/guard/listeners/linux.rb b/lib/guard/listeners/linux.rb index a01c5f5..362af1b 100644 --- a/lib/guard/listeners/linux.rb +++ b/lib/guard/listeners/linux.rb @@ -10,7 +10,7 @@ module Guard def on_change(&callback) @callback = callback - inotify.watch(Dir.pwd, :recursive, :attrib, :modify, :create) do |event| + inotify.watch(Dir.pwd, :recursive, :modify, :create, :delete, :move) do |event| unless event.name == "" # Event on root directory @files << event.absolute_name end diff --git a/spec/guard/listeners/linux_spec.rb b/spec/guard/listeners/linux_spec.rb index 25736db..d0f1858 100644 --- a/spec/guard/listeners/linux_spec.rb +++ b/spec/guard/listeners/linux_spec.rb @@ -38,7 +38,7 @@ describe Guard::Linux do file = @fixture_path.join("folder1/file1.txt") File.exists?(file).should be_true start - FileUtils.touch file + File.open(file, 'w') {|f| f.write('') } stop @results.should == ['spec/fixtures/folder1/file1.txt'] end @@ -49,8 +49,8 @@ describe Guard::Linux do File.exists?(file1).should be_true File.exists?(file2).should be_true start - FileUtils.touch file1 - FileUtils.touch file2 + File.open(file1, 'w') {|f| f.write('') } + File.open(file2, 'w') {|f| f.write('') } stop @results.should == ['spec/fixtures/folder1/file1.txt', 'spec/fixtures/folder1/folder2/file2.txt'] end