Class: Berkshelf::BaseFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/berkshelf/formatters/base.rb

Direct Known Subclasses

HumanFormatter, JsonFormatter, NullFormatter

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.formatter_method(name) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/berkshelf/formatters/base.rb', line 9

def formatter_method(name)
  class_eval <<-EOH, __FILE__, __LINE__ + 1
    def #{name}(*args)
      raise AbstractFunction,
        "##{name} must be implemented on \#{self.class.name}!"
    end
  EOH
end

Instance Method Details

#cleanup_hookObject

The cleanup hook is defined by subclasses and is called by the CLI.



41
# File 'lib/berkshelf/formatters/base.rb', line 41

def cleanup_hook; end

#deprecation(*args) ⇒ Object

Create a formatter method for the declaration



20
# File 'lib/berkshelf/formatters/base.rb', line 20

formatter_method :deprecation

#error(*args) ⇒ Object

Create a formatter method for the declaration



21
# File 'lib/berkshelf/formatters/base.rb', line 21

formatter_method :error

#fetch(*args) ⇒ Object

Create a formatter method for the declaration



26
# File 'lib/berkshelf/formatters/base.rb', line 26

formatter_method :fetch

#info(*args) ⇒ Object

Create a formatter method for the declaration



27
# File 'lib/berkshelf/formatters/base.rb', line 27

formatter_method :info

#install(*args) ⇒ Object

Create a formatter method for the declaration



28
# File 'lib/berkshelf/formatters/base.rb', line 28

formatter_method :install

#list(*args) ⇒ Object

Create a formatter method for the declaration



29
# File 'lib/berkshelf/formatters/base.rb', line 29

formatter_method :list

#msg(*args) ⇒ Object

Create a formatter method for the declaration



22
# File 'lib/berkshelf/formatters/base.rb', line 22

formatter_method :msg

#outdated(*args) ⇒ Object

Create a formatter method for the declaration



30
# File 'lib/berkshelf/formatters/base.rb', line 30

formatter_method :outdated

#package(*args) ⇒ Object

Create a formatter method for the declaration



31
# File 'lib/berkshelf/formatters/base.rb', line 31

formatter_method :package

#search(*args) ⇒ Object

Create a formatter method for the declaration



32
# File 'lib/berkshelf/formatters/base.rb', line 32

formatter_method :search

#show(*args) ⇒ Object

Create a formatter method for the declaration



33
# File 'lib/berkshelf/formatters/base.rb', line 33

formatter_method :show

#skipping(*args) ⇒ Object

Create a formatter method for the declaration



34
# File 'lib/berkshelf/formatters/base.rb', line 34

formatter_method :skipping

#uploaded(*args) ⇒ Object

Create a formatter method for the declaration



35
# File 'lib/berkshelf/formatters/base.rb', line 35

formatter_method :uploaded

#use(*args) ⇒ Object

Create a formatter method for the declaration



36
# File 'lib/berkshelf/formatters/base.rb', line 36

formatter_method :use

#vendor(*args) ⇒ Object

Create a formatter method for the declaration



37
# File 'lib/berkshelf/formatters/base.rb', line 37

formatter_method :vendor

#version(*args) ⇒ Object

Create a formatter method for the declaration



38
# File 'lib/berkshelf/formatters/base.rb', line 38

formatter_method :version

#warn(*args) ⇒ Object

Create a formatter method for the declaration



23
# File 'lib/berkshelf/formatters/base.rb', line 23

formatter_method :warn