birling 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
data/birling.gemspec ADDED
@@ -0,0 +1,57 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "birling"
8
+ s.version = "0.1.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Scott Tadman"]
12
+ s.date = "2012-11-08"
13
+ s.description = "Mostly drop-in replacement for Logger with a more robust log rotation facility"
14
+ s.email = "github@tadman.ca"
15
+ s.extra_rdoc_files = [
16
+ "LICENSE.txt",
17
+ "README.md"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ "Gemfile",
22
+ "LICENSE.txt",
23
+ "README.md",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "birling.gemspec",
27
+ "lib/birling.rb",
28
+ "lib/birling/formatter.rb",
29
+ "lib/birling/logger.rb",
30
+ "lib/birling/support.rb",
31
+ "test/helper.rb",
32
+ "test/test_birling.rb",
33
+ "test/test_birling_logger.rb",
34
+ "test/test_birling_support.rb"
35
+ ]
36
+ s.homepage = "http://github.com/twg/birling"
37
+ s.licenses = ["MIT"]
38
+ s.require_paths = ["lib"]
39
+ s.rubygems_version = "1.8.24"
40
+ s.summary = "Logger with simple log rotation system"
41
+
42
+ if s.respond_to? :specification_version then
43
+ s.specification_version = 3
44
+
45
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
46
+ s.add_development_dependency(%q<bundler>, [">= 0"])
47
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
48
+ else
49
+ s.add_dependency(%q<bundler>, [">= 0"])
50
+ s.add_dependency(%q<jeweler>, [">= 0"])
51
+ end
52
+ else
53
+ s.add_dependency(%q<bundler>, [">= 0"])
54
+ s.add_dependency(%q<jeweler>, [">= 0"])
55
+ end
56
+ end
57
+
@@ -244,7 +244,10 @@ protected
244
244
 
245
245
  if (File.exist?(@path) and File.symlink?(@path))
246
246
  File.unlink(@path)
247
- File.symlink(@path, @current_path)
247
+ end
248
+
249
+ unless (File.exist?(@path))
250
+ File.symlink(@current_path, @path)
248
251
  end
249
252
 
250
253
  self.prune_logs!
@@ -188,6 +188,9 @@ class TestBirlingLogger < Test::Unit::TestCase
188
188
  :period => 1,
189
189
  :retain_period => retain_period
190
190
  )
191
+
192
+ assert_equal true, File.exist?(path)
193
+ assert_equal true, File.symlink?(path)
191
194
 
192
195
  finish = Time.now + retain_period + 5
193
196
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: birling
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -58,9 +58,9 @@ files:
58
58
  - README.md
59
59
  - Rakefile
60
60
  - VERSION
61
+ - birling.gemspec
61
62
  - lib/birling.rb
62
63
  - lib/birling/formatter.rb
63
- - lib/birling/log.rb
64
64
  - lib/birling/logger.rb
65
65
  - lib/birling/support.rb
66
66
  - test/helper.rb
data/lib/birling/log.rb DELETED
@@ -1,34 +0,0 @@
1
- class Birling::Log < File
2
- # == Constants ============================================================
3
-
4
- # == Class Methods ========================================================
5
-
6
- def self.open(log, mode = nil)
7
- case (log)
8
- when IO
9
- yield(log) if (block_given?)
10
-
11
- log
12
- when String
13
- io = new(log, mode || 'a')
14
-
15
- yield(io) if (block_given?)
16
-
17
- io
18
- end
19
- end
20
-
21
- # == Instance Methods =====================================================
22
-
23
- def size
24
- self.stat.size
25
- end
26
-
27
- def create_time
28
- self.stat.ctime
29
- end
30
-
31
- def age(relative_to = nil)
32
- (relative_to || Time.now) - self.stat.ctime
33
- end
34
- end