file-tail 1.1.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,77 +1,73 @@
1
- = File::Tail for Ruby
1
+ # File::Tail for Ruby
2
2
 
3
- == Description
3
+ ## Description
4
4
 
5
5
  This is a small ruby library that allows it to "tail" files in Ruby, including
6
6
  following a file, that still is growing like the unix command 'tail -f' can.
7
7
 
8
- == Download
8
+ ## Download
9
9
 
10
- The latest version of <b>File::Tail</b> (file-tail) can be found at
10
+ The latest version of *File::Tail* (file-tail) can be found at
11
11
 
12
- http://www.ping.de/~flori
13
-
14
- Online Documentation should be located at
15
12
 
16
13
  http://flori.github.com/file-tail
17
14
 
18
- == Installation
15
+ ## Installation
19
16
 
20
17
  To install file-tail via its gem type:
21
18
 
22
19
  # gem install file-tail
23
20
 
24
- To install from the source repository, just type into the command line as root:
25
-
26
- # rake install
27
-
28
- == Usage
21
+ ## Usage
29
22
 
30
23
  File::Tail is a module in the File class. A lightweight class interface for
31
24
  logfiles can be seen under File::Tail::Logfile.
32
25
 
33
26
  Direct extension of File objects with File::Tail works like that:
34
- File.open(filename) do |log|
35
- log.extend(File::Tail)
36
- log.interval = 10
37
- log.backward(10)
38
- log.tail { |line| puts line }
39
- end
27
+
28
+ File.open(filename) do |log|
29
+ log.extend(File::Tail)
30
+ log.interval # 10
31
+ log.backward(10)
32
+ log.tail { |line| puts line }
33
+ end
40
34
 
41
35
  It's also possible to mix File::Tail in your own File classes
42
36
  (see also File::Tail::Logfile):
43
- class MyFile < File
44
- include File::Tail
45
- end
46
- log = MyFile.new("myfile")
47
- log.interval = 10
48
- log.backward(10)
49
- log.tail { |line| print line }
37
+
38
+ class MyFile < File
39
+ include File::Tail
40
+ end
41
+ log # MyFile.new("myfile")
42
+ log.interval # 10
43
+ log.backward(10)
44
+ log.tail { |line| print line }
50
45
 
51
46
  The forward/backward method returns self, so it's possible to chain
52
47
  methods together like that:
53
- log.backward(10).tail { |line| puts line }
48
+
49
+ log.backward(10).tail { |line| puts line }
54
50
 
55
51
  A command line utility named rtail, that uses File::Tail is provided as well.
56
52
 
57
- == Documentation
53
+ ## Documentation
58
54
 
59
55
  To create the documentation of this module, type
60
56
 
57
+ ```
61
58
  $ rake doc
59
+ ```
62
60
 
63
61
  and the API documentation is generated.
64
62
 
65
63
  In the examples direcotry is a small example of tail and
66
64
  pager program that use this module. You also may want look
67
- at the end of file/tail.rb for a little example.
65
+ at the end of examples/tail.rb for a little example.
68
66
 
69
- == Author
67
+ ## Author
70
68
 
71
69
  Florian Frank mailto:flori@ping.de
72
70
 
73
- == License
71
+ ## License
74
72
 
75
- This is free software; you can redistribute it and/or modify it under
76
- the terms of the GNU General Public License Version 2 as published by
77
- the Free Software Foundation: http://www.gnu.org/copyleft/gpl.html
73
+ Apache License, Version 2.0 See the COPYING file in the source archive.
data/Rakefile CHANGED
@@ -11,28 +11,15 @@ GemHadar do
11
11
  summary "#{path_name.camelize} for Ruby"
12
12
  description 'Library to tail files in Ruby'
13
13
  test_dir 'tests'
14
- ignore '.*.sw[pon]', 'pkg', 'Gemfile.lock', 'coverage', '*.rbc', '.rbx', '.AppleDouble', '.bundle'
15
- readme 'README.rdoc'
16
- licenses << 'GPL-2.0'
14
+ ignore '.*.sw[pon]', 'pkg', 'Gemfile.lock', 'coverage', '*.rbc', '.rbx',
15
+ '.AppleDouble', '.bundle', 'errors.lst', '.utilsrc'
16
+ readme 'README.md'
17
+ licenses << 'Apache-2.0'
17
18
 
