lib/quebert/command_line_runner.rb in quebert-2.0.4 vs lib/quebert/command_line_runner.rb in quebert-3.0.0

- old
+ new

@@ -26,10 +26,11 @@ "(default: #{@options[:log]})") { |file| @options[:log] = file } opts.on("-P", "--pid FILE", "File to store PID " + "(default: #{@options[:pid]})") { |file| @options[:pid] = file } opts.on("-C", "--config FILE", "Load options from config file") { |file| @options[:config] = file } opts.on("-c", "--chdir DIR", "Change to dir before starting") { |dir| @options[:chdir] = File.expand_path(dir) } + opts.on("-q", "--queues LIST", "Specify queue name(s)") { |list| @options[:queues] = list.split(",") } end end # Parse the options. def parse! @@ -56,11 +57,13 @@ if config = params[:config] || auto_config require config end - Worker.new.start + worker = Worker.new + worker.queues = params[:queues] if params[:queues] + worker.start end private def self.auto_config rails_env_path = './config/environment.rb' @@ -68,6 +71,6 @@ Quebert.logger.info "Detected Rails! Setting config-file=#{rails_env_path}" rails_env_path end end end -end \ No newline at end of file +end