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

Merge pull request #469 from jbgo/queue_names_with_dots

Accept queue names containing dots through the CLI
This commit is contained in:
Mike Perham 2012-10-25 12:58:09 -07:00
commit ae1ff3358a
2 changed files with 6 additions and 1 deletions

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'])