You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ ruby memfs_trailing_slash.rb
Without MemFs
["..", "b", "."]
With MemFs
/var/lib/gems/2.3.0/gems/memfs-0.5.0/lib/memfs/file_system.rb:64:in `find!': No such file or directory - /tmp/a/ (Errno::ENOENT)
from /var/lib/gems/2.3.0/gems/memfs-0.5.0/lib/memfs/file_system.rb:68:in `find_directory!'
from /var/lib/gems/2.3.0/gems/memfs-0.5.0/lib/memfs/file_system.rb:50:in `entries'
from /var/lib/gems/2.3.0/gems/memfs-0.5.0/lib/memfs/dir.rb:30:in `entries'
from memfs_trailing_slash.rb:5:in `test'
from memfs_trailing_slash.rb:13:in `block in <main>'
from /var/lib/gems/2.3.0/gems/memfs-0.5.0/lib/memfs.rb:53:in `activate'
from memfs_trailing_slash.rb:13:in `<main>'
The text was updated successfully, but these errors were encountered:
Hey @rfdonnelly !
Thanks for reporting this issue. It's indeed annoying. I started looking into it but it's a pandora box since I have to write specs and code for the various methods that could be impacted (and I have to deal with symlinks too).
It's not a complicated fix, it just takes time to do all of it ☺️
@rfdonnelly actually I was wrong, the impact of a trailing / is apparently null so simply ignoring it seems to do the trick. I will push the fix in a few minutes 😉
MemFs::FileSystem::find does not support directories with trailing slashes.
Example
Giving Dir.entries a path with a trailing slash works without MemFs but blows up with MemFs.
Output
The text was updated successfully, but these errors were encountered: