filewatch 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/filewatch/tail.rb +4 -3
- metadata +11 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c7ddc84b7feb8299c8c1a476ea4aa778c71dc15
|
4
|
+
data.tar.gz: f14e75a4347ef972d541ed859d25e8e5de502839
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3befce81368ff67345a6a5ec93e38140ead8464b2e315638591c5e451827759d999146721d21c1433361cadfc1f4d3bd2a888ecba55a7e4e034b98b5e9ed5674
|
7
|
+
data.tar.gz: f6dd66d9c0b007c49e8f881d375a8c576a5f63922ca2c4a641896c1a52bf1ff82d87faf756e541d08100f3c31ae8ab67e2e5e1a48ede51f07bf813b7a3d2dea7
|
data/lib/filewatch/tail.rb
CHANGED
@@ -99,7 +99,8 @@ module FileWatch
|
|
99
99
|
@files[path].close
|
100
100
|
end
|
101
101
|
@files.delete(path)
|
102
|
-
@statcache.delete(path)
|
102
|
+
inode = @statcache.delete(path)
|
103
|
+
@sincedb.delete(inode)
|
103
104
|
else
|
104
105
|
@logger.warn("unknown event type #{event} for #{path}")
|
105
106
|
end
|
@@ -171,6 +172,7 @@ module FileWatch
|
|
171
172
|
private
|
172
173
|
def _read_file(path, &block)
|
173
174
|
@buffers[path] ||= FileWatch::BufferedTokenizer.new(@opts[:delimiter])
|
175
|
+
delimiter_byte_size = @opts[:delimiter].bytesize
|
174
176
|
changed = false
|
175
177
|
loop do
|
176
178
|
begin
|
@@ -178,9 +180,8 @@ module FileWatch
|
|
178
180
|
changed = true
|
179
181
|
@buffers[path].extract(data).each do |line|
|
180
182
|
yield(path, line)
|
183
|
+
@sincedb[@statcache[path]] += (line.bytesize + delimiter_byte_size)
|
181
184
|
end
|
182
|
-
|
183
|
-
@sincedb[@statcache[path]] = @files[path].pos
|
184
185
|
rescue Errno::EWOULDBLOCK, Errno::EINTR, EOFError
|
185
186
|
break
|
186
187
|
end
|
metadata
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: filewatch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jordan Sissel
|
8
8
|
- Pete Fritchman
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-05-29 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
|
-
description: Watch files and directories in ruby. Also supports tailing and glob file
|
14
|
+
description: Watch files and directories in ruby. Also supports tailing and glob file
|
15
|
+
patterns.
|
15
16
|
email:
|
16
17
|
- jls@semicomplete.com
|
17
18
|
- petef@databits.net
|
@@ -53,25 +54,25 @@ files:
|
|
53
54
|
homepage: https://github.com/jordansissel/ruby-filewatch
|
54
55
|
licenses: []
|
55
56
|
metadata: {}
|
56
|
-
post_install_message:
|
57
|
+
post_install_message:
|
57
58
|
rdoc_options: []
|
58
59
|
require_paths:
|
59
60
|
- lib
|
60
61
|
- lib
|
61
62
|
required_ruby_version: !ruby/object:Gem::Requirement
|
62
63
|
requirements:
|
63
|
-
- -
|
64
|
+
- - ">="
|
64
65
|
- !ruby/object:Gem::Version
|
65
66
|
version: '0'
|
66
67
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
68
|
requirements:
|
68
|
-
- -
|
69
|
+
- - ">="
|
69
70
|
- !ruby/object:Gem::Version
|
70
71
|
version: '0'
|
71
72
|
requirements: []
|
72
|
-
rubyforge_project:
|
73
|
-
rubygems_version: 2.
|
74
|
-
signing_key:
|
73
|
+
rubyforge_project:
|
74
|
+
rubygems_version: 2.4.6
|
75
|
+
signing_key:
|
75
76
|
specification_version: 4
|
76
77
|
summary: filewatch - file watching for ruby
|
77
78
|
test_files: []
|