From efa39c3dbd40c8a21fc30e9fa73bfe55c67e8e32 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 29 Feb 2016 08:36:30 +0000 Subject: [PATCH] fileutils.rb: reduce private * lib/fileutils.rb (Verbose, NoWrite, DryRun): make overridden methods private by each one calls. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/fileutils.rb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/fileutils.rb b/lib/fileutils.rb index dc781a3876..05dd9dbd99 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -1690,14 +1690,15 @@ module FileUtils include FileUtils @fileutils_output = $stderr @fileutils_label = '' - ::FileUtils.collect_method(:verbose).each do |name| + names = ::FileUtils.collect_method(:verbose) + names.each do |name| module_eval(<<-EOS, __FILE__, __LINE__ + 1) def #{name}(*args) super(*fu_update_option(args, :verbose => true)) end - private :#{name} EOS end + private(*names) extend self class << self public(*::FileUtils::METHODS) @@ -1714,14 +1715,15 @@ module FileUtils include LowMethods @fileutils_output = $stderr @fileutils_label = '' - ::FileUtils.collect_method(:noop).each do |name| + names = ::FileUtils.collect_method(:noop) + names.each do |name| module_eval(<<-EOS, __FILE__, __LINE__ + 1) def #{name}(*args) super(*fu_update_option(args, :noop => true)) end - private :#{name} EOS end + private(*names) extend self class << self public(*::FileUtils::METHODS) @@ -1739,14 +1741,15 @@ module FileUtils include LowMethods @fileutils_output = $stderr @fileutils_label = '' - ::FileUtils.collect_method(:noop).each do |name| + names = ::FileUtils.collect_method(:noop) + names.each do |name| module_eval(<<-EOS, __FILE__, __LINE__ + 1) def #{name}(*args) super(*fu_update_option(args, :noop => true, :verbose => true)) end - private :#{name} EOS end + private(*names) extend self class << self public(*::FileUtils::METHODS)