Included Modules

Files

Interact::Progress

Public Instance Methods

quiet?() click to toggle source

override to determine whether to show progress

# File lib/interact/progress.rb, line 78
def quiet?
  false
end
with_progress(message) click to toggle source
# File lib/interact/progress.rb, line 82
def with_progress(message)
  unless quiet?
    print message
    Dots.start!
  end

  skipper = Skipper.new do |status, color, callback|
    unless quiet?
      Dots.stop!
      puts "... #{c(status, color)}"
    end

    return callback && callback.call
  end

  begin
    res = yield skipper
    unless quiet?
      Dots.stop!
      puts "... #{c("OK", :good)}"
    end
    res
  rescue
    unless quiet?
      Dots.stop!
      puts "... #{c("FAILED", :error)}"
    end

    raise
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.