-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Adil Haritah
committed
Aug 4, 2015
1 parent
e81838f
commit bc87422
Showing
3 changed files
with
24 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
language: ruby | ||
rvm: | ||
- "2.0.0" | ||
- "2.2.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require 'cli' | ||
|
||
class SidekiqClientCLI | ||
class Parser | ||
def parse | ||
CLI.new do | ||
option :config_path, :short => :c, :default => DEFAULT_CONFIG_PATH, :description => "Sidekiq client config file path" | ||
option :queue, :short => :q, :description => "Queue to place job on" | ||
option :retry, :short => :r, :cast => lambda { |r| SidekiqClientCLI.cast_retry_option(r) }, :description => "Retry option for job" | ||
argument :command, :description => "'push' to push a job to the queue" | ||
arguments :command_args, :required => false, :description => "command arguments" | ||
end.parse! do |settings| | ||
fail "Invalid command '#{settings.command}'. Available commands: #{COMMANDS.join(',').chomp(',')}" unless COMMANDS.include? settings.command | ||
|
||
if settings.command == "push" && settings.command_args.empty? | ||
fail "No Worker Classes to push" | ||
end | ||
end | ||
end | ||
end | ||
end |