class Bundler::VersionRanges::ReqR

Parent:
Object

Constants

Endpoint
INFINITY
UNIVERSAL
ZERO

Public Instance Methods

<=>(other) Show source
# File lib/bundler/version_ranges.rb, line 66
def <=>(other)
  return -1 if other.equal?(INFINITY)

  comp = left <=> other.left
  return comp unless comp.zero?

  right <=> other.right
end
cover?(v) Show source
# File lib/bundler/version_ranges.rb, line 46
def cover?(v)
  return false if left.inclusive && left.version > v
  return false if !left.inclusive && left.version >= v

  if right.version != INFINITY
    return false if right.inclusive && right.version < v
    return false if !right.inclusive && right.version <= v
  end

  true
end
empty?() Show source
# File lib/bundler/version_ranges.rb, line 58
def empty?
  left.version == right.version && !(left.inclusive && right.inclusive)
end
single?() Show source
# File lib/bundler/version_ranges.rb, line 62
def single?
  left.version == right.version
end
to_s() Show source
# File lib/bundler/version_ranges.rb, line 30
def to_s
  "#{left.inclusive ? "[" : "("}#{left.version}, #{right.version}#{right.inclusive ? "]" : ")"}"
end

Ruby Core © 1993–2017 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.