class Pantry::Chef::ListCookbooks

List all cookbooks known by the Server. This message includes the size and checksum of the cookbooks’s tarball as it’s used when sending cookbooks down to a Client.

Public Instance Methods

perform(message) click to toggle source
# File lib/pantry/chef/list_cookbooks.rb, line 14
def perform(message)
  Dir[Pantry.root.join("chef", "cookbook-cache", "*")].map do |cookbook_path|
    [
      File.basename(cookbook_path, ".tgz"),
      File.size(cookbook_path),
      Pantry.file_checksum(cookbook_path)
    ]
  end
end
receive_server_response(message) click to toggle source
# File lib/pantry/chef/list_cookbooks.rb, line 24
def receive_server_response(message)
  Pantry.ui.list(message.body.map(&:first).sort)
end