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 (patch)
treeaeb539d5e35ea0ad2ee7880f30d5095afdd7bf34 /lib/rubygems/spec_fetcher.rb
parenta532e9dc37bb7ff2fb36966327f71a74163d9616 (diff)
[rubygems/rubygems] util/rubocop -A --only Style/RedundantBegin
https://github.com/rubygems/rubygems/commit/b595d3cf0f
Diffstat (limited to 'lib/rubygems/spec_fetcher.rb')
-rw-r--r--lib/rubygems/spec_fetcher.rb64
1 files changed, 30 insertions, 34 deletions
diff --git a/lib/rubygems/spec_fetcher.rb b/lib/rubygems/spec_fetcher.rb
index 23f2d982d6..ce58b24e7d 100644
--- a/lib/rubygems/spec_fetcher.rb
+++ b/lib/rubygems/spec_fetcher.rb
@@ -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
+ spec = source.fetch_spec(tup)
+ rescue Gem::RemoteFetcher::FetchError => e
+ errors << Gem::SourceFetchProblem.new(source, e)
+ else
+ specs << [spec, source]
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
+ 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
[list, errors]