Module: Script::UI::StrictSpinner

Defined in:
lib/project_types/script/ui/strict_spinner.rb

Class Method Summary collapse

Class Method Details

.spin(title, auto_debrief: false) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/project_types/script/ui/strict_spinner.rb', line 8

def self.spin(title, auto_debrief: false)
  exception = nil
  CLI::UI::Spinner.spin(title, auto_debrief: auto_debrief) do |*args|
    begin
      yield(*args)
    rescue StandardError => e
      exception = e
      CLI::UI::Spinner::TASK_FAILED
    end
  end
  raise exception if exception
end