From 5dc1462a4ce536cacf9fc380b1022d1c48d12bc2 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Tue, 23 Apr 2013 10:11:47 +0100 Subject: Allow --queue to specify the beanstalkd tube. --- bin/custodian-enqueue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'bin/custodian-enqueue') diff --git a/bin/custodian-enqueue b/bin/custodian-enqueue index 41378e6..e2e4420 100755 --- a/bin/custodian-enqueue +++ b/bin/custodian-enqueue @@ -6,6 +6,7 @@ # SYNOPSIS # custodian-enqueue [ -h | --help ] # [ -m | --manual] +# [ -q | --queue NAME] # [ -f | --file FILE] # [ -d | --dump ] # [ | --test ] @@ -18,6 +19,8 @@ # # -d, --dump Dump the parsed tests to the console; don't insert in the queue. # +# -q, --queue Use the named beanstalkd tube. +# # --test Test the parsing of the given file, alert on errors. # # -f, --file FILE Parse the given configuration file. @@ -74,6 +77,7 @@ if __FILE__ == $0 then # settings = Custodian::Settings.instance() $SERVER = settings.queue_server + $QUEUE = settings.queue_name begin opts = GetoptLong.new( @@ -82,6 +86,7 @@ if __FILE__ == $0 then [ "--server", GetoptLong::REQUIRED_ARGUMENT ], [ "--file", "-f", GetoptLong::REQUIRED_ARGUMENT ], [ "--help", "-h", GetoptLong::NO_ARGUMENT ], + [ "--queue", "-q", GetoptLong::REQUIRED_ARGUMENT ], [ "--manual","-m", GetoptLong::NO_ARGUMENT ] ) opts.each do |opt, arg| @@ -92,7 +97,9 @@ if __FILE__ == $0 then ENV["TEST"] = "1" when "--server" then $SERVER = arg - when "--file" then + when "--queue" then + $QUEUE= arg + when "--file" then ENV["FILE"] = arg when "--help" then $help = true @@ -139,7 +146,7 @@ if __FILE__ == $0 then # # Connected to the server # - queue = Beanstalk::Pool.new([$SERVER], "Custodian") + queue = Beanstalk::Pool.new([$SERVER], $QUEUE ) if ( ! queue ) puts "Failed to connect to beanstalk server: #{$SERVER}" exit 1 -- cgit v1.2.1