Sha256: bddbc10b2e4514f4228e977db76bf3f2f9971fb0050c7e77f8e76d5b0e1c7cfe

Contents?: true

Size: 1.58 KB

Versions: 17

Compression:

Stored size: 1.58 KB

Contents

module Berkshelf
  module Formatters
    # @author Michael Ivey <ivey@gweezlebur.com>
    class HumanReadable
      include AbstractFormatter

      register_formatter :human

      # Output a Cookbook installation message using {Berkshelf.ui}
      #
      # @param [String] cookbook
      # @param [String] version
      # @param [~Location] location
      def install(cookbook, version, location)
        Berkshelf.ui.info "Installing #{cookbook} (#{version}) from #{location}"
      end

      # Output a Cookbook use message using {Berkshelf.ui}
      #
      # @param [String] cookbook
      # @param [String] version
      # @param [String] path
      def use(cookbook, version, path = nil)
        Berkshelf.ui.info "Using #{cookbook} (#{version})#{' at '+path if path}"
      end

      # Output a Cookbook upload message using {Berkshelf.ui}
      #
      # @param [String] cookbook
      # @param [String] version
      # @param [String] chef_api_url
      def upload(cookbook, version, chef_api_url)
        Berkshelf.ui.info "Uploading #{cookbook} (#{version}) to: '#{chef_api_url}'"
      end

      # Output a generic message using {Berkshelf.ui}
      #
      # @param [String] message
      def msg(message)
        Berkshelf.ui.info message
      end

      # Output an error message using {Berkshelf.ui}
      #
      # @param [String] message
      def error(message)
        Berkshelf.ui.error message
      end

      # Output a deprecation warning
      #
      # @param [String] message
      def deprecation(message)
        Berkshelf.ui.info "DEPRECATED: #{message}"
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
berkshelf-1.1.6 lib/berkshelf/formatters/human_readable.rb
berkshelf-1.1.5 lib/berkshelf/formatters/human_readable.rb
berkshelf-1.1.4 lib/berkshelf/formatters/human_readable.rb
berkshelf-1.1.3 lib/berkshelf/formatters/human_readable.rb
berkshelf-1.1.2 lib/berkshelf/formatters/human_readable.rb
berkshelf-1.1.1 lib/berkshelf/formatters/human_readable.rb
berkshelf-1.1.0 lib/berkshelf/formatters/human_readable.rb
berkshelf-1.1.0.rc1 lib/berkshelf/formatters/human_readable.rb
berkshelf-1.0.4 lib/berkshelf/formatters/human_readable.rb
berkshelf-1.0.3 lib/berkshelf/formatters/human_readable.rb
berkshelf-1.0.2 lib/berkshelf/formatters/human_readable.rb
berkshelf-1.0.0 lib/berkshelf/formatters/human_readable.rb
berkshelf-1.0.0.rc3 lib/berkshelf/formatters/human_readable.rb
berkshelf-1.0.0.rc2 lib/berkshelf/formatters/human_readable.rb
berkshelf-1.0.0.rc1 lib/berkshelf/formatters/human_readable.rb
berkshelf-0.6.0.beta4 lib/berkshelf/formatters/human_readable.rb
berkshelf-0.6.0.beta3 lib/berkshelf/formatters/human_readable.rb