class Berkshelf::HumanFormatter

def deprecation(message)

Parameters:
  • message (String) --
def deprecation(message)
  Berkshelf.ui.info "DEPRECATED: #{message}"
end

def error(message)

Parameters:
  • message (String) --
def error(message)
  Berkshelf.ui.error message
end

def fetch(dependency)

Parameters:
  • dependency (Berkshelf::Dependency) --
def fetch(dependency)
  Berkshelf.ui.info "Fetching '#{dependency.name}' from #{dependency.location}"
end

def info(cookbook)

Parameters:
  • cookbook (CachedCookbook) --
def info(cookbook)
  Berkshelf.ui.info(cookbook.pretty_print)
end

def install(source, cookbook)

Parameters:
  • cookbook (RemoteCookbook) --
  • source (Source) --
def install(source, cookbook)
  message = "Installing #{cookbook.name} (#{cookbook.version})"
  if source.type == :chef_repo
    message << " from #{cookbook.location_path}"
  elsif !source.default?
    message << " from #{source}"
    message << " ([#{cookbook.location_type}] #{cookbook.location_path})"
  end
  Berkshelf.ui.info(message)
end

def list(dependencies)

Parameters:
  • list (Array) --
def list(dependencies)
  Berkshelf.ui.info "Cookbooks installed by your Berksfile:"
  dependencies.each do |dependency|
    out =  "  * #{dependency}"
    out << " from #{dependency.location}" if dependency.location
    Berkshelf.ui.info(out)
  end
end

def msg(message)

Parameters:
  • message (String) --
def msg(message)
  Berkshelf.ui.info message
end

def outdated(hash)

Parameters:
  • hash (Hash) --
def outdated(hash)
  if hash.empty?
    Berkshelf.ui.info("All cookbooks up to date!")
  else
    Berkshelf.ui.info("The following cookbooks have newer versions:")
    hash.each do |name, info|
      info["remote"].each do |remote_source, remote_version|
        out = "  * #{name} (#{info["local"]} => #{remote_version})"
        unless remote_source.default?
          out << " [#{remote_source.uri}]"
        end
        Berkshelf.ui.info(out)
      end
    end
  end
end

def package(destination)

Parameters:
  • destination (String) --
def package(destination)
  Berkshelf.ui.info "Cookbook(s) packaged to #{destination}"
end

def search(results)

Parameters:
  • results (Array) --
def search(results)
  results.sort_by(&:name).each do |remote_cookbook|
    Berkshelf.ui.info "#{remote_cookbook.name} (#{remote_cookbook.version})"
  end
end

def show(cookbook)

Parameters:
  • cookbook (CachedCookbook) --
def show(cookbook)
  path = File.expand_path(cookbook.path)
  Berkshelf.ui.info(path)
end

def skipping(cookbook, conn)

Parameters:
  • conn (Ridley::Connection) --
  • cookbook (Berkshelf::CachedCookbook) --
def skipping(cookbook, conn)
  Berkshelf.ui.info "Skipping #{cookbook.cookbook_name} (#{cookbook.version}) (frozen)"
end

def uploaded(cookbook, conn)

Parameters:
  • conn (Ridley::Connection) --
  • cookbook (Berkshelf::CachedCookbook) --
def uploaded(cookbook, conn)
  Berkshelf.ui.info "Uploaded #{cookbook.cookbook_name} (#{cookbook.version}) to: '#{conn.server_url}'"
end

def use(dependency)

Parameters:
  • dependency (Dependency) --
def use(dependency)
  message =  "Using #{dependency.name} (#{dependency.locked_version})"
  message << " from #{dependency.location}" if dependency.location
  Berkshelf.ui.info(message)
end

def vendor(cookbook, destination)

Parameters:
  • destination (String) --
  • cookbook (CachedCookbook) --
def vendor(cookbook, destination)
  cookbook_destination = File.join(destination, cookbook.cookbook_name)
  Berkshelf.ui.info "Vendoring #{cookbook.cookbook_name} (#{cookbook.version}) to #{cookbook_destination}"
end

def version

Output the version of Berkshelf
def version
  Berkshelf.ui.info Berkshelf::VERSION
end

def warn(message)

Parameters:
  • message (String) --
def warn(message)
  Berkshelf.ui.warn message
end