Module: Kafkat::CommandIO

Included in:
Kafkat::Command::Base
Defined in:
lib/kafkat/utility/command_io.rb

Instance Method Summary collapse

Instance Method Details

#prompt_and_execute_assignments(assignments) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/kafkat/utility/command_io.rb', line 3

def prompt_and_execute_assignments(assignments)
  print "This operation executes the following assignments:\n\n"
  print_assignment_header
  assignments.each { |a| print_assignment(a) }
  print "\n"

  return unless agree("Proceed (y/n)?")

  result = nil
  begin
    print "\nBeginning.\n"
    result = admin.reassign!(assignments)
    print "Started.\n"
  rescue Interface::Admin::ExecutionFailedError
    print result
  end
end