The SourceList represents the sources rubygems has been configured to use. A source may be created from an array of sources:

Gem::SourceList.from %w[https://rubygems.example https://internal.example]

Or by adding them:

sources = Gem::SourceList.new
sources << 'https://rubygems.example'

The most common way to get a SourceList is Gem.sources.

Attributes
Read

The sources in this list

Class Methods

Creates a new SourceList from an array of sources.

Creates a new SourceList

Instance Methods

Appends obj to the source list which may be a Gem::Source, URI or URI String.

Removes all sources from the SourceList.

Deletes source from the source list which may be a Gem::Source or a URI.

Yields each source URI in the list.

Yields each source in the list.

Returns true if there are no sources in this SourceList.

Returns the first source in the list.

Returns true if this source list includes other which may be a Gem::Source or a source URI.

Replaces this SourceList with the sources in other See << for acceptable items in other.

Returns an Array of source URI Strings.

An alias for to_a