module Gem::Requirement::OrderIndependentComparison

Public Instance Methods

==(other) click to toggle source
Calls superclass method
# File bundler/rubygems_ext.rb, line 213
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 225
def _requirements_sorted?
  return @_requirements_sorted if defined?(@_requirements_sorted)
  strings = as_list
  @_requirements_sorted = strings == strings.sort
end
_with_sorted_requirements() click to toggle source
# File bundler/rubygems_ext.rb, line 231
def _with_sorted_requirements
  @_with_sorted_requirements ||= _requirements_sorted? ? self : self.class.new(as_list.sort)
end