Class: R10K::Source::Base
- Inherits:
-
Object
- Object
- R10K::Source::Base
- Defined in:
- lib/r10k/source/base.rb
Overview
This class defines a common interface for source implementations.
Instance Attribute Summary collapse
- #basedir ⇒ Object readonly
- #name ⇒ Object readonly
- #prefix ⇒ Object readonly
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
-
#environments ⇒ Array<R10K::Environment::Base>
abstract
Enumerate the environments associated with this SVN source.
-
#initialize(name, basedir, options = {}) ⇒ Base
constructor
Initialize the given source.
-
#preload! ⇒ void
abstract
Perform any actions needed for loading environments that may have side effects.
Constructor Details
#initialize(name, basedir, options = {}) ⇒ Base
Initialize the given source.
29 30 31 32 33 34 |
# File 'lib/r10k/source/base.rb', line 29 def initialize(name, basedir, = {}) @name = name @basedir = basedir @prefix = .delete(:prefix) @options = end |
Instance Attribute Details
#basedir ⇒ Object (readonly)
8 9 10 |
# File 'lib/r10k/source/base.rb', line 8 def basedir @basedir end |
#name ⇒ Object (readonly)
12 13 14 |
# File 'lib/r10k/source/base.rb', line 12 def name @name end |
#prefix ⇒ Object (readonly)
17 18 19 |
# File 'lib/r10k/source/base.rb', line 17 def prefix @prefix end |
Instance Method Details
#accept(visitor) ⇒ Object
61 62 63 64 65 66 67 |
# File 'lib/r10k/source/base.rb', line 61 def accept(visitor) visitor.visit(:source, self) do environments.each do |env| env.accept(visitor) end end end |
#environments ⇒ Array<R10K::Environment::Base>
This method is abstract.
Enumerate the environments associated with this SVN source.
57 58 59 |
# File 'lib/r10k/source/base.rb', line 57 def environments raise NotImplementedError, "#{self.class} has not implemented method #{__method__}" end |
#preload! ⇒ void
This method is abstract.
This method returns an undefined value.
Perform any actions needed for loading environments that may have side effects.
Actions done during preloading may include things like updating caches or performing network queries. If an environment has not been preloaded but #environments is invoked, it should return the best known state of environments or return an empty list.
47 48 49 |
# File 'lib/r10k/source/base.rb', line 47 def preload! end |