From 3963da86f3ead5fc2d0a5ac704f64b8a01ada3e9 Mon Sep 17 00:00:00 2001 From: aamine Date: Fri, 23 Sep 2005 23:30:09 +0000 Subject: * lib/fileutils.rb: fix visibility of FileUtils::NoWrite, Verbose, DryRun. [ruby-core:05954] * test/fileutils/test_nowrite.rb: test it. * test/fileutils/test_dryrun.rb: new file. * test/fileutils/test_verbose.rb: new file. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/fileutils.rb | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/fileutils.rb b/lib/fileutils.rb index 36d5f70c0..a2c411f6e 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -1080,7 +1080,7 @@ module FileUtils def path if @path - @path + File.path(@path) else join(@prefix, @rel) end @@ -1486,6 +1486,9 @@ module FileUtils OPT_TABLE.keys.select {|m| OPT_TABLE[m].include?(opt.to_s) } end + METHODS = singleton_methods() - %w( private_module_function + commands options have_option? options_of collect_method ) + # # This module has all methods of FileUtils module, but it outputs messages # before acting. This equates to passing the :verbose flag to @@ -1500,9 +1503,15 @@ module FileUtils def #{name}(*args) super(*fu_update_option(args, :verbose => true)) end + private :#{name} EOS end extend self + class << self + ::FileUtils::METHODS.each do |m| + public m + end + end end # @@ -1519,9 +1528,15 @@ module FileUtils def #{name}(*args) super(*fu_update_option(args, :noop => true)) end + private :#{name} EOS end extend self + class << self + ::FileUtils::METHODS.each do |m| + public m + end + end end # @@ -1539,9 +1554,15 @@ module FileUtils def #{name}(*args) super(*fu_update_option(args, :noop => true, :verbose => true)) end + private :#{name} EOS end extend self + class << self + ::FileUtils::METHODS.each do |m| + public m + end + end end end -- cgit