filewatch 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/filewatch/watch.rb +9 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 846e8322c5eaff65f07c8fc29a38252fc012848b
|
4
|
+
data.tar.gz: 2d6f2d06f3fce3016decdeb4d7f19c2fc033d63b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6ddbce50ce399c9201f60c54790bf310afb0658f577ef6ae0de16f552f9c4c2aab70106eb34f06f5d8eadbcc492743bd03232030e2e39363b75bcc9988c4c1e
|
7
|
+
data.tar.gz: eec3de133bc8998d9f956655a07c63725b0c69a111a93355740b1e615b7615ed3c980dc048de7927e3138d455420b6b636fbfbc04e124c26a05eb7f41d974f18
|
data/lib/filewatch/watch.rb
CHANGED
@@ -30,6 +30,10 @@ module FileWatch
|
|
30
30
|
@inode = inode if inode
|
31
31
|
end
|
32
32
|
|
33
|
+
def clear_timeout
|
34
|
+
@timeout_sent = false
|
35
|
+
end
|
36
|
+
|
33
37
|
def create_sent?
|
34
38
|
@create_sent
|
35
39
|
end
|
@@ -164,16 +168,19 @@ module FileWatch
|
|
164
168
|
@logger.debug? && @logger.debug("#{path}: old inode was #{watched_file.inode.inspect}, new is #{inode.inspect}")
|
165
169
|
yield(:delete, path)
|
166
170
|
yield(:create, path)
|
171
|
+
watched_file.update(stat, inode)
|
167
172
|
elsif stat.size < old_size
|
168
173
|
@logger.debug? && @logger.debug("#{path}: file rolled, new size is #{stat.size}, old size #{old_size}")
|
169
174
|
yield(:delete, path)
|
170
175
|
yield(:create, path)
|
176
|
+
watched_file.update(stat, inode)
|
171
177
|
elsif stat.size > old_size
|
172
178
|
@logger.debug? && @logger.debug("#{path}: file grew, old size #{old_size}, new size #{stat.size}")
|
173
179
|
yield(:modify, path)
|
180
|
+
# if there is a material change to the file, re-enable timeout
|
181
|
+
watched_file.clear_timeout
|
182
|
+
watched_file.update(stat, inode)
|
174
183
|
end
|
175
|
-
|
176
|
-
watched_file.update(stat, inode)
|
177
184
|
end
|
178
185
|
end
|
179
186
|
end # def each
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: filewatch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jordan Sissel
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-01-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|