End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Gem::Specification#reset_nil_attributes_to_default
reset_nil_attributes_to_default
lib/rubygems/specification.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/rubygems/specification.rb, line 2653
def reset_nil_attributes_to_default
nil_attributes = self.class.non_nil_attributes.find_all do |name|
!instance_variable_defined?("@#{name}") || instance_variable_get("@#{name}").nil?
end
nil_attributes.each do |attribute|
default = self.default_value attribute
value = case default
when Time, Numeric, Symbol, true, false, nil then default
else default.dup
end
instance_variable_set "@#{attribute}", value
end
@installed_by_version ||= nil
end
Reset nil attributes to their default values to make the spec valid
See also
#require_paths=
#ri_dir
#require_path=
#ruby_code
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1