Class: Puppetfiler::Metadata
- Inherits:
-
Object
- Object
- Puppetfiler::Metadata
- Defined in:
- lib/puppetfiler/metadata.rb
Instance Attribute Summary collapse
-
#dependencies ⇒ Object
readonly
Returns the value of attribute dependencies.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
- #fixture(modifiers = {}) ⇒ Object
-
#initialize(target) ⇒ Metadata
constructor
A new instance of Metadata.
- #updates ⇒ Object
Constructor Details
#initialize(target) ⇒ Metadata
Returns a new instance of Metadata.
9 10 11 12 13 |
# File 'lib/puppetfiler/metadata.rb', line 9 def initialize(target) @dependencies = {} parse target end |
Instance Attribute Details
#dependencies ⇒ Object (readonly)
Returns the value of attribute dependencies.
7 8 9 |
# File 'lib/puppetfiler/metadata.rb', line 7 def dependencies @dependencies end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
8 9 10 |
# File 'lib/puppetfiler/metadata.rb', line 8 def path @path end |
Instance Method Details
#eql?(other) ⇒ Boolean
19 20 21 |
# File 'lib/puppetfiler/metadata.rb', line 19 def eql?(other) @dependencies.eql?(other.dependencies) end |
#fixture(modifiers = {}) ⇒ Object
15 16 17 |
# File 'lib/puppetfiler/metadata.rb', line 15 def fixture(modifiers = {}) Puppetfiler::Fixture.fixture(@dependencies, {}, modifiers) end |
#updates ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/puppetfiler/metadata.rb', line 23 def updates require 'concurrent' updates = {} deps = @dependencies.map do |name, dep| Concurrent::Future.execute do latest = dep.latest if not dep.range.cover?(latest) updates[name] = { :range => dep.range, :newest => latest, } end end end deps.each { |f| f.wait_or_cancel(300) } return updates end |