Class: SidekiqUniqueJobs::Cli
- Inherits:
-
Thor
- Object
- Thor
- SidekiqUniqueJobs::Cli
- Defined in:
- lib/sidekiq_unique_jobs/cli.rb
Class Method Summary collapse
-
.banner(command, _namespace = nil, _subcommand = false) ⇒ Object
def initialize(argv, stdin = STDIN, stdout = STDOUT, stderr = STDERR, kernel = Kernel) @argv, @stdin, @stdout, @stderr, @kernel = argv, stdin, stdout, stderr, kernel end.
Instance Method Summary collapse
Class Method Details
.banner(command, _namespace = nil, _subcommand = false) ⇒ Object
def initialize(argv, stdin = STDIN, stdout = STDOUT, stderr = STDERR, kernel = Kernel)
@argv, @stdin, @stdout, @stderr, @kernel = argv, stdin, stdout, stderr, kernel
end
11 12 13 |
# File 'lib/sidekiq_unique_jobs/cli.rb', line 11 def self.(command, _namespace = nil, _subcommand = false) "jobs #{@package_name} #{command.usage}" end |
Instance Method Details
#console ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/sidekiq_unique_jobs/cli.rb', line 39 def console say "Use `keys '*', 1000 to display the first 1000 unique keys matching '*'" say "Use `del '*', 1000, true (default) to see how many keys would be deleted for the pattern '*'" say "Use `del '*', 1000, false to delete the first 1000 keys matching '*'" Object.include SidekiqUniqueJobs::Util console_class.start end |
#del(pattern) ⇒ Object
26 27 28 29 |
# File 'lib/sidekiq_unique_jobs/cli.rb', line 26 def del(pattern) deleted_count = Util.del(pattern, [:count], [:dry_run]) say "Deleted #{deleted_count} keys matching '#{pattern}'" end |