raad 0.4.1 → 0.5.0
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/CHANGELOG.md +9 -2
- data/README.md +100 -13
- data/lib/raad/bootstrap.rb +2 -5
- data/lib/raad/env.rb +9 -1
- data/lib/raad/logger.rb +0 -2
- data/lib/raad/runner.rb +74 -64
- data/lib/raad/version.rb +1 -1
- metadata +10 -10
data/CHANGELOG.md
CHANGED
@@ -14,6 +14,13 @@
|
|
14
14
|
- tested on MRI 1.8.7 & 1.9.2, REE 1.8.7, JRuby 1.6.4 under OSX 10.6.8 and Linux Ubuntu 10.04
|
15
15
|
|
16
16
|
# 0.4.1, 09-22-2011
|
17
|
-
- allow arbitrary environment name
|
17
|
+
- issue #1, allow arbitrary environment name, https://github.com/praized/raad/issues/1
|
18
|
+
- issue #3, avoid calling stop multiple times, https://github.com/praized/raad/issues/3
|
18
19
|
- added Raad.stopped?
|
19
|
-
|
20
|
+
|
21
|
+
# 0.5.0, 10-12-2011
|
22
|
+
- issue #4, allow logger usage in service initialize method, https://github.com/praized/raad/issues/4
|
23
|
+
- issue #7, Raad.env not correct in service.initialize, https://github.com/praized/raad/issues/7
|
24
|
+
- refactored Runner initialize/run/start_service methods
|
25
|
+
- custom options now uses options_parser class method in the service
|
26
|
+
- added examples/custom_options.rb
|
data/README.md
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
# Raad v0.
|
2
|
-
|
1
|
+
# Raad v0.5.0
|
3
2
|
Raad - Ruby as a daemon lightweight service wrapper.
|
4
3
|
|
5
4
|
Raad is a non-intrusive, lightweight, simple Ruby daemon wrapper. Basically any class which implements
|
@@ -14,22 +13,20 @@ logging module and benefit easy log file output while daemonized.
|
|
14
13
|
## Installation
|
15
14
|
|
16
15
|
### Gem
|
17
|
-
|
18
16
|
``` sh
|
19
17
|
$ gem install raad
|
20
18
|
```
|
21
19
|
|
22
20
|
### Bundler
|
23
|
-
#### Latest from github
|
24
21
|
|
22
|
+
#### Latest from github
|
25
23
|
``` sh
|
26
24
|
gem "raad", :git => "git://github.com/praized/raad.git", :branch => "master"
|
27
25
|
```
|
28
26
|
|
29
27
|
#### Released gem
|
30
|
-
|
31
28
|
``` bash
|
32
|
-
gem "raad", "~> 0.
|
29
|
+
gem "raad", "~> 0.5.0"
|
33
30
|
```
|
34
31
|
|
35
32
|
## Example
|
@@ -42,14 +39,15 @@ require 'raad'
|
|
42
39
|
|
43
40
|
class SimpleDaemon
|
44
41
|
def start
|
42
|
+
Raad::Logger.debug("SimpleDaemon start")
|
45
43
|
while !Raad.stopped?
|
46
|
-
Raad::Logger.info("
|
44
|
+
Raad::Logger.info("SimpleDaemon running")
|
47
45
|
sleep(1)
|
48
46
|
end
|
49
47
|
end
|
50
48
|
|
51
49
|
def stop
|
52
|
-
Raad::Logger.
|
50
|
+
Raad::Logger.debug("SimpleDaemon stop")
|
53
51
|
end
|
54
52
|
end
|
55
53
|
```
|
@@ -87,7 +85,7 @@ There are two ways to know when your service has been instructed to stop:
|
|
87
85
|
|
88
86
|
There are basically 3 ways to run execute your service:
|
89
87
|
|
90
|
-
* start it in foreground console mode, useful for debugging, `^C` to
|
88
|
+
* start it in foreground console mode, useful for debugging, `^C` to trigger the stop sequence
|
91
89
|
|
92
90
|
``` sh
|
93
91
|
$ ruby your_service.rb start
|
@@ -134,14 +132,103 @@ Raad has been tested on MRI 1.8.7, MRI 1.9.2, REE 1.8.7, JRuby 1.6.4 under OSX 1
|
|
134
132
|
-h, --help display help message
|
135
133
|
|
136
134
|
Note that the command line options will always override any config file settings if present.
|
137
|
-
### Configuration and options
|
138
|
-
tbd.
|
139
135
|
|
140
|
-
|
136
|
+
#### -e, --environment NAME
|
137
|
+
Raad provides a way to pass an **arbritary** environment name on the command line. This environment name can later be retrieved in your code using the following methods:
|
138
|
+
|
139
|
+
* `Raad.env` will return the **symbolized** environment name passed on the command line.
|
140
|
+
* `Raad.test?` will return `true` if the enviroment name passed on the command line was `test`.
|
141
|
+
* `Raad.development?` will return `true` if the enviroment name passed on the command line was `development` or `dev`.
|
142
|
+
* `Raad.stage?` will return `true` if the enviroment name passed on the command line was `stage` or `staging`.
|
143
|
+
* `Raad.production?` will return `true` if the enviroment name passed on the command line was `production` or `prod`.
|
144
|
+
|
145
|
+
Example:
|
146
|
+
|
147
|
+
``` sh
|
148
|
+
$ ruby your_service.rb -e foobar start
|
149
|
+
```
|
150
|
+
|
151
|
+
``` ruby
|
152
|
+
if Raad.env == :foobar
|
153
|
+
# do foobar stuff
|
154
|
+
end
|
155
|
+
|
156
|
+
if Raad.production?
|
157
|
+
# never get here
|
158
|
+
end
|
159
|
+
```
|
160
|
+
|
161
|
+
### Custom command line options
|
162
|
+
It is possible to add **custom** command line options to your service, in addition to Raad own command line options. To handle custom command line options simply define a `self.options_parser` **class method** in your service class. This method will be passed a [OptionParser](http://apidock.com/ruby/OptionParser) object into which you can add your rules plus also a Hash to set the parsed options values. The OptionParser object must be returned.
|
163
|
+
|
164
|
+
Check complete example file [examples/custom_options.rb](https://github.com/praized/raad/blob/master/examples/custom_options.rb)
|
165
|
+
|
166
|
+
Example:
|
167
|
+
|
168
|
+
``` ruby
|
169
|
+
# options_parser must be a class method
|
170
|
+
#
|
171
|
+
# @param raad_parser [OptionParser] raad options parser to which custom options rules can be added
|
172
|
+
# @param parsed_options [Hash] set parsing results into this hash. retrieve it later in your code using Raad.custom_options
|
173
|
+
# @return [OptionParser] the modified options parser must be returned
|
174
|
+
def self.options_parser(raad_parser, parsed_options)
|
175
|
+
raad_parser.separator "Your service options:"
|
176
|
+
|
177
|
+
raad_parser.on('-a', '--aoption PARAM', "some a option parameter") { |val| parsed_options[:aoption] = val }
|
178
|
+
raad_parser.on('-b', '--boption PARAM', "some b option parameter") { |val| parsed_options[:boption] = val }
|
179
|
+
|
180
|
+
raad_parser
|
181
|
+
end
|
182
|
+
```
|
183
|
+
|
184
|
+
The parsed options values can later be retrieved in your code using `Raad.custom_options` which will hold the Hash as set in your `options_parser` class method.
|
185
|
+
|
186
|
+
``` ruby
|
187
|
+
do_this if Raad.custom_options[:aoption] == 'a option parameter value'
|
188
|
+
```
|
189
|
+
|
190
|
+
``` sh
|
191
|
+
$ ruby your_service.rb -h
|
192
|
+
|
193
|
+
usage: ruby <service>.rb [options] start|stop
|
194
|
+
|
195
|
+
Raad common options:
|
196
|
+
-e, --environment NAME set the execution environment (default: development)
|
197
|
+
-l, --log FILE log to file (default: in console mode: no, daemonized: <service>.log)
|
198
|
+
-s, --stdout log to stdout (default: in console mode: true, daemonized: false)
|
199
|
+
-v, --verbose enable verbose logging (default: false)
|
200
|
+
--pattern PATTERN log4r log formatter pattern
|
201
|
+
-c, --config FILE config file (default: ./config/<service>.rb)
|
202
|
+
-d, --daemonize run daemonized in the background (default: false)
|
203
|
+
-P, --pid FILE pid file when daemonized (default: <service>.pid)
|
204
|
+
-r, --redirect FILE redirect stdout to FILE when daemonized (default: no)
|
205
|
+
-n, --name NAME daemon process name (default: <service>)
|
206
|
+
--timeout SECONDS seconds to wait before force stopping the service (default: 60)
|
207
|
+
-h, --help display help message
|
208
|
+
|
209
|
+
Your service options:
|
210
|
+
-a, --aoption PARAM some a option parameter
|
211
|
+
-b, --boption PARAM some b option parameter
|
212
|
+
```
|
213
|
+
|
214
|
+
### Configuration and options
|
141
215
|
tbd.
|
142
216
|
|
143
217
|
### Logging
|
144
|
-
|
218
|
+
Raad uses Log4r for logging and provides hooks for logging in your service. Here's an example of how to use Raad logging:
|
219
|
+
|
220
|
+
``` ruby
|
221
|
+
Raad::Logger.debug("this is a message with level DEBUG")
|
222
|
+
Raad::Logger.info("this is a message with level INFO")
|
223
|
+
Raad::Logger.warn("this is a message with level WARN")
|
224
|
+
Raad::Logger.error("this is a message with level ERROR")
|
225
|
+
Raad::Logger.fatal("this is a message with level FATAL")
|
226
|
+
```
|
227
|
+
|
228
|
+
* By default, Raad will output log messages of level `INFO` **and higher**.
|
229
|
+
* If the `-v, --verbose` command line option is used, Raad will output **all** log messages (level `DEBUG` **and higher**).
|
230
|
+
|
231
|
+
Alternatively, the log output level can be set in your service using the `Raad::Logger.level=` method. The valid levels parameter are `:debug`, `:info`, `:warn` and `:error`.
|
145
232
|
|
146
233
|
### Stop sequence details
|
147
234
|
tbd.
|
data/lib/raad/bootstrap.rb
CHANGED
@@ -40,11 +40,8 @@ module Raad
|
|
40
40
|
#
|
41
41
|
# @return [Nil]
|
42
42
|
def self.run!
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
runner = Runner.new(ARGV, service)
|
47
|
-
runner.run
|
43
|
+
service_class = Object.module_eval(camel_case(File.basename(service_file, '.rb')))
|
44
|
+
Runner.new(ARGV, service_class).run
|
48
45
|
end
|
49
46
|
|
50
47
|
private
|
data/lib/raad/env.rb
CHANGED
@@ -4,6 +4,7 @@ require 'thread'
|
|
4
4
|
module Raad
|
5
5
|
|
6
6
|
@env = :development
|
7
|
+
@custom_options = {}
|
7
8
|
@stopped = false
|
8
9
|
@stop_lock = Mutex.new
|
9
10
|
|
@@ -83,6 +84,13 @@ module Raad
|
|
83
84
|
@stop_lock.synchronize{@stopped = !!state}
|
84
85
|
end
|
85
86
|
|
86
|
-
|
87
|
+
# returns the custom options hash set in the service options_parser class method
|
88
|
+
#
|
89
|
+
# @return [Hash] custom options hash
|
90
|
+
def custom_options
|
91
|
+
@custom_options
|
92
|
+
end
|
93
|
+
|
94
|
+
module_function :env, :env=, :production?, :development?, :stage?, :test?, :jruby?, :ruby_path, :stopped?, :stopped=, :custom_options
|
87
95
|
|
88
96
|
end
|
data/lib/raad/logger.rb
CHANGED
@@ -38,7 +38,6 @@ module Raad
|
|
38
38
|
#
|
39
39
|
# @param log [Logger] The logger to add file logging too
|
40
40
|
# @param log_format [Log4r::Formatter] The log format to use
|
41
|
-
# @return [Nil]
|
42
41
|
def setup_file_logger(log, log_format, file)
|
43
42
|
FileUtils.mkdir_p(File.dirname(file))
|
44
43
|
|
@@ -53,7 +52,6 @@ module Raad
|
|
53
52
|
#
|
54
53
|
# @param log [Logger] The logger to add stdout logging too
|
55
54
|
# @param log_format [Log4r::Formatter] The log format to use
|
56
|
-
# @return [Nil]
|
57
55
|
def setup_stdout_logger(log, log_format)
|
58
56
|
@log.add(Log4r::StdoutOutputter.new('console', :formatter => log_format))
|
59
57
|
end
|
data/lib/raad/runner.rb
CHANGED
@@ -9,56 +9,62 @@ module Raad
|
|
9
9
|
SECOND = 1
|
10
10
|
STOP_TIMEOUT = 60 * SECOND
|
11
11
|
|
12
|
-
attr_accessor :
|
12
|
+
attr_accessor :pid_file
|
13
13
|
|
14
14
|
# Create a new Runner
|
15
15
|
#
|
16
16
|
# @param argv [Array] command line arguments
|
17
|
-
# @param
|
18
|
-
def initialize(argv,
|
17
|
+
# @param service_class [Class] service class
|
18
|
+
def initialize(argv, service_class)
|
19
19
|
@argv = argv.dup # lets keep a copy for jruby double-launch
|
20
|
-
|
20
|
+
@service_class = service_class
|
21
|
+
@parsed_options = nil
|
21
22
|
|
22
|
-
|
23
|
-
@
|
24
|
-
|
23
|
+
@stop_lock = Mutex.new
|
24
|
+
@stop_signaled = false
|
25
|
+
|
26
|
+
# parse command line options and set @parsed_options
|
27
|
+
options_parser = service_class.respond_to?(:options_parser) ? service_class.options_parser(create_options_parser, Raad.custom_options) : create_options_parser
|
28
|
+
begin
|
29
|
+
options_parser.parse!(argv)
|
30
|
+
rescue OptionParser::InvalidOption => e
|
31
|
+
puts(">> #{e.message}")
|
32
|
+
exit!(false)
|
33
|
+
end
|
34
|
+
|
35
|
+
# grab what's left after options, which should be the start/stop command
|
36
|
+
@parsed_options[:command] = argv[0].to_s.downcase
|
37
|
+
unless ['start', 'stop', 'post_fork'].include?(@parsed_options[:command])
|
25
38
|
puts(">> start|stop command is required")
|
26
39
|
exit!(false)
|
27
40
|
end
|
28
41
|
|
29
|
-
|
30
|
-
@
|
31
|
-
@logger_options = nil
|
32
|
-
@pid_file = nil
|
42
|
+
# load config if present
|
43
|
+
Configuration.load(@parsed_options[:config] || File.expand_path("./config/#{default_service_name(service_class)}.rb"))
|
33
44
|
|
34
|
-
|
35
|
-
@
|
36
|
-
end
|
45
|
+
# default service name
|
46
|
+
@service_name = @parsed_options[:name] || Configuration.daemon_name || default_service_name(service_class)
|
37
47
|
|
38
|
-
|
39
|
-
|
40
|
-
Configuration.load(options[:config] || File.expand_path("./config/#{default_service_name}.rb"))
|
48
|
+
# @pid_file is required to become Daemonizable
|
49
|
+
@pid_file = @parsed_options.delete(:pid_file) || "./#{@service_name}.pid"
|
41
50
|
|
42
|
-
#
|
43
|
-
@
|
51
|
+
# default stop timeout
|
52
|
+
@stop_timeout = (@parsed_options.delete(:stop_timeout) || Configuration.stop_timeout || STOP_TIMEOUT).to_i
|
44
53
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
unless options[:log_stdout]
|
49
|
-
options[:log_stdout] = !options[:daemonize]
|
50
|
-
end
|
54
|
+
# logger options
|
55
|
+
@parsed_options[:log_file] = (@parsed_options[:daemonize] ? File.expand_path("#{@service_name}.log") : nil) unless @parsed_options[:log_file]
|
56
|
+
@parsed_options[:log_stdout] = !@parsed_options[:daemonize] unless @parsed_options[:log_stdout]
|
51
57
|
@logger_options = {
|
52
|
-
:file =>
|
53
|
-
:stdout =>
|
54
|
-
:verbose =>
|
55
|
-
:pattern =>
|
58
|
+
:file => @parsed_options.delete(:log_file) || Configuration.log_file,
|
59
|
+
:stdout => @parsed_options.delete(:log_stdout) || Configuration.log_stdout,
|
60
|
+
:verbose => @parsed_options.delete(:verbose) || Configuration.verbose,
|
61
|
+
:pattern => @parsed_options.delete(:log_pattern) || Configuration.log_pattern,
|
56
62
|
}
|
57
|
-
|
58
|
-
@stop_timeout = (options.delete(:stop_timeout) || Configuration.stop_timeout || STOP_TIMEOUT).to_i
|
63
|
+
end
|
59
64
|
|
65
|
+
def run
|
60
66
|
# check for stop command, @pid_file must be set
|
61
|
-
if
|
67
|
+
if @parsed_options[:command] == 'stop'
|
62
68
|
puts(">> Raad service wrapper v#{VERSION} stopping")
|
63
69
|
# first send the TERM signal which will invoke the daemon wait_or_will method which will timeout after @stop_timeout
|
64
70
|
# if still not stopped afer @stop_timeout + 2 seconds, KILL -9 will be sent.
|
@@ -66,28 +72,31 @@ module Raad
|
|
66
72
|
exit(success)
|
67
73
|
end
|
68
74
|
|
69
|
-
# setup logging
|
70
|
-
Logger.setup(@logger_options)
|
71
|
-
Logger.level = Configuration.log_level if Configuration.log_level
|
72
|
-
|
73
75
|
Dir.chdir(File.expand_path(File.dirname("./"))) unless Raad.test?
|
74
76
|
|
75
|
-
if
|
77
|
+
if @parsed_options[:command] == 'post_fork'
|
76
78
|
# we've been spawned and re executed, finish setup
|
77
|
-
post_fork_setup(@service_name,
|
78
|
-
|
79
|
+
post_fork_setup(@service_name, @parsed_options[:redirect])
|
80
|
+
start_service
|
79
81
|
else
|
80
82
|
puts(">> Raad service wrapper v#{VERSION} starting")
|
81
|
-
|
83
|
+
@parsed_options[:daemonize] ? daemonize(@argv, @service_name, @parsed_options[:redirect]) {start_service} : start_service
|
82
84
|
end
|
83
85
|
end
|
84
86
|
|
85
87
|
private
|
86
88
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
89
|
+
def start_service
|
90
|
+
# setup logging
|
91
|
+
Logger.setup(@logger_options)
|
92
|
+
Logger.level = Configuration.log_level if Configuration.log_level
|
93
|
+
|
94
|
+
Logger.debug("initializing #{@service_name} service")
|
95
|
+
|
96
|
+
# create service instance
|
97
|
+
service = @service_class.new
|
98
|
+
|
99
|
+
# important to display this after service instantiation which can set Raad.env
|
91
100
|
Logger.info("starting #{@service_name} service in #{Raad.env.to_s} mode")
|
92
101
|
|
93
102
|
at_exit do
|
@@ -95,24 +104,24 @@ module Raad
|
|
95
104
|
end
|
96
105
|
|
97
106
|
# do not trap :QUIT because its not supported in jruby
|
98
|
-
[:INT, :TERM].each{|sig| SignalTrampoline.trap(sig) {stop_service}}
|
107
|
+
[:INT, :TERM].each{|sig| SignalTrampoline.trap(sig) {stop_service(service)}}
|
99
108
|
|
100
109
|
# launch the service thread and call start. we expect start not to return
|
101
110
|
# unless it is done or has been stopped.
|
102
111
|
service_thread = Thread.new do
|
103
112
|
Thread.current.abort_on_exception = true
|
104
113
|
service.start
|
105
|
-
stop_service
|
114
|
+
stop_service(service)
|
106
115
|
end
|
107
116
|
|
108
117
|
result = wait_or_kill(service_thread)
|
109
118
|
# if not daemonized start a sentinel thread, if still alive after 2 seconds, do arakiri
|
110
|
-
Thread.new{sleep(2 * SECOND); Process.kill(:KILL, Process.pid)} unless
|
119
|
+
Thread.new{sleep(2 * SECOND); Process.kill(:KILL, Process.pid)} unless @parsed_options[:daemonize]
|
111
120
|
# use exit and not exit! to make sure the at_exit hooks are called, like the pid cleanup, etc.
|
112
121
|
exit(result)
|
113
122
|
end
|
114
123
|
|
115
|
-
def stop_service
|
124
|
+
def stop_service(service)
|
116
125
|
return if @stop_lock.synchronize{s = @stop_signaled; @stop_signaled = true; s}
|
117
126
|
|
118
127
|
Logger.info("stopping #{@service_name} service")
|
@@ -150,15 +159,15 @@ module Raad
|
|
150
159
|
# convert the service class name from CameCase to underscore
|
151
160
|
#
|
152
161
|
# @return [String] underscored service class name
|
153
|
-
def default_service_name
|
154
|
-
|
162
|
+
def default_service_name(clazz)
|
163
|
+
clazz.to_s.split('::').last.gsub(/(.)([A-Z])/,'\1_\2').downcase!
|
155
164
|
end
|
156
165
|
|
157
166
|
# Create the options parser
|
158
167
|
#
|
159
168
|
# @return [OptionParser] Creates the options parser for the runner with the default options
|
160
|
-
def create_options_parser
|
161
|
-
@
|
169
|
+
def create_options_parser
|
170
|
+
@parsed_options ||= {
|
162
171
|
:daemonize => false,
|
163
172
|
:verbose => false,
|
164
173
|
}
|
@@ -171,21 +180,22 @@ module Raad
|
|
171
180
|
|
172
181
|
opts.on('-e', '--environment NAME', "set the execution environment (default: #{Raad.env.to_s})") { |val| Raad.env = val }
|
173
182
|
|
174
|
-
opts.on('-l', '--log FILE', "log to file (default: in console mode: no, daemonized: <service>.log)") { |file| @
|
175
|
-
opts.on('-s', '--stdout', "log to stdout (default: in console mode: true, daemonized: false)") { |v| @
|
176
|
-
opts.on('-v', '--verbose', "enable verbose logging (default: #{@
|
177
|
-
opts.on('--pattern PATTERN', "log4r log formatter pattern") { |v| @
|
183
|
+
opts.on('-l', '--log FILE', "log to file (default: in console mode: no, daemonized: <service>.log)") { |file| @parsed_options[:log_file] = file }
|
184
|
+
opts.on('-s', '--stdout', "log to stdout (default: in console mode: true, daemonized: false)") { |v| @parsed_options[:log_stdout] = v }
|
185
|
+
opts.on('-v', '--verbose', "enable verbose logging (default: #{@parsed_options[:verbose]})") { |v| @parsed_options[:verbose] = v }
|
186
|
+
opts.on('--pattern PATTERN', "log4r log formatter pattern") { |v| @parsed_options[:log_pattern] = v }
|
178
187
|
|
179
|
-
opts.on('-c', '--config FILE', "config file (default: ./config/<service>.rb)") { |v| @
|
180
|
-
opts.on('-d', '--daemonize', "run daemonized in the background (default: #{@
|
181
|
-
opts.on('-P', '--pid FILE', "pid file when daemonized (default: <service>.pid)") { |file| @
|
182
|
-
opts.on('-r', '--redirect FILE', "redirect stdout to FILE when daemonized (default: no)") { |v| @
|
183
|
-
opts.on('-n', '--name NAME', "daemon process name (default: <service>)") { |v| @
|
184
|
-
opts.on('--timeout SECONDS', "seconds to wait before force stopping the service (default: 60)") { |v| @
|
188
|
+
opts.on('-c', '--config FILE', "config file (default: ./config/<service>.rb)") { |v| @parsed_options[:config] = v }
|
189
|
+
opts.on('-d', '--daemonize', "run daemonized in the background (default: #{@parsed_options[:daemonize]})") { |v| @parsed_options[:daemonize] = v }
|
190
|
+
opts.on('-P', '--pid FILE', "pid file when daemonized (default: <service>.pid)") { |file| @parsed_options[:pid_file] = file }
|
191
|
+
opts.on('-r', '--redirect FILE', "redirect stdout to FILE when daemonized (default: no)") { |v| @parsed_options[:redirect] = v }
|
192
|
+
opts.on('-n', '--name NAME', "daemon process name (default: <service>)") { |v| @parsed_options[:name] = v }
|
193
|
+
opts.on('--timeout SECONDS', "seconds to wait before force stopping the service (default: 60)") { |v| @parsed_options[:stop_timeout] = v }
|
185
194
|
|
186
|
-
opts.on('-h', '--help', 'display help message') { show_options(
|
195
|
+
opts.on('-h', '--help', 'display help message') { show_options(options_parser) }
|
187
196
|
end
|
188
|
-
|
197
|
+
|
198
|
+
options_parser
|
189
199
|
end
|
190
200
|
|
191
201
|
# Output the servers options and exit Ruby
|
data/lib/raad/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: raad
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-10-12 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rubyforge
|
16
|
-
requirement: &
|
16
|
+
requirement: &2165354500 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2165354500
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &2165353940 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 2.6.0
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2165353940
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rake
|
38
|
-
requirement: &
|
38
|
+
requirement: &2165353420 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.9.2
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2165353420
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: log4r
|
49
|
-
requirement: &
|
49
|
+
requirement: &2165352940 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: 1.1.9
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2165352940
|
58
58
|
description: Ruby as a Daemon lightweight service wrapper
|
59
59
|
email:
|
60
60
|
- colin.surprenant@gmail.com
|