file-tail 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +1 -0
- data/VERSION +1 -1
- data/file-tail.gemspec +13 -13
- data/lib/file/tail.rb +2 -0
- data/lib/file/tail/version.rb +1 -1
- data/tests/file_tail_test.rb +62 -0
- metadata +65 -79
data/CHANGES
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.9
|
data/file-tail.gemspec
CHANGED
@@ -1,37 +1,37 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
|
-
s.name =
|
5
|
-
s.version = "1.0.
|
4
|
+
s.name = "file-tail"
|
5
|
+
s.version = "1.0.9"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Florian Frank"]
|
9
|
-
s.date =
|
10
|
-
s.description =
|
11
|
-
s.email =
|
12
|
-
s.extra_rdoc_files = ["README.rdoc", "lib/file
|
9
|
+
s.date = "2012-05-31"
|
10
|
+
s.description = "Library to tail files in Ruby"
|
11
|
+
s.email = "flori@ping.de"
|
12
|
+
s.extra_rdoc_files = ["README.rdoc", "lib/file/tail/group.rb", "lib/file/tail/line_extension.rb", "lib/file/tail/logfile.rb", "lib/file/tail/tailer.rb", "lib/file/tail/version.rb", "lib/file/tail.rb", "lib/file-tail.rb"]
|
13
13
|
s.files = [".gitignore", ".travis.yml", "CHANGES", "COPYING", "Gemfile", "README.rdoc", "Rakefile", "VERSION", "bin/rtail", "examples/pager.rb", "examples/tail.rb", "file-tail.gemspec", "lib/file-tail.rb", "lib/file/tail.rb", "lib/file/tail/group.rb", "lib/file/tail/line_extension.rb", "lib/file/tail/logfile.rb", "lib/file/tail/tailer.rb", "lib/file/tail/version.rb", "tests/file_tail_group_test.rb", "tests/file_tail_test.rb", "tests/test_helper.rb"]
|
14
|
-
s.homepage =
|
14
|
+
s.homepage = "http://github.com/flori/file-tail"
|
15
15
|
s.rdoc_options = ["--title", "File-tail - File::Tail for Ruby", "--main", "README.rdoc"]
|
16
16
|
s.require_paths = ["lib"]
|
17
|
-
s.rubygems_version =
|
18
|
-
s.summary =
|
19
|
-
s.test_files = ["tests/
|
17
|
+
s.rubygems_version = "1.8.24"
|
18
|
+
s.summary = "File::Tail for Ruby"
|
19
|
+
s.test_files = ["tests/file_tail_group_test.rb", "tests/file_tail_test.rb", "tests/test_helper.rb"]
|
20
20
|
|
21
21
|
if s.respond_to? :specification_version then
|
22
22
|
s.specification_version = 3
|
23
23
|
|
24
24
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
25
|
-
s.add_development_dependency(%q<gem_hadar>, ["~> 0.1.
|
25
|
+
s.add_development_dependency(%q<gem_hadar>, ["~> 0.1.8"])
|
26
26
|
s.add_development_dependency(%q<test-unit>, ["~> 2.4.0"])
|
27
27
|
s.add_runtime_dependency(%q<tins>, ["~> 0.3"])
|
28
28
|
else
|
29
|
-
s.add_dependency(%q<gem_hadar>, ["~> 0.1.
|
29
|
+
s.add_dependency(%q<gem_hadar>, ["~> 0.1.8"])
|
30
30
|
s.add_dependency(%q<test-unit>, ["~> 2.4.0"])
|
31
31
|
s.add_dependency(%q<tins>, ["~> 0.3"])
|
32
32
|
end
|
33
33
|
else
|
34
|
-
s.add_dependency(%q<gem_hadar>, ["~> 0.1.
|
34
|
+
s.add_dependency(%q<gem_hadar>, ["~> 0.1.8"])
|
35
35
|
s.add_dependency(%q<test-unit>, ["~> 2.4.0"])
|
36
36
|
s.add_dependency(%q<tins>, ["~> 0.3"])
|
37
37
|
end
|
data/lib/file/tail.rb
CHANGED
data/lib/file/tail/version.rb
CHANGED
data/tests/file_tail_test.rb
CHANGED
@@ -289,6 +289,68 @@ class FileTailTest < Test::Unit::TestCase
|
|
289
289
|
assert reopened
|
290
290
|
end
|
291
291
|
|
292
|
+
def test_tail_change
|
293
|
+
return if File::PATH_SEPARATOR == ';' # Grmpf! Windows...
|
294
|
+
@in.forward
|
295
|
+
reopened = false
|
296
|
+
@in.after_reopen { |f| reopened = true }
|
297
|
+
lines = []
|
298
|
+
logger = Thread.new do
|
299
|
+
begin
|
300
|
+
timeout(2) do
|
301
|
+
@in.tail(110) do |l|
|
302
|
+
lines << l
|
303
|
+
end
|
304
|
+
end
|
305
|
+
rescue TimeoutError
|
306
|
+
end
|
307
|
+
end
|
308
|
+
appender = Thread.new do
|
309
|
+
until logger.stop?
|
310
|
+
sleep 0.1
|
311
|
+
end
|
312
|
+
@out.close
|
313
|
+
File.unlink(@out.path)
|
314
|
+
@out = File.new(@in.path, "wb")
|
315
|
+
append(@out, 10)
|
316
|
+
end
|
317
|
+
appender.join
|
318
|
+
logger.join
|
319
|
+
assert_equal(110, lines.size)
|
320
|
+
assert reopened
|
321
|
+
end
|
322
|
+
|
323
|
+
def test_tail_change2
|
324
|
+
return if File::PATH_SEPARATOR == ';' # Grmpf! Windows...
|
325
|
+
@in.forward
|
326
|
+
reopened = false
|
327
|
+
@in.after_reopen { |f| reopened = true }
|
328
|
+
lines = []
|
329
|
+
logger = Thread.new do
|
330
|
+
begin
|
331
|
+
timeout(2) do
|
332
|
+
@in.tail(110) do |l|
|
333
|
+
lines << l
|
334
|
+
end
|
335
|
+
end
|
336
|
+
rescue TimeoutError
|
337
|
+
end
|
338
|
+
end
|
339
|
+
appender = Thread.new do
|
340
|
+
until logger.stop?
|
341
|
+
sleep 0.1
|
342
|
+
end
|
343
|
+
@out.truncate 0
|
344
|
+
@out.close
|
345
|
+
@out = File.new(@in.path, "wb")
|
346
|
+
append(@out, 10)
|
347
|
+
end
|
348
|
+
appender.join
|
349
|
+
logger.join
|
350
|
+
assert_equal(110, lines.size)
|
351
|
+
assert reopened
|
352
|
+
end
|
353
|
+
|
292
354
|
def teardown
|
293
355
|
@in.close
|
294
356
|
@out.close
|
metadata
CHANGED
@@ -1,86 +1,78 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: file-tail
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.9
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 8
|
10
|
-
version: 1.0.8
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Florian Frank
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-05-31 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: gem_hadar
|
23
|
-
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.1.8
|
24
22
|
type: :development
|
25
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
25
|
none: false
|
27
|
-
requirements:
|
26
|
+
requirements:
|
28
27
|
- - ~>
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
|
31
|
-
|
32
|
-
- 0
|
33
|
-
- 1
|
34
|
-
- 4
|
35
|
-
version: 0.1.4
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.1.8
|
30
|
+
- !ruby/object:Gem::Dependency
|
38
31
|
name: test-unit
|
39
|
-
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 2.4.0
|
40
38
|
type: :development
|
41
|
-
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
41
|
none: false
|
43
|
-
requirements:
|
42
|
+
requirements:
|
44
43
|
- - ~>
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
hash: 31
|
47
|
-
segments:
|
48
|
-
- 2
|
49
|
-
- 4
|
50
|
-
- 0
|
44
|
+
- !ruby/object:Gem::Version
|
51
45
|
version: 2.4.0
|
52
|
-
|
53
|
-
- !ruby/object:Gem::Dependency
|
46
|
+
- !ruby/object:Gem::Dependency
|
54
47
|
name: tins
|
55
|
-
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0.3'
|
56
54
|
type: :runtime
|
57
|
-
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
57
|
none: false
|
59
|
-
requirements:
|
58
|
+
requirements:
|
60
59
|
- - ~>
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
|
63
|
-
segments:
|
64
|
-
- 0
|
65
|
-
- 3
|
66
|
-
version: "0.3"
|
67
|
-
version_requirements: *id003
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.3'
|
68
62
|
description: Library to tail files in Ruby
|
69
63
|
email: flori@ping.de
|
70
64
|
executables: []
|
71
|
-
|
72
65
|
extensions: []
|
73
|
-
|
74
|
-
extra_rdoc_files:
|
66
|
+
extra_rdoc_files:
|
75
67
|
- README.rdoc
|
76
|
-
- lib/file-tail.rb
|
77
|
-
- lib/file/tail.rb
|
78
|
-
- lib/file/tail/version.rb
|
79
|
-
- lib/file/tail/line_extension.rb
|
80
|
-
- lib/file/tail/tailer.rb
|
81
68
|
- lib/file/tail/group.rb
|
69
|
+
- lib/file/tail/line_extension.rb
|
82
70
|
- lib/file/tail/logfile.rb
|
83
|
-
|
71
|
+
- lib/file/tail/tailer.rb
|
72
|
+
- lib/file/tail/version.rb
|
73
|
+
- lib/file/tail.rb
|
74
|
+
- lib/file-tail.rb
|
75
|
+
files:
|
84
76
|
- .gitignore
|
85
77
|
- .travis.yml
|
86
78
|
- CHANGES
|
@@ -103,44 +95,38 @@ files:
|
|
103
95
|
- tests/file_tail_group_test.rb
|
104
96
|
- tests/file_tail_test.rb
|
105
97
|
- tests/test_helper.rb
|
106
|
-
has_rdoc: true
|
107
98
|
homepage: http://github.com/flori/file-tail
|
108
99
|
licenses: []
|
109
|
-
|
110
100
|
post_install_message:
|
111
|
-
rdoc_options:
|
101
|
+
rdoc_options:
|
112
102
|
- --title
|
113
103
|
- File-tail - File::Tail for Ruby
|
114
104
|
- --main
|
115
105
|
- README.rdoc
|
116
|
-
require_paths:
|
106
|
+
require_paths:
|
117
107
|
- lib
|
118
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
108
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
119
109
|
none: false
|
120
|
-
requirements:
|
121
|
-
- -
|
122
|
-
- !ruby/object:Gem::Version
|
123
|
-
|
124
|
-
segments:
|
110
|
+
requirements:
|
111
|
+
- - ! '>='
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0'
|
114
|
+
segments:
|
125
115
|
- 0
|
126
|
-
|
127
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
|
+
hash: -1118280401649333258
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
118
|
none: false
|
129
|
-
requirements:
|
130
|
-
- -
|
131
|
-
- !ruby/object:Gem::Version
|
132
|
-
|
133
|
-
segments:
|
134
|
-
- 0
|
135
|
-
version: "0"
|
119
|
+
requirements:
|
120
|
+
- - ! '>='
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '0'
|
136
123
|
requirements: []
|
137
|
-
|
138
124
|
rubyforge_project:
|
139
|
-
rubygems_version: 1.
|
125
|
+
rubygems_version: 1.8.24
|
140
126
|
signing_key:
|
141
127
|
specification_version: 3
|
142
128
|
summary: File::Tail for Ruby
|
143
|
-
test_files:
|
129
|
+
test_files:
|
130
|
+
- tests/file_tail_group_test.rb
|
144
131
|
- tests/file_tail_test.rb
|
145
132
|
- tests/test_helper.rb
|
146
|
-
- tests/file_tail_group_test.rb
|