We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In the standard lib Dir class the ** recursive glob matches zero or more directories. In FakeFS it matches one or more.
Dir
**
>> File.open('/tmp/in_tmp.txt', 'w') => #<File:/tmp/in_tmp.txt> >> Dir['/tmp/**/*'] => ["/tmp/in_tmp.txt"] >> require 'fakefs' => true >> File.open('/tmp/in_tmp.txt', 'w') => #<FakeFS::File:0x12165dc @mode="w", @file=(FakeFile name:"in_tmp.txt" parent:"/tmp" size:0), @path="/tmp/in_tmp.txt", @open=true> >> Dir['/tmp/**/*'] => [] >> Dir['/tmp/*'] => ["/tmp/in_tmp.txt"]
The FakeFS behavior should mimic the standard lib. http://ruby-doc.org/core/classes/Dir.src/M002322.html
The text was updated successfully, but these errors were encountered:
Actually the fakefs recursive glob (**) behaves exactly like a single wildcard (*) matching exactly one directory, not one or more as stated above.
*
irb(main):001:0> require 'rubygems' => true irb(main):002:0> require 'fakefs' => true irb(main):003:0> File.open('/one/two/three/four', 'w') => #<FakeFS::File:0x1216564 @mode="w", @file=(FakeFile name:"four" parent:"/one/two/three" size:0), @path="/one/two/three/four", @open=true> irb(main):005:0> Dir["/*"] => ["/one"] irb(main):006:0> Dir["/**"] => ["/one"] irb(main):007:0> Dir["/**/*"] => ["/one/two"] irb(main):008:0> Dir["/***/*"] => ["/one/two"] irb(main):009:0> Dir["/***/*/**"] => ["/one/two/three"] irb(main):010:0> Dir["/***/*/**/**"] => ["/one/two/three/four"] irb(main):011:0>
Sorry, something went wrong.
I've added recursive globbing functionality to my fork at samg/fakefs
Fixed in 1c6825f
No branches or pull requests
In the standard lib
Dir
class the**
recursive glob matches zero or more directories. In FakeFS it matches one or more.The FakeFS behavior should mimic the standard lib.
http://ruby-doc.org/core/classes/Dir.src/M002322.html
The text was updated successfully, but these errors were encountered: