lib/bundleup/console.rb
def progress(message, &block)
      spinner = %w[/ - \\ |].cycle
      print "\e[90m#{message}... \e[0m"
      result = observing_thread(block, 0.5, 0.1) do
        print "\r\e[90m#{message}... #{spinner.next} \e[0m"
      end
      puts "\r\e[90m#{message}... OK\e[0m"
      result
    rescue StandardError
      puts "\r\e[90m#{message}...\e[0m \e[31mFAILED\e[0m"
      raise
    end
def progress(message, &block)
      spinner = %w[/ - \\ |].cycle
      print "\e[90m#{message}... \e[0m"
      result = observing_thread(block, 0.5, 0.1) do
        print "\r\e[90m#{message}... #{spinner.next} \e[0m"
      end
      puts "\r\e[90m#{message}... OK\e[0m"
      result
    rescue StandardError
      puts "\r\e[90m#{message}...\e[0m \e[31mFAILED\e[0m"
      raise
    end
def progress ( message , & block ) spinner = %w[ /  \\ | ] . cycle print "\e[90m#{message}... \e[0m" result = observing_thread ( block , 0.5 , 0.1 ) do print "\r\e[90m#{message}... #{spinner.next} \e[0m" end puts "\r\e[90m#{message}... OK\e[0m" result rescue StandardError puts "\r\e[90m#{message}...\e[0m \e[31mFAILED\e[0m" raise end
Runs a block in the background and displays a spinner until it completes.
Runs a block in the background and displays a spinner until it completes .