summaryrefslogtreecommitdiff
path: root/lib/rubygems/doctor.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-21 10:20:47 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-21 10:20:47 +0000
commit5335ce0e060c7a2a0b01c57f8f8a64254f2658e1 (patch)
treec63321cb7c7c5c15454a79d81123c7188be2c51e /lib/rubygems/doctor.rb
parent2f023c5dbaadede9ceac3eb9ac0e73f3050e5ada (diff)
Merge master branch from rubygems/rubygems upstream.
* Enable Style/MethodDefParentheses in Rubocop https://github.com/rubygems/rubygems/pull/2478 * Enable Style/MultilineIfThen in Rubocop https://github.com/rubygems/rubygems/pull/2479 * Fix required_ruby_version with prereleases and improve error message https://github.com/rubygems/rubygems/pull/2344 * Fix bundler rubygems binstub not properly looking for bundler https://github.com/rubygems/rubygems/pull/2426 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/doctor.rb')
-rw-r--r--lib/rubygems/doctor.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/rubygems/doctor.rb b/lib/rubygems/doctor.rb
index e5d8c43de8..661ae5a4e1 100644
--- a/lib/rubygems/doctor.rb
+++ b/lib/rubygems/doctor.rb
@@ -41,7 +41,7 @@ class Gem::Doctor
#
# If +dry_run+ is true no files or directories will be removed.
- def initialize gem_repository, dry_run = false
+ def initialize(gem_repository, dry_run = false)
@gem_repository = gem_repository
@dry_run = dry_run
@@ -73,7 +73,7 @@ class Gem::Doctor
Gem.use_paths @gem_repository.to_s
- unless gem_repository? then
+ unless gem_repository?
say 'This directory does not appear to be a RubyGems repository, ' +
'skipping'
say
@@ -99,7 +99,7 @@ class Gem::Doctor
##
# Removes files in +sub_directory+ with +extension+
- def doctor_child sub_directory, extension # :nodoc:
+ def doctor_child(sub_directory, extension) # :nodoc:
directory = File.join(@gem_repository, sub_directory)
Dir.entries(directory).sort.each do |ent|
@@ -115,7 +115,7 @@ class Gem::Doctor
type = File.directory?(child) ? 'directory' : 'file'
- action = if @dry_run then
+ action = if @dry_run
'Extra'
else
FileUtils.rm_r(child)
@@ -129,4 +129,3 @@ class Gem::Doctor
end
end
-