18
19
  dependency 'tins', '~>1.0'
19
20
 
20
- development_dependency 'test-unit', '~>2.4.0'
21
-
22
- install_library do
23
- cd 'lib' do
24
- libdir = CONFIG["sitelibdir"]
25
-
26
- dest = File.join(libdir, 'file')
27
- mkdir_p(dest)
28
- dest = File.join(libdir, path_name)
29
- install(path_name + '.rb', dest + '.rb', :verbose => true)
30
- mkdir_p(dest)
31
- for file in Dir[File.join(path_name, '*.rb')]
32
- install(file, dest, :verbose => true)
33
- end
34
- end
35
- bindir = CONFIG["bindir"]
36
- install('bin/rtail', bindir, :verbose => true, :mode => 0755)
37
- end
21
+ development_dependency 'test-unit', '~>3.0'
22
+ development_dependency 'all_images'
23
+ development_dependency 'simplecov'
24
+ development_dependency 'debug'
38
25
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.1
1
+ 1.3.0
data/file-tail.gemspec CHANGED
@@ -1,40 +1,31 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: file-tail 1.1.1 ruby lib
2
+ # stub: file-tail 1.3.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "file-tail".freeze
6
- s.version = "1.1.1"
6
+ s.version = "1.3.0".freeze
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
10
10
  s.authors = ["Florian Frank".freeze]
11
- s.date = "2016-04-19"
11
+ s.date = "2024-09-13"
12
12
  s.description = "Library to tail files in Ruby".freeze
13
13
  s.email = "flori@ping.de".freeze
14
- s.extra_rdoc_files = ["README.rdoc".freeze, "lib/file-tail.rb".freeze, "lib/file/tail.rb".freeze, "lib/file/tail/group.rb".freeze, "lib/file/tail/line_extension.rb".freeze, "lib/file/tail/logfile.rb".freeze, "lib/file/tail/tailer.rb".freeze, "lib/file/tail/version.rb".freeze]
15
- s.files = [".gitignore".freeze, ".travis.yml".freeze, "CHANGES".freeze, "COPYING".freeze, "Gemfile".freeze, "README.rdoc".freeze, "Rakefile".freeze, "VERSION".freeze, "bin/rtail".freeze, "examples/pager.rb".freeze, "examples/tail.rb".freeze, "file-tail.gemspec".freeze, "lib/file-tail.rb".freeze, "lib/file/tail.rb".freeze, "lib/file/tail/group.rb".freeze, "lib/file/tail/line_extension.rb".freeze, "lib/file/tail/logfile.rb".freeze, "lib/file/tail/tailer.rb".freeze, "lib/file/tail/version.rb".freeze, "tests/file_tail_group_test.rb".freeze, "tests/file_tail_test.rb".freeze, "tests/test_helper.rb".freeze]
14
+ s.extra_rdoc_files = ["README.md".freeze, "lib/file-tail.rb".freeze, "lib/file/tail.rb".freeze, "lib/file/tail/group.rb".freeze, "lib/file/tail/line_extension.rb".freeze, "lib/file/tail/logfile.rb".freeze, "lib/file/tail/tailer.rb".freeze, "lib/file/tail/version.rb".freeze]
15
+ s.files = [".all_images.yml".freeze, ".gitignore".freeze, ".travis.yml".freeze, "CHANGES.md".freeze, "COPYING".freeze, "Gemfile".freeze, "README.md".freeze, "Rakefile".freeze, "VERSION".freeze, "bin/rtail".freeze, "examples/pager.rb".freeze, "examples/tail.rb".freeze, "file-tail.gemspec".freeze, "lib/file-tail.rb".freeze, "lib/file/tail.rb".freeze, "lib/file/tail/group.rb".freeze, "lib/file/tail/line_extension.rb".freeze, "lib/file/tail/logfile.rb".freeze, "lib/file/tail/tailer.rb".freeze, "lib/file/tail/version.rb".freeze, "tests/file_tail_group_test.rb".freeze, "tests/file_tail_test.rb".freeze, "tests/test_helper.rb".freeze]
16
16
  s.homepage = "http://github.com/flori/file-tail".freeze
