class Bundler::Definition

def check_lockfile

def check_lockfile
  @missing_lockfile_dep = nil
  @locked_spec_with_invalid_deps = nil
  @locked_spec_with_missing_deps = nil
  missing = []
  invalid = []
  @locked_specs.each do |s|
    validation = @locked_specs.validate_deps(s)
    missing << s if validation == :missing
    invalid << s if validation == :invalid
  end
  if missing.any?
    @locked_specs.delete(missing)
    @locked_spec_with_missing_deps = missing.first.name
  elsif !@dependency_changes
    @missing_lockfile_dep = current_dependencies.find do |d|
      @locked_specs[d.name].empty? && d.name != "bundler"
    end&.name
  end
  if invalid.any?
    @locked_specs.delete(invalid)
    @locked_spec_with_invalid_deps = invalid.first.name
  end
end