End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Gem::Specification#initialize_copy
initialize_copy(other_spec)
lib/rubygems/specification.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.2.0/lib/rubygems/specification.rb, line 2053
def initialize_copy(other_spec)
self.class.array_attributes.each do |name|
name = :"@#{name}"
next unless other_spec.instance_variable_defined? name
begin
val = other_spec.instance_variable_get(name)
if val
instance_variable_set name, val.dup
elsif Gem.configuration.really_verbose
warn "WARNING: #{full_name} has an invalid nil value for #{name}"
end
rescue TypeError
e = Gem::FormatException.new \
"#{full_name} has an invalid value for #{name}"
e.file_path = loaded_from
raise e
end
end
end
Duplicates array_attributes from other_spec so state isn’t shared.
See also
#has_conflicts?
#invalidate_memoized_attributes
#gems_dir
#keep_only_files_and_directories
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0