Class: Berkshelf::Formatters::HumanReadable
- Inherits:
-
Object
- Object
- Berkshelf::Formatters::HumanReadable
- Includes:
- AbstractFormatter
- Defined in:
- lib/berkshelf/formatters/human_readable.rb
Instance Method Summary collapse
-
#deprecation(message) ⇒ Object
Output a deprecation warning.
-
#error(message) ⇒ Object
Output an error message using Berkshelf.ui.
-
#install(cookbook, version, location) ⇒ Object
Output a Cookbook installation message using Berkshelf.ui.
-
#msg(message) ⇒ Object
Output a generic message using Berkshelf.ui.
-
#package(cookbook, destination) ⇒ Object
Output a Cookbook package message using Berkshelf.ui.
-
#show(cookbook) ⇒ Object
Output Cookbook info message using Berkshelf.ui.
-
#upload(cookbook, version, chef_api_url) ⇒ Object
Output a Cookbook upload message using Berkshelf.ui.
-
#use(cookbook, version, location = nil) ⇒ Object
Output a Cookbook use message using Berkshelf.ui.
Methods included from AbstractFormatter
Instance Method Details
#deprecation(message) ⇒ Object
Output a deprecation warning
74 75 76 |
# File 'lib/berkshelf/formatters/human_readable.rb', line 74 def deprecation() Berkshelf.ui.info "DEPRECATED: #{}" end |
#error(message) ⇒ Object
Output an error message using Berkshelf.ui
67 68 69 |
# File 'lib/berkshelf/formatters/human_readable.rb', line 67 def error() Berkshelf.ui.error end |
#install(cookbook, version, location) ⇒ Object
Output a Cookbook installation message using Berkshelf.ui
13 14 15 |
# File 'lib/berkshelf/formatters/human_readable.rb', line 13 def install(cookbook, version, location) Berkshelf.ui.info "Installing #{cookbook} (#{version}) from #{location}" end |
#msg(message) ⇒ Object
Output a generic message using Berkshelf.ui
60 61 62 |
# File 'lib/berkshelf/formatters/human_readable.rb', line 60 def msg() Berkshelf.ui.info end |
#package(cookbook, destination) ⇒ Object
Output a Cookbook package message using Berkshelf.ui
46 47 48 |
# File 'lib/berkshelf/formatters/human_readable.rb', line 46 def package(cookbook, destination) Berkshelf.ui.info "Cookbook(s) packaged to #{destination}!" end |
#show(cookbook) ⇒ Object
Output Cookbook info message using Berkshelf.ui
53 54 55 |
# File 'lib/berkshelf/formatters/human_readable.rb', line 53 def show(cookbook) Berkshelf.ui.info(cookbook.pretty_print) end |
#upload(cookbook, version, chef_api_url) ⇒ Object
Output a Cookbook upload message using Berkshelf.ui
38 39 40 |
# File 'lib/berkshelf/formatters/human_readable.rb', line 38 def upload(cookbook, version, chef_api_url) Berkshelf.ui.info "Uploading #{cookbook} (#{version}) to: '#{chef_api_url}'" end |
#use(cookbook, version, location = nil) ⇒ Object
Output a Cookbook use message using Berkshelf.ui
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/berkshelf/formatters/human_readable.rb', line 22 def use(cookbook, version, location = nil) = "Using #{cookbook} (#{version})" if location.is_a?(PathLocation) << ' from metadata' if location. << " at '#{location.relative_path}'" unless location.relative_path == '.' end Berkshelf.ui.info end |