From 5335ce0e060c7a2a0b01c57f8f8a64254f2658e1 Mon Sep 17 00:00:00 2001 From: hsbt Date: Wed, 21 Nov 2018 10:20:47 +0000 Subject: 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 --- lib/rubygems/doctor.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/rubygems/doctor.rb') 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 - -- cgit v1.2.3