class Dependabot::Uv::UpdateChecker::RequirementsUpdater
def add_new_requirement_option(req_string)
def add_new_requirement_option(req_string) option_to_copy = req_string.split(PYPROJECT_OR_SEPARATOR).last .split(PYPROJECT_SEPARATOR).first.strip operator = option_to_copy.gsub(/\d.*/, "").strip new_option = case operator when "", "==", "===" find_and_update_equality_match([option_to_copy]) when "~=", "~", "^" bump_version(option_to_copy, latest_resolvable_version.to_s) else # We don't expect to see OR conditions used with range # operators. If / when we see it, we should handle it. raise "Unexpected operator: #{operator}" end # TODO: Match source spacing "#{req_string.strip} || #{new_option.strip}" end