class Bundler::Injector

def remove(gemfile_path, lockfile_path)

Returns:
  • (Array) -

Parameters:
  • lockfile_path (Pathname) -- The lockfile from which to remove dependencies.
  • gemfile_path (Pathname) -- The Gemfile from which to remove dependencies.
def remove(gemfile_path, lockfile_path)
  # remove gems from each gemfiles we have
  Bundler.definition.gemfiles.each do |path|
    deps = remove_deps(path)
    show_warning("No gems were removed from the gemfile.") if deps.empty?
    deps.each {|dep| Bundler.ui.confirm "#{SharedHelpers.pretty_dependency(dep)} was removed." }
  end
  # Invalidate the cached Bundler.definition.
  # This prevents e.g. `bundle remove ...` from using outdated information.
  Bundler.reset_paths!
end