[前][次][番号順一覧][スレッド一覧]

ruby-changes:41899

From: nobu <ko1@a...>
Date: Mon, 29 Feb 2016 17:35:43 +0900 (JST)
Subject: [ruby-changes:41899] nobu:r53973 (trunk): fileutils.rb: reduce private

nobu	2016-02-29 17:36:30 +0900 (Mon, 29 Feb 2016)

  New Revision: 53973

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53973

  Log:
    fileutils.rb: reduce private
    
    * lib/fileutils.rb (Verbose, NoWrite, DryRun): make overridden
      methods private by each one calls.

  Modified files:
    trunk/lib/fileutils.rb
Index: lib/fileutils.rb
===================================================================
--- lib/fileutils.rb	(revision 53972)
+++ lib/fileutils.rb	(revision 53973)
@@ -1690,14 +1690,15 @@ module FileUtils https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb#L1690
     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 https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb#L1715
     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 https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb#L1741
     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)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]