module Molinillo::UI

def after_resolution

Returns:
  • (void) -
def after_resolution
  output.puts
end

def before_resolution

Returns:
  • (void) -
def before_resolution
  output.print 'Resolving dependencies...'
end

def debug(depth = 0)

Returns:
  • (void) -

Parameters:
  • depth (Integer) -- the current depth of the resolution process.
def debug(depth = 0)
  if debug?
    debug_info = yield
    debug_info = debug_info.inspect unless debug_info.is_a?(String)
    debug_info = debug_info.split("\n").map { |s| ":#{depth.to_s.rjust 4}: #{s}" }
    output.puts debug_info
  end
end

def debug?

Returns:
  • (Boolean) -
def debug?
  return @debug_mode if defined?(@debug_mode)
  @debug_mode = ENV['MOLINILLO_DEBUG']
end

def indicate_progress

Returns:
  • (void) -
def indicate_progress
  output.print '.' unless debug?
end

def output

Returns:
  • (IO) -
def output
  STDOUT
end

def progress_rate

Returns:
  • (Float) -
def progress_rate
  0.33
end