mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00
[rubygems/rubygems] util/rubocop -A --only Style/RedundantBegin
b595d3cf0f
This commit is contained in:
parent
a532e9dc37
commit
72d09a568f
16 changed files with 148 additions and 188 deletions
|
@ -111,20 +111,18 @@ class Gem::StubSpecification < Gem::BasicSpecification
|
|||
saved_lineno = $.
|
||||
|
||||
Gem.open_file loaded_from, OPEN_MODE do |file|
|
||||
begin
|
||||
file.readline # discard encoding line
|
||||
stubline = file.readline.chomp
|
||||
if stubline.start_with?(PREFIX)
|
||||
extensions = if /\A#{PREFIX}/ =~ file.readline.chomp
|
||||
$'.split "\0"
|
||||
else
|
||||
StubLine::NO_EXTENSIONS
|
||||
end
|
||||
|
||||
@data = StubLine.new stubline, extensions
|
||||
file.readline # discard encoding line
|
||||
stubline = file.readline.chomp
|
||||
if stubline.start_with?(PREFIX)
|
||||
extensions = if /\A#{PREFIX}/ =~ file.readline.chomp
|
||||
$'.split "\0"
|
||||
else
|
||||
StubLine::NO_EXTENSIONS
|
||||
end
|
||||
rescue EOFError
|
||||
|
||||
@data = StubLine.new stubline, extensions
|
||||
end
|
||||
rescue EOFError
|
||||
end
|
||||
ensure
|
||||
$. = saved_lineno
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue