Unpacks the gem into the given directory.
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.
Parse obj
, returning an [op, version]
pair. obj
can be a String
or a Gem::Version
.
If obj
is a String
, it can be either a full requirement specification, like ">= 1.2"
, or a simple version number, like "1.2"
.
parse("> 1.0") # => [">", Gem::Version.new("1.0")] parse("1.0") # => ["=", Gem::Version.new("1.0")] parse(Gem::Version.new("1.0")) # => ["=, Gem::Version.new("1.0")]
Concatenates the new
requirements onto this requirement.
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
A list of authors for this gem.
Alternatively, a single author can be specified by assigning a string to spec.author
Usage:
spec.authors = ['John Jones', 'Mary Smith']
The platform this gem runs on.
This is usually Gem::Platform::RUBY or Gem::Platform::CURRENT.
Most gems contain pure Ruby code; they should simply leave the default value in place. Some gems contain C (or other) code to be compiled into a Ruby “extension”. The gem should leave the default value in place unless the code will only compile on a certain type of system. Some gems consist of pre-compiled code (“binary gems”). It’s especially important that they set the platform attribute appropriately. A shortcut is to set the platform to Gem::Platform::CURRENT, which will cause the gem builder to set the platform to the appropriate value for the system on which the build is being performed.
If this attribute is set to a non-default value, it will be included in the filename of the gem when it is built such as: nokogiri-1.6.0-x86-mingw32.gem
Usage:
spec.platform = Gem::Platform.local
Lists the external (to RubyGems) requirements that must be met for this gem to work. It’s simply information for the user.
Usage:
spec.requirements << 'libmagick, v6.0' spec.requirements << 'A good graphics card'
Return a list of all outdated local gem names. This method is HEAVY as it must go fetch specifications from the server.
Use outdated_and_latest_version
if you wish to retrieve the latest remote version as well.
Activate this spec, registering it as a loaded spec and adding it’s lib paths to $LOAD_PATH. Returns true if the spec was activated, false if it was previously activated. Freaks out if there are conflicts upon activation.
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.
Singular reader for authors
. Returns the first author in the list
The list of author names who wrote this gem.
spec.authors = ['Chad Fowler', 'Jim Weirich', 'Rich Kilmer']
The date this gem was created.
If SOURCE_DATE_EPOCH is set as an environment variable, use that to support reproducible builds; otherwise, default to the current UTC date.
Details on SOURCE_DATE_EPOCH: reproducible-builds.org/specs/source-date-epoch/
The date this gem was created
DO NOT set this, it is set automatically when the gem is packaged.
The platform this gem runs on. See Gem::Platform
for details.
Set
requirements to req
, ensuring it is an array.
Checks that the specification contains all required fields, and does a very basic sanity check.
Raises InvalidSpecificationException if the spec does not pass the checks..
Does a sanity check on the specification.
Raises InvalidSpecificationException if the spec does not pass the checks.
It also performs some validations that do not raise but print warning messages instead.
Parses uri, raising if it’s invalid