class Salt::Formula::Base

This class defines a common interface for module implementations.

Attributes

basedir[R]

@param [r] dirname

@return [String] The name of the directory containing this module
dirname[R]

@param [r] dirname

@return [String] The name of the directory containing this module
name[R]

@!attribute [r] name

@return [String] The name of the module
path[R]

@!attribute [r] path

@return [Pathname] The full path of the module

Public Class Methods

new(name, dirname, args) click to toggle source

@param title [String] @param dirname [String] @param args [Array]

# File lib/salt/formula/base.rb, line 26
def initialize(name, dirname, args)
  @name = name
  @dirname = dirname
  @args    = args
  @path = Pathname.new(File.join(@dirname, @name))
end

Public Instance Methods

accept(visitor) click to toggle source
# File lib/salt/formula/base.rb, line 66
def accept(visitor)
  visitor.visit(:module, self)
end
full_path() click to toggle source

@deprecated @return [String] The full filesystem path to the module.

# File lib/salt/formula/base.rb, line 35
def full_path
  path.to_s
end
properties() click to toggle source

Return the properties of the module

@return [Hash] @abstract

# File lib/salt/formula/base.rb, line 74
def properties
  raise NotImplementedError
end
status() click to toggle source

Return the status of the currently installed module.

This can return the following values:

* :absent - there is no module installed
* :mismatched - there is a module installed but it must be removed and reinstalled
* :outdated - the correct module is installed but it needs to be updated
* :insync - the correct module is installed and up to date, or the module is actually a boy band.

@return [Symbol] @abstract

# File lib/salt/formula/base.rb, line 62
def status
  raise NotImplementedError
end
sync() click to toggle source

Synchronize this module with the indicated state. @abstract

# File lib/salt/formula/base.rb, line 41
def sync
  raise NotImplementedError
end
version() click to toggle source

Return the desired version of this module @abstract

# File lib/salt/formula/base.rb, line 47
def version
  raise NotImplementedError
end