Class: Bundler::PubGrub::VersionConstraint
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb |
Class Method Summary
Instance Attribute Summary
-
#any? ⇒ Boolean
readonly
Does this match every version of the package.
- #empty? ⇒ Boolean readonly
- #package readonly
- #range readonly
Instance Method Summary
- #==(other)
- #allows_all?(other) ⇒ Boolean
- #allows_any?(other) ⇒ Boolean
- #constraint_string
- #difference(other)
- #disjoint?(other) ⇒ Boolean
- #eql?(other) ⇒ Boolean
- #hash
- #inspect
- #intersect(other)
- #invert
- #overlap?(other) ⇒ Boolean
- #relation(other)
- #subset?(other) ⇒ Boolean
- #to_s(allow_every: false)
- #union(other)
Constructor Details
.new(package, range: nil) ⇒ VersionConstraint
Class Method Details
.any(package)
[ GitHub ]# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb', line 34
def any(package) new(package, range: VersionRange.any) end
.empty(package)
[ GitHub ]# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb', line 38
def empty(package) new(package, range: VersionRange.empty) end
.exact(package, version)
[ GitHub ]Instance Attribute Details
#any? ⇒ Boolean
(readonly)
Does this match every version of the package
# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb', line 121
def any? range.any? end
#empty? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb', line 116
def empty? range.empty? end
#package (readonly)
[ GitHub ]# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb', line 5
attr_reader :package, :range
#range (readonly)
[ GitHub ]# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb', line 5
attr_reader :package, :range
Instance Method Details
#==(other)
[ GitHub ]
#allows_all?(other) ⇒ Boolean
#allows_any?(other) ⇒ Boolean
#constraint_string
[ GitHub ]#difference(other)
[ GitHub ]
#disjoint?(other) ⇒ Boolean
# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb', line 84
def disjoint?(other) !overlap?(other) end
#eql?(other) ⇒ Boolean
#hash
[ GitHub ]#inspect
[ GitHub ]# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb', line 125
def inspect "#<#{self.class} #{self}>" end
#intersect(other)
[ GitHub ]#invert
[ GitHub ]
#overlap?(other) ⇒ Boolean
# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb', line 80
def overlap?(other) other.allows_any?(self) end
#relation(other)
[ GitHub ]
#subset?(other) ⇒ Boolean
# File 'lib/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb', line 76
def subset?(other) other.allows_all?(self) end