class Berkshelf::Lockfile::Graph
def locks
-
(Hash
-)
def locks @graph.sort.inject({}) do |hash, (name, item)| dependency = @lockfile.find(name) || @berksfile && @berksfile.find(name) || Dependency.new(@berksfile, name) # We need to make a copy of the dependency, or else we could be # modifying an existing object that other processes depend on! dependency = dependency.dup dependency.locked_version = item.version unless dependency.locked_version hash[item.name] = dependency hash end end