1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Accept queue names containing dots through the CLI

This commit is contained in:
Jordan Bach 2012-10-25 14:40:42 -05:00
parent 1cbd98f5eb
commit 8713de160c
2 changed files with 6 additions and 1 deletions
lib/sidekiq
test

View file

@ -149,7 +149,7 @@ module Sidekiq
@parser = OptionParser.new do |o|
o.on "-q", "--queue QUEUE[,WEIGHT]...", "Queues to process with optional weights" do |arg|
queues_and_weights = arg.scan(/([\w-]+),?(\d*)/)
queues_and_weights = arg.scan(/([\w\.-]+),?(\d*)/)
queues_and_weights.each {|queue_and_weight| parse_queues(opts, *queue_and_weight)}
opts[:strict] = queues_and_weights.collect(&:last).none? {|weight| weight != ''}
end

View file

@ -70,6 +70,11 @@ class TestCli < MiniTest::Unit::TestCase
assert_equal %w(queue_one queue-two), Sidekiq.options[:queues]
end
it 'handles queues with dots in the name' do
@cli.parse(['sidekiq', '-q', 'foo.bar', '-r', './test/fake_env.rb'])
assert_equal ['foo.bar'], Sidekiq.options[:queues]
end
it 'sets verbose' do
old = Sidekiq.logger.level
@cli.parse(['sidekiq', '-v', '-r', './test/fake_env.rb'])