class Berkshelf::Lockfile::Graph

def remove(dependency, options = {})

Options Hash: (**options)
  • :ignore (String, Array) --

Parameters:
  • dependency (Dependency, String) --
def remove(dependency, options = {})
  name = Dependency.name(dependency)
  if @lockfile.dependency?(name)
    return
  end
  if dependency?(name, options)
    return
  end
  # Grab the nested dependencies for this particular entry so we can
  # recurse and try to remove them from the graph.
  locked = @graph[name]
  nested_dependencies = locked && locked.dependencies.keys || []
  # Now delete the entry
  @graph.delete(name)
  # Recursively try to delete the remaining dependencies for this item
  nested_dependencies.each(&method(:remove))
end