17
- s.licenses = ["GPL-2.0".freeze]
18
- s.rdoc_options = ["--title".freeze, "File-tail - File::Tail for Ruby".freeze, "--main".freeze, "README.rdoc".freeze]
19
- s.rubygems_version = "2.6.3".freeze
17
+ s.licenses = ["Apache-2.0".freeze]
18
+ s.rdoc_options = ["--title".freeze, "File-tail - File::Tail for Ruby".freeze, "--main".freeze, "README.md".freeze]
19
+ s.rubygems_version = "3.5.18".freeze
20
20
  s.summary = "File::Tail for Ruby".freeze
21
21
  s.test_files = ["tests/file_tail_group_test.rb".freeze, "tests/file_tail_test.rb".freeze, "tests/test_helper.rb".freeze]
22
22
 
23
- if s.respond_to? :specification_version then
24
- s.specification_version = 4
23
+ s.specification_version = 4
25
24
 
26
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
27
- s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 1.7.1"])
28
- s.add_development_dependency(%q<test-unit>.freeze, ["~> 2.4.0"])
29
- s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.0"])
30
- else
31
- s.add_dependency(%q<gem_hadar>.freeze, ["~> 1.7.1"])
32
- s.add_dependency(%q<test-unit>.freeze, ["~> 2.4.0"])
33
- s.add_dependency(%q<tins>.freeze, ["~> 1.0"])
34
- end
35
- else
36
- s.add_dependency(%q<gem_hadar>.freeze, ["~> 1.7.1"])
37
- s.add_dependency(%q<test-unit>.freeze, ["~> 2.4.0"])
38
- s.add_dependency(%q<tins>.freeze, ["~> 1.0"])
39
- end
25
+ s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 1.17.1".freeze])
26
+ s.add_development_dependency(%q<test-unit>.freeze, ["~> 3.0".freeze])
27
+ s.add_development_dependency(%q<all_images>.freeze, [">= 0".freeze])
28
+ s.add_development_dependency(%q<simplecov>.freeze, [">= 0".freeze])
29
+ s.add_development_dependency(%q<debug>.freeze, [">= 0".freeze])
30
+ s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.0".freeze])
40
31
  end
@@ -1,6 +1,6 @@
1
1
  module File::Tail
2
2
  # File::Tail version
3
- VERSION = '1.1.1'
3
+ VERSION = '1.3.0'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
data/lib/file/tail.rb CHANGED
@@ -94,12 +94,16 @@ class File
94
94
  # value from the filesystem block size.
95
95
  attr_accessor :default_bufsize
96
96
 
97
+ # Override the default line separator
98
+ attr_accessor :line_separator
99
+
97
100
  # Skip the first <code>n</code> lines of this file. The default is to don't
98
101
  # skip any lines at all and start at the beginning of this file.
99
102
  def forward(n = 0)
103
+ preset_attributes unless defined? @lines
100
104
  rewind
101
105
  while n > 0 and not eof?
102
- readline
106
+ readline(@line_separator)
103
107
  n -= 1
104
108
  end
105
109
  self
@@ -115,6 +119,7 @@ class File
115
119
  # filesystem this file belongs to or 8192 bytes if this cannot
116
120
  # be determined.
117
121
  def backward(n = 0, bufsize = nil)
122
+ preset_attributes unless defined? @lines
118
123
  if n <= 0
119
124
  seek(0, File::SEEK_END)
120
125
  return self
@@ -127,13 +132,13 @@ class File
127
132
  while n > 0 and tell > 0 do
128
133
  seek(-bufsize, File::SEEK_CUR)
129
134
  buffer = read(bufsize)
130
- n -= buffer.count("\n")
135
+ n -= buffer.count(@line_separator)
131
136
  seek(-bufsize, File::SEEK_CUR)
132
137
  end
133
138
  else
134
139
  rewind
135
140
  buffer = read(size)
136
- n -= buffer.count("\n")
141
+ n -= buffer.count(@line_separator)
137
142
  rewind
138
143
  end
139
144
  rescue Errno::EINVAL
@@ -142,7 +147,7 @@ class File
142
147
  end
143
148
  pos = -1
144
149
  while n < 0 # forward if we are too far back
145
- pos = buffer.index("\n", pos + 1)
150
+ pos = buffer.index(@line_separator, pos + 1)
146
151
  n += 1
147
152
  end
148
153
  seek(pos + 1, File::SEEK_CUR)
@@ -177,7 +182,7 @@ class File
177
182
  redo
