module Gem::Requirement::OrderIndependentComparison

Public Instance Methods

==(other) click to toggle source
Calls superclass method
# File bundler/rubygems_ext.rb, line 188
def ==(other)
  return unless Gem::Requirement === other

  if _requirements_sorted? && other._requirements_sorted?
    super
  else
    _with_sorted_requirements == other._with_sorted_requirements
  end
end

Protected Instance Methods

_requirements_sorted?() click to toggle source
# File bundler/rubygems_ext.rb, line 200
def _requirements_sorted?
  return @_are_requirements_sorted if defined?(@_are_requirements_sorted)
  strings = as_list
  @_are_requirements_sorted = strings == strings.sort
end
_with_sorted_requirements() click to toggle source
# File bundler/rubygems_ext.rb, line 206
def _with_sorted_requirements
  @_with_sorted_requirements ||= _requirements_sorted? ? self : self.class.new(as_list.sort)
end