Class: ZQ::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/zq/cli.rb

Instance Method Summary collapse

Instance Method Details

#listObject



11
12
13
14
15
16
17
18
# File 'lib/zq/cli.rb', line 11

def list
  setup_env(options)
  orchestras = ZQ.live_orchestras
  fail NoOrchestrasFound if orchestras.empty?
  orchestras.each do |o|
    puts o
  end
end

#play(orchestra_name) ⇒ Object



23
24
25
26
27
28
# File 'lib/zq/cli.rb', line 23

def play(orchestra_name)
  setup_env(options)
  orchestra = ZQ.find_live_orchestra(orchestra_name)
  fail OrchestraDoesNotExist unless orchestra
  run(orchestra, options[:forever], options[:interval])
end