-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
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
Support Dir.glob with Pathname. #21
Conversation
Hmm I don't think Travis is supporting Ruby older than 2.0.0 any more. It fails wit this message:
|
This works with stdlib: require 'pathname' p = Pathname.new('/') Dir[p] # => ["/"] But before this change failed under MemFs: TypeError: no implicit conversion of Pathname into String This is more likely to be encountered in a Rails project where `Rails.root` is a `Pathname`, but it's very possible to encounter this in an Ruby project.
@@ -216,6 +217,9 @@ module MemFs | |||
it_behaves_like 'returning matching filenames', '/test?', %w[/test0 /test1 /test2] | |||
it_behaves_like 'returning matching filenames', '/test[01]', %w[/test0 /test1] | |||
it_behaves_like 'returning matching filenames', '/test[^2]', %w[/test0 /test1] | |||
it_behaves_like 'returning matching filenames', Pathname.new('/'), %w[/] | |||
it_behaves_like 'returning matching filenames', Pathname.new('/*'), | |||
%w[/tmp /test0 /test1 /test2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align the parameters of a method call if they span more than one line.
Hi @craigw. Thank you very much for your PR that's so cool! 😁 |
This works with stdlib: require 'pathname' p = Pathname.new('/') Dir[p] # => ["/"] But before this change failed under MemFs: TypeError: no implicit conversion of Pathname into String This is more likely to be encountered in a Rails project where `Rails.root` is a `Pathname`, but it's very possible to encounter this in an Ruby project. Closes #21.
This works with stdlib:
But before this change failed under MemFs:
This is more likely to be encountered in a Rails project where
Rails.root
is aPathname
, but it's very possible to encounter thisin an Ruby project.