class Berkshelf::HumanFormatter
Public Instance Methods
Source
# File lib/berkshelf/formatters/human.rb, line 159 def deprecation(message) Berkshelf.ui.info "DEPRECATED: #{message}" end
Output a deprecation warning
@param [String] message
Source
# File lib/berkshelf/formatters/human.rb, line 145 def error(message) Berkshelf.ui.error message end
Output an error message using {Berkshelf.ui}
@param [String] message
Source
# File lib/berkshelf/formatters/human.rb, line 9 def fetch(dependency) Berkshelf.ui.info "Fetching '#{dependency.name}' from #{dependency.location}" end
@param [Berkshelf::Dependency] dependency
Source
# File lib/berkshelf/formatters/human.rb, line 93 def info(cookbook) Berkshelf.ui.info(cookbook.pretty_print) end
Output the important information about a cookbook using {Berkshelf.ui}.
@param [CachedCookbook] cookbook
Source
# File lib/berkshelf/formatters/human.rb, line 19 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
Output a Cookbook installation message using {Berkshelf.ui}
@param [Source] source
the source the dependency is being downloaded from
@param [RemoteCookbook] cookbook
the cookbook to be downloaded
Source
# File lib/berkshelf/formatters/human.rb, line 100 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
Output a list of cookbooks using {Berkshelf.ui}
@param [Array<Dependency>] list
Source
# File lib/berkshelf/formatters/human.rb, line 138 def msg(message) Berkshelf.ui.info message end
Output a generic message using {Berkshelf.ui}
@param [String] message
Source
# File lib/berkshelf/formatters/human.rb, line 63 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
Output a list of outdated cookbooks and the most recent version using {Berkshelf.ui}
@param [Hash] hash
the list of outdated cookbooks in the format { 'cookbook' => { 'supermarket.chef.io' => #<Cookbook> } }
Source
# File lib/berkshelf/formatters/human.rb, line 86 def package(destination) Berkshelf.ui.info "Cookbook(s) packaged to #{destination}" end
Output a Cookbook package message using {Berkshelf.ui}
@param [String] destination
Source
# File lib/berkshelf/formatters/human.rb, line 112 def search(results) results.sort_by(&:name).each do |remote_cookbook| Berkshelf.ui.info "#{remote_cookbook.name} (#{remote_cookbook.version})" end end
Ouput Cookbook search results using {Berkshelf.ui}
@param [Array<APIClient::RemoteCookbook>] results
Source
# File lib/berkshelf/formatters/human.rb, line 121 def show(cookbook) path = File.expand_path(cookbook.path) Berkshelf.ui.info(path) end
Output Cookbook path using {Berkshelf.ui}
@param [CachedCookbook] cookbook
Source
# File lib/berkshelf/formatters/human.rb, line 53 def skipping(cookbook, conn) Berkshelf.ui.info "Skipping #{cookbook.cookbook_name} (#{cookbook.version}) (frozen)" end
Output a Cookbook skip message using {Berkshelf.ui}
@param [Berkshelf::CachedCookbook] cookbook @param [Ridley::Connection] conn
Source
# File lib/berkshelf/formatters/human.rb, line 45 def uploaded(cookbook, conn) Berkshelf.ui.info "Uploaded #{cookbook.cookbook_name} (#{cookbook.version}) to: '#{conn.server_url}'" end
Output a Cookbook upload message using {Berkshelf.ui}
@param [Berkshelf::CachedCookbook] cookbook @param [Ridley::Connection] conn
Source
# File lib/berkshelf/formatters/human.rb, line 35 def use(dependency) message = "Using #{dependency.name} (#{dependency.locked_version})" message << " from #{dependency.location}" if dependency.location Berkshelf.ui.info(message) end
Output a Cookbook use message using {Berkshelf.ui}
@param [Dependency] dependency
Source
# File lib/berkshelf/formatters/human.rb, line 130 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
Output Cookbook vendor info message using {Berkshelf.ui}
@param [CachedCookbook] cookbook @param [String] destination
Source
# File lib/berkshelf/formatters/human.rb, line 4 def version Berkshelf.ui.info Berkshelf::VERSION end
Output the version of Berkshelf
Source
# File lib/berkshelf/formatters/human.rb, line 152 def warn(message) Berkshelf.ui.warn message end
Output a warning message using {Berkshelf.ui}
@param [String] message