simonc/memfs

No support for Dir[] or Dir.glob

sgerrand opened this issue · 12 comments

There is currently no support for the Dir[] or Dir.glob methods in MemFs. Ideally these methods should be implemented as part of full emulation of the Dir class in Ruby core.

You're right. I've been thinking about it for some time.

The complexity comes from the globbing part, I could try to transform the string to a Regexp and match this way. In the mean time, I'll add a basic one handling a simple string or array. That's a start :)

Thanks for responding so quickly. I've started done preliminary work on it
myself.

What angle did you chose to handle the different globing options?
If you're interested we could pair on it :)

Ok, looking at the documentation, all globing can be done with File.fnmatch which is already implemented, so the implementation should be really easy! \o/

That's the approach I started on. Great minds! ;)

Awesome! :)

@sgerrand Hi, any progress?

Hi, any progress?

Sorry, not as yet. I let this slip. Will try and complete the feature this
week.

@sgerrand tell me if you need help or if you have any question ;)

Hey guys. I added a basic implementation of Dir.glob and will soon drop Dir[]. Hope you like it ;)

And done :) Now that Dir is complete (except for mktmpdir) I'll push a new release.

Great! Thanks for doing this. :D