class Berkshelf::HumanFormatter
def deprecation(message)
-
message
(String
) --
def deprecation(message) Berkshelf.ui.info "DEPRECATED: #{message}" end
def error(message)
-
message
(String
) --
def error(message) Berkshelf.ui.error message end
def fetch(dependency)
-
dependency
(Berkshelf::Dependency
) --
def fetch(dependency) Berkshelf.ui.info "Fetching '#{dependency.name}' from #{dependency.location}" end
def info(cookbook)
-
cookbook
(CachedCookbook
) --
def info(cookbook) Berkshelf.ui.info(cookbook.pretty_print) end
def install(source, cookbook)
-
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)
-
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)
-
message
(String
) --
def msg(message) Berkshelf.ui.info message end
def outdated(hash)
-
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)
-
destination
(String
) --
def package(destination) Berkshelf.ui.info "Cookbook(s) packaged to #{destination}" end
def search(results)
-
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)
-
cookbook
(CachedCookbook
) --
def show(cookbook) path = File.expand_path(cookbook.path) Berkshelf.ui.info(path) end
def skipping(cookbook, conn)
-
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)
-
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)
-
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)
-
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
def version Berkshelf.ui.info Berkshelf::VERSION end
def warn(message)
-
message
(String
) --
def warn(message) Berkshelf.ui.warn message end