123456789_123456789_123456789_123456789_123456789_

Module: Gem::SplitCompactIndexEntryOnFirstColon

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: lib/bundler/rubygems_ext.rb

Overview

RubyGems before 4.0.13 split compact index dependency/requirement entries on every colon, which mangles metadata values that contain colons such as the created_at timestamps the cooldown feature relies on. Split only on the first colon so those values survive on older RubyGems.

The module is defined unconditionally so it stays testable on any RubyGems, but only prepended when the host RubyGems still has the buggy behavior.

Instance Method Summary

Instance Method Details

#parse_dependency(string) (private)

[ GitHub ]

  
# File 'lib/bundler/rubygems_ext.rb', line 478

def parse_dependency(string)
  dependency = string.split(":", 2)
  dependency[-1] = dependency[-1].split("&") if dependency.size > 1
  dependency[0] = -dependency[0]
  dependency
end