From 8d2bcc88ffe603290099d626cab40afcc834a12f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Wed, 24 Aug 2022 08:51:47 +0200 Subject: [PATCH] [rubygems/rubygems] This sorting seems unnecessary too https://github.com/rubygems/rubygems/commit/823cb1fef9 --- lib/bundler/dsl.rb | 1 - lib/bundler/index.rb | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb index 385fdd4383..547db16190 100644 --- a/lib/bundler/dsl.rb +++ b/lib/bundler/dsl.rb @@ -67,7 +67,6 @@ module Bundler gemspecs = Gem::Util.glob_files_in_dir("{,*}.gemspec", expanded_path).map {|g| Bundler.load_gemspec(g) }.compact gemspecs.reject! {|s| s.name != name } if name - Index.sort_specs(gemspecs) specs_by_name_and_version = gemspecs.group_by {|s| [s.name, s.version] } case specs_by_name_and_version.size diff --git a/lib/bundler/index.rb b/lib/bundler/index.rb index 00c7a9e00d..c639936cb0 100644 --- a/lib/bundler/index.rb +++ b/lib/bundler/index.rb @@ -78,17 +78,13 @@ module Bundler end protected :unsorted_search - def self.sort_specs(specs) + def sort_specs(specs) specs.sort_by do |s| platform_string = s.platform.to_s [s.version, platform_string == RUBY ? NULL : platform_string] end end - def sort_specs(specs) - self.class.sort_specs(specs) - end - def local_search(query) case query when Gem::Specification, RemoteSpecification, LazySpecification, EndpointSpecification then search_by_spec(query)