Class: Omnibus::ManifestDiff
- Inherits:
-
Object
- Object
- Omnibus::ManifestDiff
- Defined in:
- lib/omnibus/manifest_diff.rb
Instance Method Summary collapse
- #added ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(first, second) ⇒ ManifestDiff
constructor
A new instance of ManifestDiff.
- #removed ⇒ Object
- #updated ⇒ Object
Constructor Details
#initialize(first, second) ⇒ ManifestDiff
Returns a new instance of ManifestDiff.
21 22 23 24 |
# File 'lib/omnibus/manifest_diff.rb', line 21 def initialize(first, second) @first = first @second = second end |
Instance Method Details
#added ⇒ Object
40 41 42 43 44 45 |
# File 'lib/omnibus/manifest_diff.rb', line 40 def added @added ||= (second.entry_names - first.entry_names).collect do |name| new_entry(second.entry_for(name)) end end |
#empty? ⇒ Boolean
47 48 49 |
# File 'lib/omnibus/manifest_diff.rb', line 47 def empty? updated.empty? && removed.empty? && added.empty? end |
#removed ⇒ Object
33 34 35 36 37 38 |
# File 'lib/omnibus/manifest_diff.rb', line 33 def removed @removed ||= (first.entry_names - second.entry_names).collect do |name| removed_entry(first.entry_for(name)) end end |
#updated ⇒ Object
26 27 28 29 30 31 |
# File 'lib/omnibus/manifest_diff.rb', line 26 def updated @updated ||= (first.entry_names & second.entry_names).collect do |name| diff(first.entry_for(name), second.entry_for(name)) end.compact end |