Class: Ridoku::Services::Rabbitmq

Inherits:
Object
  • Object
show all
Defined in:
lib/ridoku/services/rabbitmq.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#mqconfigObject

Returns the value of attribute mqconfig.



8
9
10
# File 'lib/ridoku/services/rabbitmq.rb', line 8

def mqconfig
  @mqconfig
end

Instance Method Details

#config(sub) ⇒ Object



38
39
40
# File 'lib/ridoku/services/rabbitmq.rb', line 38

def config(sub)
  $stderr.puts 'RabbitMQ Config'
end


23
24
25
26
27
28
29
30
31
# File 'lib/ridoku/services/rabbitmq.rb', line 23

def print_help
  $stderr.puts <<-EOF
Command: service:change rabbitmq

List/Modify the current app's associated workers.
  rabbitmq[:config]   lists configuration

  EOF
end

#run(cmd, args) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ridoku/services/rabbitmq.rb', line 10

def run(cmd, args)
  sub_command = args.shift

  case cmd
  when 'config', nil
    config(sub_command)
  when 'describe', 'list', 'show'
    show(sub_command)
  else
    print_help
  end
end

#setupObject



33
34
35
36
# File 'lib/ridoku/services/rabbitmq.rb', line 33

def setup
  Ridoku::Base.fetch_stack
  self.mqconfig = (Base.custom_json['rabbitmq'] ||= {})
end

#show(sub) ⇒ Object



42
43
44
45
# File 'lib/ridoku/services/rabbitmq.rb', line 42

def show(sub)
  setup
  puts JSON.pretty_generate(mqconfig)
end