TwP-logging 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 1.1.1 / 2009-04-30
2
+
3
+ 1 minor enhancement
4
+ - Added a 'filename' method to the file appenders
5
+
1
6
  == 1.1.0 / 2009-04-21
2
7
 
3
8
  3 minor enhancements
@@ -48,6 +48,10 @@ module Logging::Appenders
48
48
  super(name, ::File.new(@fn, mode), opts)
49
49
  end
50
50
 
51
+ # Returns the path to the logfile.
52
+ #
53
+ def filename() @fn.dup end
54
+
51
55
  end # class FileAppender
52
56
  end # module Logging::Appenders
53
57
 
@@ -139,6 +139,10 @@ module Logging::Appenders
139
139
  super(name, open_logfile, opts)
140
140
  end
141
141
 
142
+ # Returns the path to the logfile.
143
+ #
144
+ def filename() @fn.dup end
145
+
142
146
 
143
147
  private
144
148
 
data/lib/logging.rb CHANGED
@@ -30,7 +30,7 @@ begin require 'fastthread'; rescue LoadError; end
30
30
  module Logging
31
31
 
32
32
  # :stopdoc:
33
- VERSION = '1.1.0'
33
+ VERSION = '1.1.1'
34
34
  LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
35
35
  PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
36
36
  WIN32 = %r/djgpp|(cyg|ms|bcc)win|mingw/ =~ RUBY_PLATFORM
@@ -43,6 +43,7 @@ module TestAppenders
43
43
  log = File.join(TMP, 'file.log')
44
44
  appender = Logging.appenders.file(NAME, 'filename' => log)
45
45
  assert_equal 'logfile', appender.name
46
+ assert_equal log, appender.filename
46
47
  appender << "This will be the first line\n"
47
48
  appender << "This will be the second line\n"
48
49
  appender.flush
@@ -55,6 +56,7 @@ module TestAppenders
55
56
 
56
57
  appender = Logging.appenders.file(NAME, :filename => log)
57
58
  assert_equal 'logfile', appender.name
59
+ assert_equal log, appender.filename
58
60
  appender << "This will be the third line\n"
59
61
  appender.flush
60
62
  File.open(log, 'r') do |file|
@@ -23,6 +23,7 @@ module TestAppenders
23
23
 
24
24
  # create a new appender
25
25
  ap = Logging.appenders.rolling_file(NAME, :filename => @fn)
26
+ assert_equal @fn, ap.filename
26
27
  assert File.exist?(@fn)
27
28
  assert_equal 0, File.size(@fn)
28
29
 
@@ -33,6 +34,7 @@ module TestAppenders
33
34
 
34
35
  # make sure we append to the current file (not truncate)
35
36
  ap = Logging.appenders.rolling_file(NAME, :filename => @fn)
37
+ assert_equal @fn, ap.filename
36
38
  assert_equal [@fn], Dir.glob(@glob)
37
39
  assert_equal 20, File.size(@fn)
38
40
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: TwP-logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Pease
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-21 00:00:00 -07:00
12
+ date: 2009-04-30 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency