Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Gem::LocalRemoteOptions#add_source_option
add_source_option
lib/rubygems/local_remote_options.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/rubygems/local_remote_options.rb, line 101
def add_source_option
accept_uri_http
add_option(:"Local/Remote", "-s", "--source URL", Gem::URI::HTTP,
"Append URL to list of remote gem sources") do |source, options|
source << "/" unless source.end_with?("/")
if options.delete :sources_cleared
Gem.sources = [source]
else
Gem.sources << source unless Gem.sources.include?(source)
end
end
end
Add the –source option
See also
#add_proxy_option
#add_update_sources_option
#add_local_remote_options
#both?
also in
4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0