require_all
require_all copied to clipboard
Update require_all.rb
This fixes the problem with globbing. Despite what the readme says, "native" globbing doesn't work - with this addition, it does.
Please describe more what problem did you experience and what does it fix. Also, add a spec for it.
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'
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.