summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2022-08-24 08:51:47 +0200
committergit <svn-admin@ruby-lang.org>2022-09-12 22:13:29 +0900
commit8d2bcc88ffe603290099d626cab40afcc834a12f (patch)
treef22bdbdbb55d3e61a366632cb2ed689947a21523
parenta4860e043e073e9caa2494284df4af10ca6550da (diff)
[rubygems/rubygems] This sorting seems unnecessary too
https://github.com/rubygems/rubygems/commit/823cb1fef9
-rw-r--r--lib/bundler/dsl.rb1
-rw-r--r--lib/bundler/index.rb6
2 files changed, 1 insertions, 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)