class Berkshelf::Lockfile::Graph

def to_lock

Returns:
  • (String) -

Other tags:
    Example: lockfile.graph.to_lock #=> "GRAPH\n apache2 (1.18.14)\n..." -
def to_lock
  out = "#{Lockfile::GRAPH}\n"
  @graph.sort.each do |name, item|
    out << "  #{name} (#{item.version})\n"
    unless item.dependencies.empty?
      item.dependencies.sort.each do |dep_name, constraint|
        out << "    #{dep_name} (#{constraint})\n"
      end
    end
  end
  out
end