summaryrefslogtreecommitdiff
path: root/lib/rubygems/spec_fetcher.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <[email protected]>2023-03-16 14:10:30 +0900
committerHiroshi SHIBATA <[email protected]>2023-03-17 18:50:55 +0900
commit72d09a568f9f50ce7c41ef2999d272f77a207a8c ()
treeaeb539d5e35ea0ad2ee7880f30d5095afdd7bf34 /lib/rubygems/spec_fetcher.rb
parenta532e9dc37bb7ff2fb36966327f71a74163d9616 (diff)
[rubygems/rubygems] util/rubocop -A --only Style/RedundantBegin
https://.com/rubygems/rubygems/commit/b595d3cf0f
-rw-r--r--lib/rubygems/spec_fetcher.rb64
1 files changed, 30 insertions, 34 deletions
@@ -154,13 +154,11 @@ class Gem::SpecFetcher
specs = []
tuples.each do |tup, source|
- begin
- spec = source.fetch_spec(tup)
- rescue Gem::RemoteFetcher::FetchError => e
- errors << Gem::SourceFetchProblem.new(source, e)
- else
- specs << [spec, source]
- end
end
return [specs, errors]
@@ -214,34 +212,32 @@ class Gem::SpecFetcher
list = {}
@sources.each_source do |source|
- begin
- names = case type
- when :latest
- tuples_for source, :latest
- when :released
- tuples_for source, :released
- when :complete
- names =
- tuples_for(source, :prerelease, true) +
- tuples_for(source, :released)
-
- names.sort
- when :abs_latest
- names =
- tuples_for(source, :prerelease, true) +
- tuples_for(source, :latest)
-
- names.sort
- when :prerelease
- tuples_for(source, :prerelease)
- else
- raise Gem::Exception, "Unknown type - :#{type}"
- end
- rescue Gem::RemoteFetcher::FetchError => e
- errors << Gem::SourceFetchProblem.new(source, e)
- else
- list[source] = names
end
end
[list, errors]