Hi,
atm, FileList only recognizes strings with at least one '*' character as
a pattern. ie, patterns that only make use of ? or [] or {} aren't
working in FileList, although they are supported by Dir.glob.Attached patch fixes that by passing any string through Dir.glob. I don't think the overhead of calling Dir.glob is big enough to warrant more extensive checking for any wildcard characters in resolve_add. Note that I didn't actually test the unit test that I added, cause I'm too lazy to install rcov right now :P Regards, Tilman -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail?
Index: test/test_filelist.rb
===================================================================
--- test/test_filelist.rb (revision 565)
+++ test/test_filelist.rb (working copy)
@@ -106,6 +106,14 @@
].sort, fl.sort
end
+ def test_non_star_patterns
+ fl = FileList.new
+ fl.include("foo.[ch]")
+ assert fl.size == 2
+ assert fl.include?("foo.c")
+ assert fl.include?("foo.h")
+ end
+
def test_reject
fl = FileList.new
fl.include %w(testdata/x.c testdata/abc.c testdata/xyz.c testdata/existing)
Index: lib/rake.rb
===================================================================
--- lib/rake.rb (revision 565)
+++ lib/rake.rb (working copy)
@@ -1132,12 +1132,7 @@
end
def resolve_add(fn)
- case fn
- when %r{[*?]}
- add_matching(fn)
- else
- self << fn
- end
+ add_matching(fn)
end
private :resolve_add
pgpvLJVz5AXbw.pgp
Description: PGP signature
_______________________________________________ Rake-devel mailing list [email protected] http://rubyforge.org/mailman/listinfo/rake-devel
