End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Gem::Specification.new
new(name = nil, version = nil) { |self| ... }
lib/rubygems/specification.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.2.0/lib/rubygems/specification.rb, line 2025
def initialize(name = nil, version = nil)
super()
@gems_dir = nil
@base_dir = nil
@loaded = false
@activated = false
@loaded_from = nil
@original_platform = nil
@installed_by_version = nil
set_nil_attributes_to_nil
set_not_nil_attributes_to_default_values
@new_platform = Gem::Platform::RUBY
self.name = name if name
self.version = version if version
if (platform = Gem.platforms.last) && platform != Gem::Platform::RUBY && platform != Gem::Platform.local
self.platform = platform
end
yield self if block_given?
end
Specification constructor. Assigns the default values to the attributes and yields itself for further initialization. Optionally takes name and version.
See also
.load_defaults
.non_nil_attributes
.load
.normalize_yaml_input
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0