End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Gem::Specification.normalize_yaml_input
normalize_yaml_input(input)
lib/rubygems/specification.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/rubygems/specification.rb, line 1163
def self.normalize_yaml_input(input)
result = input.respond_to?(:read) ? input.read : input
result = "--- " + result unless result.start_with?("--- ")
result = result.dup
result.gsub!(/ !!null \n/, " \n")
# date: 2011-04-26 00:00:00.000000000Z
# date: 2011-04-26 00:00:00.000000000 Z
result.gsub!(/^(date: \d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d+?)Z/, '\1 Z')
result
end
Make sure the YAML specification is properly formatted with dashes
See also
.non_nil_attributes
.outdated
.new
.outdated_and_latest_version
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1