Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Gem::Commands::BuildCommand#build_package
build_package(gemspec)
lib/rubygems/commands/build_command.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/rubygems/commands/build_command.rb, line 103
def build_package(gemspec)
spec = Gem::Specification.load(gemspec)
if spec
# Gem::Specification#initialize applies --platform unless it is the local platform
if options[:added_platform] && spec.platform == Gem::Platform::RUBY && Gem.platforms.last == Gem::Platform.local
spec.platform = Gem::Platform.local
end
ruby_abi = options[:ruby_abi]
if ruby_abi
requirement = Gem::ContentAddress.ruby_abi_requirement(ruby_abi)
existing = spec.required_ruby_version
unless existing.none? || existing == requirement
alert_warning "required_ruby_version was changed from \"#{existing}\" to \"#{requirement}\" for this build " \
"because --ruby-abi #{ruby_abi} was given."
end
spec.required_ruby_version = requirement
end
Gem::Package.build(
spec,
options[:force],
options[:strict],
options[:output],
content_addressable: options[:content_addressable]
)
else
alert_error "Error loading gemspec. Aborting."
terminate_interaction 1
end
end
No documentation available