178
183
  rescue ReopenException => e
179
184
  until eof? || @n == 0
180
- block.call readline
185
+ block.call readline(@line_separator)
181
186
  @n -= 1 if @n
182
187
  end
183
188
  reopen_file(e.mode)
@@ -193,7 +198,7 @@ class File
193
198
  def read_line(&block)
194
199
  if @n
195
200
  until @n == 0
196
- block.call readline
201
+ block.call readline(@line_separator)
197
202
  @lines += 1
198
203
  @no_read = 0
199
204
  @n -= 1
@@ -201,7 +206,7 @@ class File
201
206
  end
202
207
  raise ReturnException
203
208
  else
204
- block.call readline
209
+ block.call readline(@line_separator)
205
210
  @lines += 1
206
211
  @no_read = 0
207
212
  output_debug_information
@@ -223,6 +228,7 @@ class File
223
228
  @break_if_eof = false unless defined? @break_if_eof
224
229
  @return_if_eof = false unless defined? @return_if_eof
225
230
  @max_interval ||= 10
231
+ @line_separator ||= $/
226
232
  @interval ||= @max_interval
227
233
  @suspicious_interval ||= 60
228
234
  @lines = 0
@@ -241,9 +247,8 @@ class File
241
247
  @stat = nil
242
248
  raise ReopenException.new(:top)
243
249
  end
244
- else
245
- @stat = stat
246
250
  end
251
+ @stat = stat
247
252
  rescue Errno::ENOENT, Errno::ESTALE
248
253
  raise ReopenException
249
254
  end
@@ -267,7 +272,7 @@ class File
267
272
  end
268
273
 
269
274
  def reopen_file(mode)
270
- $DEBUG and $stdout.print "Reopening '#{path}', mode = #{mode}.\n"
275
+ debug? and $stdout.print "Reopening '#{path}', mode = #{mode}.\n"
271
276
  @no_read = 0
272
277
  reopen(path)
273
278
  if mode == :bottom
@@ -285,7 +290,7 @@ class File
285
290
  end
286
291
 
287
292
  def output_debug_information
288
- $DEBUG or return
293
+ debug? or return
289
294
  STDERR.puts({
290
295
  :path => path,
291
296
  :lines => @lines,
@@ -295,6 +300,10 @@ class File
295
300
  }.inspect)
296
301
  self
297
302
  end
303
+
304
+ def debug?
305
+ ENV['FILE_TAIL_DEBUG'].to_i == 1
306
+ end
298
307
  end
299
308
  end
300
309
 
@@ -4,13 +4,16 @@ require 'test_helper'
4
4
  require 'file/tail'
5
5
  require 'timeout'
6
6
  require 'thread'
7
+ require 'fileutils'
7
8
  Thread.abort_on_exception = true
8
9
 
9
10
  class FileTailTest < Test::Unit::TestCase
10
11
  include File::Tail
12
+ include FileUtils
11
13
 
12
14
  def setup
13
- @out = File.new("test.#$$", "wb")
15
+ @out = File.new(File.join(__dir__, "test.#$$"), "wb")
16
+ at_exit { rm_f File.expand_path(@out.path) }
14
17
  append(@out, 100)
15
18
  @in = File.new(@out.path, "rb")
16
19
  @in.extend(File::Tail)
@@ -194,7 +197,7 @@ class FileTailTest < Test::Unit::TestCase
194
197
  lines = []
195
198
  logger = Thread.new do
196
199
  begin
197
- Timeout::timeout(2) do
200
+ Timeout::timeout(10) do
198
201
  @in.tail do |l|
199
202
  lines << l
200
203
  end
@@ -225,7 +228,7 @@ class FileTailTest < Test::Unit::TestCase
225
228
  lines = []
226
229
  logger = Thread.new do
227
230
  begin
228
- Timeout::timeout(2) do
231
+ Timeout::timeout(10) do
229
232
  @in.tail do |l|
230
233
  lines << l
231
234
  end
@@ -261,7 +264,7 @@ class FileTailTest < Test::Unit::TestCase
261
264
  lines = []
262
265
  logger = Thread.new do
263
266
  begin
264
- Timeout::timeout(2) do
267
+ Timeout::timeout(10) do
265
268
  @in.tail(15) do |l|
266
269
  lines << l
267
270
  end
