summaryrefslogtreecommitdiff
path: root/lib/rubygems/spec_fetcher.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <[email protected]>2020-06-10 19:46:05 +0200
committerHiroshi SHIBATA <[email protected]>2020-06-15 21:20:37 +0900
commit955f1837a180d8936f90ab6cf039ccb8f751be72 ()
tree0d48749501febfccefda3b1376511c421d4118e4 /lib/rubygems/spec_fetcher.rb
parentef481c120c55bf0351a586739f9b5d704f3f7a7d (diff)
Use space inside block braces everywhere
To make rubygems code style consistent with bundler.
Notes: Merged: https://.com/ruby/ruby/pull/3229
-rw-r--r--lib/rubygems/spec_fetcher.rb12
1 files changed, 6 insertions, 6 deletions
@@ -92,8 +92,8 @@ class Gem::SpecFetcher
list.each do |source, specs|
if dependency.name.is_a?(String) && specs.respond_to?(:bsearch)
- start_index = (0 ... specs.length).bsearch{ |i| specs[i].name >= dependency.name }
- end_index = (0 ... specs.length).bsearch{ |i| specs[i].name > dependency.name }
specs = specs[start_index ... end_index] if start_index && end_index
end
@@ -122,7 +122,7 @@ class Gem::SpecFetcher
end
end
- tuples = tuples.sort_by { |x| x[0] }
return [tuples, errors]
end
@@ -194,10 +194,10 @@ class Gem::SpecFetcher
matches = if matches.empty? && type != :prerelease
suggest_gems_from_name gem_name, :prerelease
else
- matches.uniq.sort_by { |name, dist| dist }
end
- matches.map { |name, dist| name }.uniq.first(num_results)
end
##
@@ -254,7 +254,7 @@ class Gem::SpecFetcher
def tuples_for(source, type, gracefully_ignore=false) # :nodoc:
@caches[type][source.uri] ||=
- source.load_specs(type).sort_by { |tup| tup.name }
rescue Gem::RemoteFetcher::FetchError
raise unless gracefully_ignore
[]