Dir glob receives a flag for finding dirs starting with a dot.
If '/one/.dotdir/three.rb' exists
Dir.glob(['/one/*/'], File::FNM_DOTMATCH).should == ['/one/.dotdir/three.rb']
Dir glob will accept multiple arguments.
Fixed issue where Dir.mkdir would fail if path starts with dot.
FakeDir glob does not match dot dirs by default, now.
Dir.glob can find dot dirs, with the correct flags.
Can you rebase this on current master? I'm having trouble merging and getting the specs you added to pass.
Also, it's better if you create a unique branch for each pull request. As you can see, commits from your previous PRs are showing up here. Except for #103, they've already been merged, and I think we can subsume #103 into this one.
I've volunteered to update fakefs a little bit and triage the existing pull requests. This one was small enough that I decided to try to merge it myself. I managed to work through the conflicts but found a problem. The test added to check that File::FNM_DOTMATCH works does not actually assert what Dir.glob really returns. See the diff below for the updated test. You can see my WIP branch at eventualbuddha/marano/issue_104.
diff --git a/test/fakefs_test.rb b/test/fakefs_test.rb
index 9f411b6..9419a0e 100644
@@ -1046,7 +1046,9 @@ class FakeFSTest < Test::Unit::TestCase
- assert_equal ['/one/.dotdir/three.rb'], Dir.glob(['/one/**/*'], File::FNM_DOTMATCH)
+ assert_equal \
+ ['/one/.', '/one/..', '/one/.dotdir', '/one/.dotdir/.', '/one/.dotdir/..', '/one/.dotdir/three.rb'],
+ Dir.glob(['/one/**/*'], File::FNM_DOTMATCH)
if RUBY_VERSION >= "1.9"
Closing until/unless someone wants to take this up.
This is still broken