Class: Pantry::Chef::ListCookbooks
- Inherits:
-
Pantry::Command
- Object
- Pantry::Command
- Pantry::Chef::ListCookbooks
- Defined in:
- lib/pantry/chef/list_cookbooks.rb
Overview
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.
Instance Method Summary collapse
Instance Method Details
#perform(message) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/pantry/chef/list_cookbooks.rb', line 14 def perform() 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) ⇒ Object
24 25 26 |
# File 'lib/pantry/chef/list_cookbooks.rb', line 24 def receive_server_response() Pantry.ui.list(.body.map(&:first).sort) end |