Module: Berkshelf::Formatters::AbstractFormatter Abstract

Extended by:
ActiveSupport::Concern
Included in:
HumanReadable, JSON
Defined in:
lib/berkshelf/formatters.rb

Overview

This module is abstract.

Include and override #install #use #upload #msg #error to implement.

Implement #cleanup_hook to run any steps required to run after the task is finished

Author:

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#cleanup_hookObject



72
73
74
# File 'lib/berkshelf/formatters.rb', line 72

def cleanup_hook
  # run after the task is finished
end

#error(message) ⇒ Object

Raises:



92
93
94
# File 'lib/berkshelf/formatters.rb', line 92

def error(message)
  raise AbstractFunction, "#error must be implemented on #{self.class}"
end

#install(cookbook, version, location) ⇒ Object

Raises:



76
77
78
# File 'lib/berkshelf/formatters.rb', line 76

def install(cookbook, version, location)
  raise AbstractFunction, "#install must be implemented on #{self.class}"
end

#msg(message) ⇒ Object

Raises:



88
89
90
# File 'lib/berkshelf/formatters.rb', line 88

def msg(message)
  raise AbstractFunction, "#msg must be implemented on #{self.class}"
end

#upload(cookbook, version, chef_server_url) ⇒ Object

Raises:



84
85
86
# File 'lib/berkshelf/formatters.rb', line 84

def upload(cookbook, version, chef_server_url)
  raise AbstractFunction, "#upload must be implemented on #{self.class}"
end

#use(cookbook, version, path = nil) ⇒ Object

Raises:



80
81
82
# File 'lib/berkshelf/formatters.rb', line 80

def use(cookbook, version, path = nil)
  raise AbstractFunction, "#install must be implemented on #{self.class}"
end