1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/fileutils.rb: method renaming: collect_methods -> collect_method.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
aamine 2005-09-18 21:38:40 +00:00
parent b7083f661d
commit 8885a8720d
2 changed files with 10 additions and 5 deletions

View file

@ -1,3 +1,8 @@
Mon Sep 19 06:38:03 2005 Minero Aoki <aamine@loveruby.net>
* lib/fileutils.rb: method renaming: collect_methods ->
collect_method.
Mon Sep 19 05:58:59 2005 Minero Aoki <aamine@loveruby.net> Mon Sep 19 05:58:59 2005 Minero Aoki <aamine@loveruby.net>
* lib/fileutils.rb: use module_function instead of single extend. * lib/fileutils.rb: use module_function instead of single extend.

View file

@ -1480,9 +1480,9 @@ module FileUtils
# #
# Returns an Array of method names which have the option +opt+. # Returns an Array of method names which have the option +opt+.
# #
# p FileUtils.collect_methods(:preserve) #=> ["cp", "cp_r", "copy", "install"] # p FileUtils.collect_method(:preserve) #=> ["cp", "cp_r", "copy", "install"]
# #
def FileUtils.collect_methods(opt) def FileUtils.collect_method(opt)
OPT_TABLE.keys.select {|m| OPT_TABLE[m].include?(opt.to_s) } OPT_TABLE.keys.select {|m| OPT_TABLE[m].include?(opt.to_s) }
end end
@ -1495,7 +1495,7 @@ module FileUtils
include FileUtils include FileUtils
@fileutils_output = $stderr @fileutils_output = $stderr
@fileutils_label = '' @fileutils_label = ''
::FileUtils.collect_methods('verbose').each do |name| ::FileUtils.collect_method('verbose').each do |name|
module_eval(<<-EOS, __FILE__, __LINE__ + 1) module_eval(<<-EOS, __FILE__, __LINE__ + 1)
def #{name}(*args) def #{name}(*args)
super(*fu_update_option(args, :verbose => true)) super(*fu_update_option(args, :verbose => true))
@ -1514,7 +1514,7 @@ module FileUtils
include FileUtils include FileUtils
@fileutils_output = $stderr @fileutils_output = $stderr
@fileutils_label = '' @fileutils_label = ''
::FileUtils.collect_methods('noop').each do |name| ::FileUtils.collect_method('noop').each do |name|
module_eval(<<-EOS, __FILE__, __LINE__ + 1) module_eval(<<-EOS, __FILE__, __LINE__ + 1)
def #{name}(*args) def #{name}(*args)
super(*fu_update_option(args, :noop => true)) super(*fu_update_option(args, :noop => true))
@ -1534,7 +1534,7 @@ module FileUtils
include FileUtils include FileUtils
@fileutils_output = $stderr @fileutils_output = $stderr
@fileutils_label = '' @fileutils_label = ''
::FileUtils.collect_methods('noop').each do |name| ::FileUtils.collect_method('noop').each do |name|
module_eval(<<-EOS, __FILE__, __LINE__ + 1) module_eval(<<-EOS, __FILE__, __LINE__ + 1)
def #{name}(*args) def #{name}(*args)
super(*fu_update_option(args, :noop => true, :verbose => true)) super(*fu_update_option(args, :noop => true, :verbose => true))