logtwuncator 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ == 0.1.1 / 2007-10-24
2
+
3
+ * Some minor documentation updates
4
+ * A little refactoring
5
+
6
+
1
7
  == 0.1.0 / 2007-10-10
2
8
 
3
9
  * Its twuncating season!
data/README.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  log_twuncator
2
2
  by Adam Meehan (adam.meehan@gmail.com)
3
- http://log_twuncator
3
+ http://logtwuncator.rubyforge.org/
4
4
 
5
5
  == DESCRIPTION:
6
6
 
@@ -30,7 +30,7 @@ Credits:
30
30
  Herryanto Siatono (http://www.pluitsolutions.com/) for his
31
31
  win32 Ferret service which I based some of the service structure on.
32
32
 
33
- pdumpfs project (http://0xcc.net/pdumpfs/index.html.en) where I learned
33
+ pdumpfs project (http://0xcc.net/pdumpfs/index.html.en) where I found
34
34
  the win32 API stuff in Ruby to do the file creation date changes.
35
35
 
36
36
 
@@ -53,8 +53,9 @@ the win32 API stuff in Ruby to do the file creation date changes.
53
53
  win32-service gem required to run as service
54
54
 
55
55
  == INSTALL:
56
+ I messed up the naming of the gem when creating on rubyforge forgive me. So the gem is call logtwuncator but executables are log_twuncator_*
56
57
 
57
- gem install log_twuncator
58
+ gem install logtwuncator
58
59
 
59
60
  == USAGE:
60
61
 
@@ -14,11 +14,15 @@ module LogTwuncator
14
14
 
15
15
  TIMESTAMP_FORMAT = "%Y%m%d%H%M%S"
16
16
 
17
- attr_reader :name, :age, :size, :source_dir, :filter, :archive_dir, :archive_name, :logger
17
+ ATTRIBUTES = [:name, :age, :size, :source_dir, :filter, :archive_dir, :archive_name, :logger]
18
+
19
+ ATTRIBUTES.each {|attrib| attr_reader attrib}
18
20
 
19
21
  def initialize(options)
20
22
  @options = @@defaults.merge(options)
21
- [:name, :age, :size, :source_dir, :filter, :archive_dir, :archive_name, :logger].each {|sym| instance_variable_set("@#{sym}".to_sym, @options[sym]) }
23
+ ATTRIBUTES.each {|sym|
24
+ instance_variable_set("@#{sym}".to_sym, @options[sym])
25
+ }
22
26
  if errors = self.class.validate_options(@options)
23
27
  raise InvalidTruncatorOptions, errors.join("\n")
24
28
  end
@@ -1,6 +1,6 @@
1
1
  require 'Win32API'
2
2
 
3
- # This code has been mostly taken from pdumpfs project http://raa.ruby-lang.org/project/pdumpfs/
3
+ # This code has adapted from pdumpfs project http://raa.ruby-lang.org/project/pdumpfs/
4
4
  # Uses the Win32API to do win32 system calls to change file dates
5
5
  module LogTwuncator
6
6
  class Win32File
@@ -8,8 +8,7 @@ module LogTwuncator
8
8
  GENERIC_EXECUTE = 0x20000000
9
9
  GENERIC_ALL = 0x10000000
10
10
  FILE_SHARE_WRITE = 2
11
- OPEN_EXISTING = 3
12
- FILE_FLAG_BACKUP_SEMANTICS = 0x02000000
11
+ OPEN_EXISTING = 3
13
12
 
14
13
  GetLocaltime = Win32API.new("kernel32", "GetLocalTime", "P", 'V')
15
14
  SystemTimeToFileTime = Win32API.new("kernel32", "SystemTimeToFileTime", "PP", 'I')
data/lib/log_twuncator.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class LogTwuncator
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: logtwuncator
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.0
7
- date: 2007-10-17 00:00:00 +10:00
6
+ version: 0.1.1
7
+ date: 2007-10-24 00:00:00 +10:00
8
8
  summary: A win32 log file truncator and archiver with windows service
9
9
  require_paths:
10
10
  - lib