lib/rabbit/console.rb in rabbit-2.0.0 vs lib/rabbit/console.rb in rabbit-2.0.1
- old
+ new
@@ -55,10 +55,11 @@
options.default_logger = @logger
options.druby_uri = "druby://127.0.0.1:10101"
options.version = VERSION
options.options_file = nil
options.rest = []
+ options.before_hooks = []
options.after_hooks = []
process_locale_options(args)
parser = OptionParser.new(banner) do |_parser|
@@ -68,9 +69,12 @@
begin
options_file = options.options_file
if options_file and File.exist?(options_file)
read_options_file(parser, options, options_file)
+ end
+ options.before_hooks.each do |hook|
+ hook.call(self, parser, options)
end
options.rest.concat(parser.parse!(args))
options.after_hooks.each do |hook|
hook.call(self, parser, options)
end