buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject svn commit: r1491078 - in /buildr/trunk: CHANGELOG lib/buildr/core/application.rb
Date Sat, 08 Jun 2013 22:03:20 GMT
Author: donaldp
Date: Sat Jun  8 22:03:19 2013
New Revision: 1491078

URL: http://svn.apache.org/r1491078
Log:
Patch Rake::FileList in Ruby >= 2.0.0 to match dot files if a .* pattern is supplied as
in earlier versions of ruby.

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

Modified: buildr/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/buildr/trunk/CHANGELOG?rev=1491078&r1=1491077&r2=1491078&view=diff
==============================================================================
--- buildr/trunk/CHANGELOG (original)
+++ buildr/trunk/CHANGELOG Sat Jun  8 22:03:19 2013
@@ -1,4 +1,6 @@
 1.4.13 (Pending)
+* Fixed:  Patch Rake::FileList in Ruby >= 2.0.0 to match dot files if
+          a .* pattern is supplied as in earlier versions of ruby.
 * Fixed:  Make Archive-related operations (e.g. zip.merge) deterministic using
           OrderedHash.
 * Change: Update to TestNG 6.8.5.

Modified: buildr/trunk/lib/buildr/core/application.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/application.rb?rev=1491078&r1=1491077&r2=1491078&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/application.rb (original)
+++ buildr/trunk/lib/buildr/core/application.rb Sat Jun  8 22:03:19 2013
@@ -693,3 +693,24 @@ module FileUtils
   module_function :fu_output_message
   private_class_method :fu_output_message
 end
+
+module ::Rake
+  class FileList
+    # Add matching glob patterns.
+    def add_matching(pattern)
+      # Patch to use File::FNM_DOTMATCH where appropriate
+      args = []
+      args << File::FNM_DOTMATCH if pattern =~ /\.\*/
+      FileList.glob(pattern, *args).each do |fn|
+        self << fn unless exclude?(fn)
+      end
+    end
+    private :add_matching
+
+    class << self
+      def glob(pattern, *args)
+        Dir.glob(pattern, *args).sort
+      end
+    end
+  end
+end if RUBY_VERSION >= "2.0.0"



Mime
View raw message