Change inotify watch options to not fire event when file is juste read
This commit is contained in:
parent
3cdcea3dfd
commit
e19a9304ec
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user