class Dependabot::Uv::FileUpdater::RequirementReplacer

def original_dependency_declaration_string(old_req)

def original_dependency_declaration_string(old_req)
  matches = []
  dec =
    if old_req.nil?
      regex = RequirementParser::INSTALL_REQ_WITHOUT_REQUIREMENT
      content.scan(regex) { matches << Regexp.last_match }
      matches.find { |m| normalise(m[:name]) == dependency_name }
    else
      regex = RequirementParser::INSTALL_REQ_WITH_REQUIREMENT
      content.scan(regex) { matches << Regexp.last_match }
      matches
        .select { |m| normalise(m[:name]) == dependency_name }
        .find { |m| requirements_match(m[:requirements], old_req) }
    end
  raise "Declaration not found for #{dependency_name}!" unless dec
  dec.to_s.strip
end