logtwuncator 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.txt CHANGED
@@ -67,7 +67,7 @@ For help
67
67
 
68
68
  To install service:
69
69
 
70
- log_truncator_service install -N log_twuncator -c c:/twuncator_config.yml -d 1 -l c:/log_twuncator.log
70
+ log_twuncator_service install -N log_twuncator -c c:/twuncator_config.yml -d 1 -l c:/log_twuncator.log
71
71
 
72
72
  where:
73
73
  -N : is the name of the service to install
@@ -77,13 +77,13 @@ To install service:
77
77
 
78
78
  To remove service
79
79
 
80
- log_truncator_service remove -N log_twuncator
80
+ log_twuncator_service remove -N log_twuncator
81
81
 
82
82
  To start/stop service
83
83
 
84
- log_truncator_service start -N log_twuncator
84
+ log_twuncator_service start -N log_twuncator
85
85
 
86
- log_truncator_service stop -N log_twuncator
86
+ log_twuncator_service stop -N log_twuncator
87
87
 
88
88
  And remember kids the service creation does not set the startup-type to 'Automatic',
89
89
  so if you it want it to start with every windows startup then change this setting in
data/Rakefile CHANGED
@@ -11,7 +11,7 @@ Hoe.new('logtwuncator', LogTwuncator::VERSION) do |p|
11
11
  p.summary = 'A win32 log file truncator and archiver with windows service'
12
12
  p.description = 'A win32 log file truncator and archiver with windows service'
13
13
  p.url = 'http://rubygems.org/gems/logtwuncator'
14
- p.extra_deps << ['win32-service', '~> 0.5']
14
+ p.extra_deps << ['win32-service', '~> 0.7.2']
15
15
  end
16
16
 
17
17
  # vim: syntax=Ruby
@@ -6,8 +6,7 @@ module LogTwuncator
6
6
  attr_reader :command, :options
7
7
 
8
8
  def initialize
9
- @options = {}
10
- @options[:delay] = 5
9
+ @options = { :delay => 5}
11
10
  end
12
11
 
13
12
  def run(args)
@@ -80,35 +79,33 @@ module LogTwuncator
80
79
  class Service
81
80
 
82
81
  def install
83
- svc = Win32::Service.new
84
82
  if Win32::Service.exists?(@options[:name])
85
83
  puts "Service name '#{@options[:name]}' already exists."
86
84
  return
87
85
  end
88
86
 
89
- svc.create_service do |s|
90
- s.service_name = @options[:name]
91
- s.display_name = @options[:name]
92
- s.binary_path_name = binary_path_name
93
- end
87
+ Win32::Service.new({
88
+ :service_name => @options[:name],
89
+ :display_name => @options[:name],
90
+ :binary_path_name => binary_path_name
91
+ })
94
92
 
95
- svc.close
96
93
  puts "Log Twuncator service '#{@options[:name]}' installed."
97
- rescue Win32::ServiceError => e
94
+ rescue Win32::Service::Error => e
98
95
  puts "Service '#{@options[:name]}' failed to install due to error: #{e.message}"
99
96
  end
100
97
 
101
98
  def start
102
99
  Win32::Service.start(@options[:name])
103
100
  puts "'#{@options[:name]}' service started."
104
- rescue Win32::ServiceError => e
101
+ rescue Win32::Service::Error => e
105
102
  puts "Service '#{@options[:name]}' failed to start due to error: #{e.message}"
106
103
  end
107
104
 
108
105
  def stop
109
106
  Win32::Service.stop(@options[:name])
110
107
  puts "'#{@options[:name]}' service stopped."
111
- rescue Win32::ServiceError => e
108
+ rescue Win32::Service::Error => e
112
109
  puts "Service '#{@options[:name]}' failed to stop due to error: #{e.message}"
113
110
  end
114
111
 
@@ -120,7 +117,7 @@ module LogTwuncator
120
117
 
121
118
  Win32::Service.delete(@options[:name])
122
119
  puts "'#{@options[:name]}' service removed."
123
- rescue Win32::ServiceError => e
120
+ rescue Win32::Service::Error => e
124
121
  puts "Service '#{@options[:name]}' failed to be removed due to error: #{e.message}"
125
122
  end
126
123
 
data/lib/log_twuncator.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class LogTwuncator
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.5'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logtwuncator
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 4
10
- version: 0.1.4
9
+ - 5
10
+ version: 0.1.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Adam Meehan
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-12-29 00:00:00 +11:00
18
+ date: 2011-12-31 00:00:00 +11:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -26,11 +26,12 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- hash: 1
29
+ hash: 7
30
30
  segments:
31
31
  - 0
32
- - 5
33
- version: "0.5"
32
+ - 7
33
+ - 2
34
+ version: 0.7.2
34
35
  prerelease: false
35
36
  requirement: *id001
36
37
  - !ruby/object:Gem::Dependency