Class: Quredis::CLI
- Inherits:
-
Thor
- Object
- Thor
- Quredis::CLI
- Defined in:
- lib/quredis/cli.rb
Instance Method Summary collapse
- #destroy(queue_name) ⇒ Object
- #ls ⇒ Object
- #purge(queue_name, queue_type) ⇒ Object
- #retry(queue_name, queue_type) ⇒ Object
- #version ⇒ Object
- #web ⇒ Object
Instance Method Details
#destroy(queue_name) ⇒ Object
28 29 30 |
# File 'lib/quredis/cli.rb', line 28 def destroy(queue_name) Quredis::Admin.new().destroy_queue(queue_name) end |
#ls ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/quredis/cli.rb', line 13 def ls table = Quredis::Admin.new().queues[:items].map do |q| [q['name'], "#{q['ingress']} (#{q['ingress_count']})", "#{q['transit']} (#{q['transit_count']})", "#{q['escape']} (#{q['escape_count']})"] end table.unshift ["Name", "Ingress", "Transit", "Escape"] Thor::Base.shell.new.print_table(table, :indent => 2, :truncate => true) end |
#purge(queue_name, queue_type) ⇒ Object
35 36 37 |
# File 'lib/quredis/cli.rb', line 35 def purge(queue_name, queue_type) Quredis::Admin.new().purge(queue_name, queue_type) end |
#retry(queue_name, queue_type) ⇒ Object
42 43 44 |
# File 'lib/quredis/cli.rb', line 42 def retry(queue_name, queue_type) Quredis::Admin.new().retry(queue_name, queue_type) end |
#version ⇒ Object
60 61 62 |
# File 'lib/quredis/cli.rb', line 60 def version puts "Quredis #{Quredis::VERSION}" end |