End of Life Ruby 3.1 has reached end of life and gets no more fixes. 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-3.1.3/lib/rubygems/local_remote_options.rb, line 102
def add_source_option
accept_uri_http
add_option(:"Local/Remote", "-s", "--source URL", URI::HTTP,
"Append URL to list of remote gem sources") do |source, options|
source << "/" if source !~ /\/\z/
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.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0