autotest-inotify 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/autotest/inotify.rb +9 -4
  2. metadata +4 -4
@@ -71,15 +71,20 @@ module Autotest::Inotify
71
71
  # Watch directories to catch delete/move swap patterns as well as direct
72
72
  # modifications. This handles, e.g. :w in vim.
73
73
  dirs.each do |dir|
74
- @notifier.watch( dir, :all_events ) do |event|
75
- if event.flags.include? :modify and
76
- files.include? event.absolute_name
77
- handle_file_event( event )
74
+ @notifier.watch(dir, :all_events) do |event|
75
+ if event_of_interest?(event.flags) &&
76
+ files.include?(event.absolute_name)
77
+ handle_file_event(event)
78
78
  end
79
79
  end
80
80
  end
81
81
  end
82
82
 
83
+ def event_of_interest?(flags)
84
+ flags.include?(:modify) ||
85
+ flags.include?(:moved_to)
86
+ end
87
+
83
88
  def handle_file_event(event)
84
89
  @changed_files[event.absolute_name] = Time.now
85
90
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autotest-inotify
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Eric Wollesen
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-06-17 00:00:00 -06:00
18
+ date: 2010-09-19 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency