file-tail 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +4 -0
- data/Rakefile +42 -37
- data/VERSION +1 -1
- data/tests/test.rb +15 -7
- metadata +14 -13
data/CHANGES
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
2005-08-20 * 0.1.3 * Applied LOAD_PATH patch by Daniel Berger, binary mode
|
2
|
+
changes were already in the CVS. Seemed to be like cheating
|
3
|
+
to me, though. ;)
|
4
|
+
* Skipping one windows test for the moment, too. Sigh!
|
1
5
|
2004-09-30 * 0.1.2 * First Rubyforge release
|
2
6
|
* Added Rakefile
|
3
7
|
* Supports gem build now.
|
data/Rakefile
CHANGED
@@ -8,65 +8,70 @@ include Config
|
|
8
8
|
PKG_NAME = 'file-tail'
|
9
9
|
PKG_VERSION = File.read('VERSION').chomp
|
10
10
|
PKG_FILES = Dir.glob("**/*").delete_if { |item|
|
11
|
-
|
11
|
+
item.include?("CVS") or item.include?("pkg")
|
12
12
|
}
|
13
13
|
|
14
14
|
desc "Installing library"
|
15
15
|
task :install do
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
libdir = CONFIG["sitelibdir"]
|
17
|
+
dest = File.join(libdir, 'file')
|
18
|
+
install('lib/file/tail.rb', dest)
|
19
|
+
end
|
20
|
+
|
21
|
+
desc "Testing library"
|
22
|
+
task :test do
|
23
|
+
ruby %{-Ilib tests/test.rb}
|
19
24
|
end
|
20
25
|
|
21
26
|
spec = Gem::Specification.new do |s|
|
22
27
|
|
23
|
-
|
28
|
+
#### Basic information.
|
24
29
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
30
|
+
s.name = 'file-tail'
|
31
|
+
s.version = PKG_VERSION
|
32
|
+
s.summary = "File::Tail for Ruby"
|
33
|
+
s.description = ""
|
29
34
|
|
30
|
-
|
35
|
+
#### Dependencies and requirements.
|
31
36
|
|
32
|
-
|
33
|
-
|
37
|
+
#s.add_dependency('log4r', '> 1.0.4')
|
38
|
+
#s.requirements << ""
|
34
39
|
|
35
|
-
|
40
|
+
s.files = PKG_FILES
|
36
41
|
|
37
|
-
|
42
|
+
#### C code extensions.
|
38
43
|
|
39
|
-
|
44
|
+
#s.extensions << "ext/extconf.rb"
|
40
45
|
|
41
|
-
|
46
|
+
#### Load-time details: library and application (you will need one or both).
|
42
47
|
|
43
|
-
|
44
|
-
|
48
|
+
s.require_path = 'lib' # Use these for libraries.
|
49
|
+
s.autorequire = 'file/tail'
|
45
50
|
|
46
|
-
|
47
|
-
|
48
|
-
|
51
|
+
#s.bindir = "bin" # Use these for applications.
|
52
|
+
#s.executables = ["bla.rb"]
|
53
|
+
#s.default_executable = "bla.rb"
|
49
54
|
|
50
|
-
|
55
|
+
#### Documentation and testing.
|
51
56
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
57
|
+
s.has_rdoc = true
|
58
|
+
#s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a
|
59
|
+
#s.rdoc_options <<
|
60
|
+
# '--title' << 'Rake -- Ruby Make' <<
|
61
|
+
# '--main' << 'README' <<
|
62
|
+
# '--line-numbers'
|
63
|
+
s.test_files << 'tests/test.rb'
|
59
64
|
|
60
|
-
|
65
|
+
#### Author and project details.
|
61
66
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
67
|
+
s.author = "Florian Frank"
|
68
|
+
s.email = "flori@ping.de"
|
69
|
+
s.homepage = "http://file-tail.rubyforge.org"
|
70
|
+
s.rubyforge_project = "file-tail"
|
66
71
|
end
|
67
72
|
|
68
73
|
Rake::GemPackageTask.new(spec) do |pkg|
|
69
|
-
|
70
|
-
|
74
|
+
pkg.need_tar = true
|
75
|
+
pkg.package_files += PKG_FILES
|
71
76
|
end
|
72
|
-
|
77
|
+
# vim: set et sw=2 ts=2:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/tests/test.rb
CHANGED
@@ -1,19 +1,26 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
base = File.basename(Dir.pwd)
|
4
|
+
if base == 'tests' || base =~ /file-tail/
|
5
|
+
Dir.chdir('..') if base == 'tests'
|
6
|
+
$LOAD_PATH.unshift(File.join(Dir.pwd, 'lib'))
|
7
|
+
end
|
8
|
+
|
3
9
|
require 'test/unit'
|
4
10
|
require 'file/tail'
|
5
11
|
require 'tempfile'
|
6
12
|
require 'timeout'
|
7
13
|
require 'thread'
|
14
|
+
Thread.abort_on_exception = true
|
8
15
|
|
9
16
|
class TC_FileTail < Test::Unit::TestCase
|
10
17
|
|
11
18
|
include File::Tail
|
12
19
|
|
13
20
|
def setup
|
14
|
-
@out =
|
21
|
+
@out = File.new("test.#$$", "wb")
|
15
22
|
append(@out, 100)
|
16
|
-
@in = File.new(@out.path)
|
23
|
+
@in = File.new(@out.path, "rb")
|
17
24
|
@in.extend(File::Tail)
|
18
25
|
@in.interval = 0.4
|
19
26
|
@in.max_interval = 0.8
|
@@ -123,7 +130,6 @@ class TC_FileTail < Test::Unit::TestCase
|
|
123
130
|
timeout(1) { lines += @in.tail(2) }
|
124
131
|
end
|
125
132
|
assert_equal(0, lines.size)
|
126
|
-
#
|
127
133
|
end
|
128
134
|
end
|
129
135
|
|
@@ -150,7 +156,7 @@ class TC_FileTail < Test::Unit::TestCase
|
|
150
156
|
Thread.stop
|
151
157
|
@out.close
|
152
158
|
File.truncate(@out.path, 0)
|
153
|
-
@out = File.new(@in.path, "
|
159
|
+
@out = File.new(@in.path, "ab")
|
154
160
|
append(@out, 10)
|
155
161
|
end
|
156
162
|
threads << Thread.new do
|
@@ -169,14 +175,15 @@ class TC_FileTail < Test::Unit::TestCase
|
|
169
175
|
end
|
170
176
|
|
171
177
|
def test_tail_remove
|
178
|
+
return if File::PATH_SEPARATOR == ';' # Grmpf! Windows...
|
172
179
|
@in.rewind
|
173
180
|
lines = []
|
174
181
|
threads = []
|
175
182
|
threads << appender = Thread.new do
|
176
183
|
Thread.stop
|
177
184
|
@out.close
|
178
|
-
File.unlink(@
|
179
|
-
@out = File.new(@in.path, "
|
185
|
+
File.unlink(@out.path)
|
186
|
+
@out = File.new(@in.path, "wb")
|
180
187
|
append(@out, 10)
|
181
188
|
end
|
182
189
|
threads << Thread.new do
|
@@ -194,9 +201,10 @@ class TC_FileTail < Test::Unit::TestCase
|
|
194
201
|
assert_equal(10, lines.size)
|
195
202
|
end
|
196
203
|
|
197
|
-
def
|
204
|
+
def teardown
|
198
205
|
@in.close
|
199
206
|
@out.close
|
207
|
+
File.unlink(@out.path)
|
200
208
|
end
|
201
209
|
|
202
210
|
private
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.8.
|
2
|
+
rubygems_version: 0.8.10
|
3
3
|
specification_version: 1
|
4
4
|
name: file-tail
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.1.
|
7
|
-
date:
|
6
|
+
version: 0.1.3
|
7
|
+
date: 2005-08-20
|
8
8
|
summary: File::Tail for Ruby
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
|
-
author: Florian Frank
|
12
11
|
email: flori@ping.de
|
13
12
|
homepage: http://file-tail.rubyforge.org
|
14
13
|
rubyforge_project: file-tail
|
@@ -25,22 +24,24 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
|
|
25
24
|
version: 0.0.0
|
26
25
|
version:
|
27
26
|
platform: ruby
|
27
|
+
authors:
|
28
|
+
- Florian Frank
|
28
29
|
files:
|
29
|
-
- README.en
|
30
|
-
- CHANGES
|
31
|
-
- GPL
|
32
30
|
- examples
|
31
|
+
- examples/tail.rb
|
32
|
+
- examples/pager.rb
|
33
|
+
- install.rb
|
34
|
+
- GPL
|
33
35
|
- Rakefile
|
34
36
|
- VERSION
|
35
|
-
- install.rb
|
36
|
-
- make_doc.rb
|
37
|
-
- lib
|
38
37
|
- tests
|
39
|
-
-
|
40
|
-
-
|
38
|
+
- tests/test.rb
|
39
|
+
- CHANGES
|
40
|
+
- lib
|
41
41
|
- lib/file
|
42
42
|
- lib/file/tail.rb
|
43
|
-
-
|
43
|
+
- make_doc.rb
|
44
|
+
- README.en
|
44
45
|
test_files:
|
45
46
|
- tests/test.rb
|
46
47
|
rdoc_options: []
|