buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject svn commit: r1404426 - /buildr/trunk/lib/buildr/core/application.rb
Date Thu, 01 Nov 2012 00:07:32 GMT
Author: donaldp
Date: Thu Nov  1 00:07:31 2012
New Revision: 1404426

URL: http://svn.apache.org/viewvc?rev=1404426&view=rev
Log:
Introduce the same suppression of default logging for file operations through the Rake::DSL
class. There has to be a better way of doing this

Modified:
    buildr/trunk/lib/buildr/core/application.rb

Modified: buildr/trunk/lib/buildr/core/application.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/application.rb?rev=1404426&r1=1404425&r2=1404426&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/application.rb (original)
+++ buildr/trunk/lib/buildr/core/application.rb Thu Nov  1 00:07:31 2012
@@ -697,3 +697,21 @@ module RakeFileUtils #:nodoc:
     EOS
   end
 end
+
+module Rake::DSL #:nodoc:
+  FileUtils::OPT_TABLE.each do |name, opts|
+    default_options = []
+    if opts.include?(:verbose) || opts.include?("verbose")
+      default_options << ':verbose => RakeFileUtils.verbose_flag == true'
+    end
+    next if default_options.empty?
+    module_eval(<<-EOS, __FILE__, __LINE__ + 1)
+    def #{name}( *args, &block )
+      super(
+        *rake_merge_option(args,
+          #{default_options.join(', ')}
+          ), &block)
+    end
+    EOS
+  end
+end



Mime
View raw message