diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-01-10 13:53:41 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-01-10 15:53:07 +0900 |
commit | a43f1d90c2b3aed232d5f4ef9dfe226401cf5d81 (patch) | |
tree | dcb61dd3ab8434242b81d54e8e16b4c4d86d5b8c /lib/bundler/resolver | |
parent | 89fb61f9a3276121da2826b93f131e52d6449859 (diff) |
Merge RubyGems and Bundler master
from https://github.com/rubygems/rubygems/commit/0635c1423db5d7c461d53bf0c3329bca75de7609
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7094
Diffstat (limited to 'lib/bundler/resolver')
-rw-r--r-- | lib/bundler/resolver/candidate.rb | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/bundler/resolver/candidate.rb b/lib/bundler/resolver/candidate.rb index cf5691ccc7..681f9aca73 100644 --- a/lib/bundler/resolver/candidate.rb +++ b/lib/bundler/resolver/candidate.rb @@ -41,6 +41,18 @@ module Bundler @spec_group.to_specs(package.force_ruby_platform?) end + def generic! + @ruby_only = true + + self + end + + def platform_specific! + @ruby_only = false + + self + end + def prerelease? @version.prerelease? end @@ -53,27 +65,20 @@ module Bundler [@version, @ruby_only ? -1 : 1] end - def canonical? - !@spec_group.empty? - end - def <=>(other) return unless other.is_a?(self.class) - return @version <=> other.version unless canonical? && other.canonical? sort_obj <=> other.sort_obj end def ==(other) return unless other.is_a?(self.class) - return @version == other.version unless canonical? && other.canonical? sort_obj == other.sort_obj end def eql?(other) return unless other.is_a?(self.class) - return @version.eql?(other.version) unless canonical? || other.canonical? sort_obj.eql?(other.sort_obj) end |