Skip to content
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

Dir.glob returns inconsistent results inside memfs #158

Open
omohokcoj opened this issue Jun 7, 2021 · 0 comments
Open

Dir.glob returns inconsistent results inside memfs #158

omohokcoj opened this issue Jun 7, 2021 · 0 comments

Comments

@omohokcoj
Copy link

irb(main):176:0> Dir.glob('{*,*/concerns}', base: '/__enclose_io_memfs__/local/app')
=> ["assets", "channels", "controllers", "helpers", "javascript", "jobs", "mailers", "models", "views"]

*/concerns subdirectories are missing when searching for directories in mounted memfs but present when using a local fs:

irb(main):063:0> Dir.glob('{*,*/concerns}', base: '/Users/pete/Documents/rails-pg/app')
=> ["mailers", "models", "javascript", "jobs", "controllers", "views", "assets", "helpers", "channels", "models/concerns", "controllers/concerns"]

Looks like the issue is caused by pattern {*,*/concerns} because */* pattern works as expected:

irb(main):019:0> Dir.glob('*/*', base: '/__enclose_io_memfs__/local/app')
=> ["assets/config", "assets/images", "assets/stylesheets", "channels/application_cable", "controllers/application_controller.rb", "controllers/concerns", "helpers/application_helper.rb", "javascript/channels", "javascript/packs", "jobs/application_job.rb", "mailers/application_mailer.rb", "models/application_record.rb", "models/concerns", "models/item.rb", "models/test_column.rb", "views/layouts"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant