Method: God::CLI::Command#lifecycle_command

Defined in:
lib/god/cli/command.rb

#lifecycle_commandObject



204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/god/cli/command.rb', line 204

def lifecycle_command
  # get the name of the watch/group
  name = @args[1]
  
  puts "Sending '#{@command}' command"
  
  t = Thread.new { loop { sleep(1); STDOUT.print('.'); STDOUT.flush; sleep(1) } }
  
  # send @command
  watches = @server.control(name, @command)
  
  # output response
  t.kill; STDOUT.puts
  unless watches.empty?
    puts 'The following watches were affected:'
    watches.each do |w|
      puts '  ' + w
    end
  else
    puts 'No matching task or group'
  end
end