lib/berkshelf/lockfile.rb in berkshelf-3.0.1 vs lib/berkshelf/lockfile.rb in berkshelf-3.1.0

- old
+ new

@@ -577,10 +577,12 @@ end end # The class representing an internal graph. class Graph + include Enumerable + # Create a new Lockfile graph. # # Some clarifying terminology: # # yum-epel (0.2.0) <- lock @@ -589,9 +591,14 @@ # @return [Graph] def initialize(lockfile) @lockfile = lockfile @berksfile = lockfile.berksfile @graph = {} + end + + # @yield [Hash<String] + def each(&block) + @graph.values.each(&block) end # The list of locks for this graph. Dependencies are retrieved from the # lockfile, then the Berksfile, and finally a new dependency object is # created if none of those exist.