@@ -298,7 +301,7 @@ class FileTailTest < Test::Unit::TestCase
298
301
  lines = []
299
302
  logger = Thread.new do
300
303
  begin
301
- Timeout::timeout(2) do
304
+ Timeout::timeout(10) do
302
305
  @in.tail(110) do |l|
303
306
  lines << l
304
307
  end
@@ -307,8 +310,10 @@ class FileTailTest < Test::Unit::TestCase
307
310
  end
308
311
  end
309
312
  appender = Thread.new do
310
- until logger.stop?
311
- sleep 0.1
313
+ Timeout::timeout(10) do
314
+ until lines.size == 100
315
+ sleep 0.1
316
+ end
312
317
  end
313
318
  @out.close
314
319
  File.unlink(@out.path)
@@ -331,7 +336,7 @@ class FileTailTest < Test::Unit::TestCase
331
336
  lines = []
332
337
  logger = Thread.new do
333
338
  begin
334
- Timeout::timeout(2) do
339
+ Timeout::timeout(10) do
335
340
  @in.tail(110) do |l|
336
341
  lines << l
337
342
  end
@@ -340,8 +345,10 @@ class FileTailTest < Test::Unit::TestCase
340
345
  end
341
346
  end
342
347
  appender = Thread.new do
343
- until logger.stop?
344
- sleep 0.1
348
+ Timeout::timeout(10) do
349
+ until lines.size == 100
350
+ sleep 0.1
351
+ end
345
352
  end
346
353
  @out.truncate 0
347
354
  @out.close
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: file-tail
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-19 00:00:00.000000000 Z
11
+ date: 2024-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar
@@ -16,28 +16,70 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.7.1
19
+ version: 1.17.1
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.7.1
26
+ version: 1.17.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: test-unit
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.4.0
33
+ version: '3.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 2.4.0
40
+ version: '3.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: all_images
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: simplecov
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: debug
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
41
83
  - !ruby/object:Gem::Dependency
42
84
  name: tins
43
85
  requirement: !ruby/object:Gem::Requirement
@@ -57,7 +99,7 @@ email: flori@ping.de
57
99
  executables: []
58
100
  extensions: []
59
101
  extra_rdoc_files:
60
- - README.rdoc
102
+ - README.md
61
103
  - lib/file-tail.rb
62
104
  - lib/file/tail.rb
63
105
  - lib/file/tail/group.rb
@@ -66,12 +108,13 @@ extra_rdoc_files:
66
108
  - lib/file/tail/tailer.rb
67
109
  - lib/file/tail/version.rb
68
110
  files:
111
+ - ".all_images.yml"
69
112
  - ".gitignore"
70
113
  - ".travis.yml"
71
- - CHANGES
114
+ - CHANGES.md
72
115
  - COPYING
73
116
  - Gemfile
74
- - README.rdoc
117
+ - README.md
75
118
  - Rakefile
76
119
  - VERSION
77
120
  - bin/rtail
@@ -90,14 +133,14 @@ files:
90
133
  - tests/test_helper.rb
91
134
  homepage: http://github.com/flori/file-tail
92
135
  licenses:
93
- - GPL-2.0
136
+ - Apache-2.0
94
137
  metadata: {}
95
- post_install_message:
138
+ post_install_message:
96
139
  rdoc_options:
97
140
  - "--title"
98
141
  - File-tail - File::Tail for Ruby
99
142
  - "--main"
100
- - README.rdoc
143
+ - README.md
101
144
  require_paths:
102
145
  - lib
103
146
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -111,9 +154,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
154
  - !ruby/object:Gem::Version
112
155
  version: '0'
113
156
  requirements: []
114
- rubyforge_project:
115
- rubygems_version: 2.6.3
116
- signing_key:
157
+ rubygems_version: 3.5.18
158
+ signing_key:
117
159
  specification_version: 4
118
160
  summary: File::Tail for Ruby
119
161
  test_files:
