A Requirement is a set of one or more version restrictions. It supports a few (=, !=, >, <, >=, <=, ~>) different restriction operators.

See Gem::Version for a description on how versions and requirements work together in RubyGems.

Constants

OPS

No documentation available
No documentation available
No documentation available

A regular expression that matches a requirement

The default requirement matches any version

Class Methods

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.

A default “version requirement” can surely only be ‘>= 0’.

Constructs a requirement from requirements. Requirements can be Strings, Gem::Versions, or Arrays of those. nil and duplicate requirements are ignored. An empty set of requirements is the same as ">= 0".

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")]
Instance Methods
An alias for satisfied_by?
An alias for satisfied_by?
No documentation available

Concatenates the new requirements onto this requirement.

Backport of performance enhancement added to RubyGems 2.2

Backport of performance enhancement added to RubyGems 1.4

A requirement is a prerelease if any of the versions inside of it are prereleases

True if version satisfies this Requirement.

True if the requirement will not always match the latest version.