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

Update require_all.rb #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update require_all.rb #32

wants to merge 1 commit into from

Conversation

richpeck
Copy link

This fixes the problem with globbing. Despite what the readme says, "native" globbing doesn't work - with this addition, it does.

This fixes the problem with globbing. Despite what the readme says, "native" globbing support doesn't work - with this addition, it does.
@jarmo
Copy link
Owner

jarmo commented Oct 10, 2020

Please describe more what problem did you experience and what does it fix. Also, add a spec for it.

@richpeck
Copy link
Author

richpeck commented Oct 10, 2020

I'm running Windows 10 with Ruby 2.7.2 and if I used the glob syntax without explicitly calling glob, it would fail, citing the file as not being present:

require_all 'app', 'lib', 'config/*.rb'

ruby

This could easily be resolved by using the Dir.glob syntax (require_all Dir.glob("x/y/**/z.rb"), but I didn't want to.

After digging through the gem's code, I found that the require_all method was treating "config/*.rb" as a file. Thus, I was able to determine that wrapping the file in Dir[], it treated it as a glob path, and worked. It also worked for single files.

I'll do a spec when I get a minute.

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

Successfully merging this pull request may close these issues.

2 participants