Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove deprecated Gem::Requirement#<=> and Comparable

It is described that "will be removed on or after 2011-12".
  • Loading branch information...
commit 014471a093910d82190cd3285850270e30e7074b 1 parent bf42e7f
@kou kou authored
Showing with 0 additions and 25 deletions.
  1. +0 −15 lib/rubygems/requirement.rb
  2. +0 −10 test/rubygems/test_gem_requirement.rb
View
15 lib/rubygems/requirement.rb
@@ -16,8 +16,6 @@
Gem.load_yaml if defined? ::YAML
class Gem::Requirement
- include Comparable
-
OPS = { #:nodoc:
"=" => lambda { |v, r| v == r },
"!=" => lambda { |v, r| v != r },
@@ -215,24 +213,11 @@ def to_s # :nodoc:
as_list.join ", "
end
- def <=> other # :nodoc:
- return unless Gem::Requirement === other
-
- # TODO: remove this method: comparing requirements doesn't even make sense
- to_s <=> other.to_s
- end
-
# DOC: this should probably be :nodoc'd
def == other
Gem::Requirement === other and to_s == other.to_s
end
- extend Gem::Deprecate
-
- %w(<=> < > <= >=).each do |name|
- deprecate name, :none, 2011, 12
- end
-
private
# DOC: this should probably be :nodoc'd
View
10 test/rubygems/test_gem_requirement.rb
@@ -281,16 +281,6 @@ def test_satisfied_by_boxed
refute_satisfied_by "2.0", "~> 1.4.4"
end
- def test_spaceship
- Gem::Deprecate.skip_during do
- assert_equal(-1, req("= 0") <=> req("= 1"))
- assert_equal 0, req("= 0") <=> req("= 0")
- assert_equal 1, req("= 1") <=> req("= 0")
-
- assert_nil req("= 1") <=> v("42")
- end
- end
-
def test_specific
refute req('> 1') .specific?
refute req('>= 1').specific?
Please sign in to comment.
Something went wrong with that request. Please try again.