Class: Librarian::Puppet::Dependency
- Inherits:
-
Dependency
- Object
- Dependency
- Librarian::Puppet::Dependency
- Includes:
- Util
- Defined in:
- lib/librarian/puppet/dependency.rb
Instance Attribute Summary collapse
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
-
#initialize(name, requirement, source, parent = nil) ⇒ Dependency
constructor
A new instance of Dependency.
- #to_s ⇒ Object
Methods included from Util
#clean_uri, #cp_r, #debug, #info, #module_name, #normalize_name, #rsync?, #warn
Constructor Details
#initialize(name, requirement, source, parent = nil) ⇒ Dependency
Returns a new instance of Dependency.
11 12 13 14 15 16 17 |
# File 'lib/librarian/puppet/dependency.rb', line 11 def initialize(name, requirement, source, parent = nil) # Issue #235 fail if forge source is not defined raise Error, "forge entry is not defined in Puppetfile" if source.instance_of?(Array) && source.empty? self.parent = parent super(normalize_name(name), requirement, source) end |
Instance Attribute Details
#parent ⇒ Object
Returns the value of attribute parent.
8 9 10 |
# File 'lib/librarian/puppet/dependency.rb', line 8 def parent @parent end |
Instance Method Details
#to_s ⇒ Object
19 20 21 |
# File 'lib/librarian/puppet/dependency.rb', line 19 def to_s "#{name} (#{requirement}) <#{source}> (from #{parent.nil? ? '<nil>' : parent})" end |