data/CHANGES DELETED
@@ -1,80 +0,0 @@
1
- 2014-09-26 * 1.1.0 * Depend on tins ~ 1.0
2
- 2012-05-31 * 1.0.10 * Use rewind to force IO#lineno to be reset.
3
- 2012-05-31 * 1.0.9 * Reopen file in :top mode at the beginning.
4
- 2011-12-24 * 1.0.8 * Support simplecov.
5
- 2011-07-15 * 1.0.7 * Use gem_hadar to shorten Rakefile.
6
- 2011-06-25 * 1.0.6 * Create a gem spec file again.
7
- * Added a File::Tail::Group to tail multiple files more easily.
8
- 2010-03-25 * 1.0.5 * Added rtail executable, a nice app to supervise logfiles
9
- and logdirs.
10
- * Disabled creation of gem spec file.
11
- * Cleaned up documentation a bit.
12
- 2009-08-21 * 1.0.4 * Fixed the threaded tests for Ruby 1.9.
13
- * Create a gem spec file.
14
- * Some cleanup.
15
- 2008-04-07 * 1.0.3 * Danny Colligan <danny.colligan@sendori.com> reported a
16
- memory leak in long running scripts using file-tail. I
17
- think this might be a ruby related problem, which is
18
- caused/aggravated by using yield after having &block
19
- parameter in a method. I changed file-tail to only use
20
- block.call, which seems to improve the memory behaviour. I
21
- am still not sure, where the problem actually stems
22
- from, though.
23
- 2007-04-19 * 1.0.2 * make_doc.rb was missing from the source archive. Thanks to
24
- Rick Ohnemus <rick.ohnemus@systemware.com> for reporting it.
25
- 2007-04-19 * 1.0.1 * Bugfix: File::Tail::Logfile#open with block, now closes
26
- the file like File#open does. Found by Alex Doan
27
- <alex.doan@wachovia.com>, ruby-talk:248383.
28
- 2007-03-30 * 1.0.0 * Bugfix: David.Barzilay@swisscom.com reported, that file
29
- tails may skip some log file lines, after rotating it. I
30
- think, that I fixed that problem.
31
- I added a after_reopen callback as well, that is called
32
- after reopening of the tailed file has occured.
33
- * Removed rewind/wind methods even earlier than planned: I
34
- placed the deprecation warning for rewind method in File
35
- instead of File::Tail, which caused rewind to stop working
36
- completely after loading file/tail. Duh! I blame vim's
37
- matchit, because it jumped to the wrong end keyword.
38
- 2007-02-08 * 0.1.4 * Renamed rewind method to backward, and wind method to
39
- forward, because someone already had the good idea to name
40
- a method IO#rewind, which was overwritten by the mixed in
41
- File::Tail methods. The old methods are now deprecated and
42
- will be removed in a new 0.2.x version of the library.
43
- * Added a bit more of documentation.
44
- 2005-08-20 * 0.1.3 * Applied LOAD_PATH patch by Daniel Berger, binary mode
45
- changes were already in the CVS. Seemed to be like cheating
46
- to me, though. ;)
47
- * Skipping one windows test for the moment, too. Sigh!
48
- 2004-09-30 * 0.1.2 * First Rubyforge release
49
- * Added Rakefile
50
- * Supports gem build now.
51
- 2004-09-01 * 0.1.1 * Josh Endries <josh@endries.org> found a bug
52
- that caused File::Tail to malfunction on FreeBSD.
53
- Hotfix: Use a side effect of seek to clearerr the tailed
54
- file handle after EOFError has been raised.
55
- 2004-04-13 * 0.1.0 * API documentation with rdoc.
56
- * return_if_eof attribute added.
57
- * Added array return mode for finite tail call without block
58
- given.
59
- * install.rb now uses ruby version site_dir.
60
- * Some code and directory structure cleanup.
61
- 2002-08-02 * 0.0.2 * Heavy refactoring, more and smaller methods
62
- and expception handling
63
- * Added check for inode and device equality of files
64
- as suggested by
65
- James F.Hranicky <jfh@cise.ufl.edu> and
66
- Curt Sampson <cjs@cynic.net> to cover remove
67
- rotation
68
- * If filesize shrinks suddenly, File::Tail assumes that
69
- copy and truncate rotation has happend: The file
70
- is reopened and every new line is handled.
71
- * NFS-Fix: Errno::ESTALE is caught.
72
- * wind added to skip the first n lines, as
73
- James F.Hranicky's suggested and changed
74
- name of last-method to rewind, because I liked
75
- his method names better than mine ;)
76
- * Renamed next to tail either.
77
- * The API has changed - but I think very few people
78
- care at the moment.
79
- * Lots of tests added.
80
- 2002-07-30 * 0.0.1 * Initial Release