class Dependabot::Uv::UpdateChecker::RequirementsUpdater
def convert_to_range(req_string, version_to_be_permitted)
def convert_to_range(req_string, version_to_be_permitted) # Construct an upper bound at the same precision that the original # requirement was at (taking into account ~ dynamics) index_to_update = index_to_update_for(req_string) ub_segments = version_to_be_permitted.segments ub_segments << 0 while ub_segments.count <= index_to_update ub_segments = ub_segments[0..index_to_update] ub_segments[index_to_update] += 1 lb_segments = lower_bound_segments_for_req(req_string) # Ensure versions have the same length as each other (cosmetic) length = [lb_segments.count, ub_segments.count].max lb_segments.fill(0, lb_segments.count...length) ub_segments.fill(0, ub_segments.count...length) ">=#{lb_segments.join('.')},<#{ub_segments.join('.')}" end