Class: R10K::Module::Base
- Inherits:
-
Object
- Object
- R10K::Module::Base
- Defined in:
- lib/r10k/module/base.rb
Overview
This class defines a common interface for module implementations.
Instance Attribute Summary collapse
- #dirname ⇒ Object (also: #basedir) readonly
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#owner ⇒ Object
(also: #author)
readonly
Returns the value of attribute owner.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#title ⇒ Object
(also: #full_name)
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #full_path ⇒ String deprecated Deprecated.
-
#initialize(title, dirname, args) ⇒ Base
constructor
A new instance of Base.
-
#properties ⇒ Hash
abstract
Return the properties of the module.
-
#status ⇒ Symbol
abstract
Return the status of the currently installed module.
-
#sync ⇒ Object
abstract
Synchronize this module with the indicated state.
-
#version ⇒ Object
abstract
Return the desired version of this module.
Constructor Details
#initialize(title, dirname, args) ⇒ Base
Returns a new instance of Base.
39 40 41 42 43 44 45 |
# File 'lib/r10k/module/base.rb', line 39 def initialize(title, dirname, args) @title = PuppetForge::V3.normalize_name(title) @dirname = dirname @args = args @owner, @name = parse_title(@title) @path = Pathname.new(File.join(@dirname, @name)) end |
Instance Attribute Details
#dirname ⇒ Object (readonly) Also known as: basedir
17 18 19 |
# File 'lib/r10k/module/base.rb', line 17 def dirname @dirname end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
13 14 15 |
# File 'lib/r10k/module/base.rb', line 13 def name @name end |
#owner ⇒ Object (readonly) Also known as:
Returns the value of attribute owner.
24 25 26 |
# File 'lib/r10k/module/base.rb', line 24 def owner @owner end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
28 29 30 |
# File 'lib/r10k/module/base.rb', line 28 def path @path end |
#title ⇒ Object (readonly) Also known as: full_name
Returns the value of attribute title.
9 10 11 |
# File 'lib/r10k/module/base.rb', line 9 def title @title end |
Instance Method Details
#accept(visitor) ⇒ Object
80 81 82 |
# File 'lib/r10k/module/base.rb', line 80 def accept(visitor) visitor.visit(:module, self) end |
#full_path ⇒ String
Returns The full filesystem path to the module.
49 50 51 |
# File 'lib/r10k/module/base.rb', line 49 def full_path path.to_s end |
#properties ⇒ Hash
Return the properties of the module
88 89 90 |
# File 'lib/r10k/module/base.rb', line 88 def properties raise NotImplementedError end |
#status ⇒ Symbol
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.
76 77 78 |
# File 'lib/r10k/module/base.rb', line 76 def status raise NotImplementedError end |
#sync ⇒ Object
Synchronize this module with the indicated state.
55 56 57 |
# File 'lib/r10k/module/base.rb', line 55 def sync raise NotImplementedError end |
#version ⇒ Object
Return the desired version of this module
61 62 63 |
# File 'lib/r10k/module/base.rb', line 61 def version raise NotImplementedError end |