Factory method to create a Gem::Requirement
object. Input may be a Version, a String
, or nil. Intended to simplify client code.
If the input is “weird”, the default version requirement is returned.
Factory method to create a Version
object. Input may be a Version
or a String
. Intended to simplify client code.
ver1 = Version.create('1.3.17') # -> (Version object) ver2 = Version.create(ver1) # -> (ver1) ver3 = Version.create(nil) # -> nil
The release for this version (e.g. 1.2.0.a -> 1.2.0). Non-prerelease versions return themselves.
Replaces this SourceList
with the sources in other
See <<
for acceptable items in other
.
Returns true if there are no sources in this SourceList
.
Reset the list of known specs, running pre and post reset hooks registered in Gem
.
Abbreviate the spec for downloading. Abbreviated specs are only used for searching, downloading and related activities and do not need deployment specific information (e.g. list of files). So we abbreviate the spec, making it much smaller for quicker downloads.
Recursively walk dependencies of this spec, executing the block
for each hop.
Parses and redacts uri
An ‘empty?` line is one that was originally left empty in the source code, while a “hidden” line is one that we’ve since marked as “invisible”
Replaces self by other URI
object.
v
Public setter for the scheme component v
(with validation).
See also URI::Generic.check_scheme
.
require 'uri' uri = URI.parse("http://my.example.com") uri.scheme = "https" uri.to_s #=> "https://my.example.com"
Converts the contents of the database to an in-memory Hash
, then calls Hash#reject
with the specified code block, returning a new Hash
.
Returns a Hash
(not a DBM
database) created by using each value in the database as a key, with the corresponding key as its value.
Note that all values in the hash will be Strings, but the keys will be actual objects.
Replaces the contents of the database with the contents of the specified object. Takes any object which implements the each_pair
method, including Hash
and DBM
objects.
Returns true
if the queue is empty.
The queue can’t be frozen, so this method raises an exception:
Thread::Queue.new.freeze # Raises TypeError (cannot freeze #<Thread::Queue:0x...>)
Returns true
if the queue is empty.
Returns true
if key
is a key in self
, otherwise false
.