Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Unable to load file in config repository #23

Closed
gmontard opened this issue Oct 28, 2014 · 1 comment
Closed

Unable to load file in config repository #23

gmontard opened this issue Oct 28, 2014 · 1 comment

Comments

@gmontard
Copy link

Hello,

I was struck while trying to load my dotfile in the config directory.
I took a quick look at the gem code and found out that the Dir.glob command is not used properly.

This is how it's used today in the Gem

Dir.glob("#{Rails.root}/config/**/*.env.#{environment}"

But as it's written in the Doc, this won't find any Unix Dotfile.

Note, this will not match Unix-like hidden files (dotfiles). In order to include those in the match results, you must use the File::FNM_DOTMATCH flag or something like "{,.}".

But if do this it will work

Dir.glob("#{Rails.root}/config/**/{.env.#{environment}}")

Can you give me your feedback ?

Regards.

@dideler
Copy link

dideler commented Jan 7, 2015

PR #27 will fix this if merged.

# Without File::FNM_DOTMATCH (does not find env dotfiles)
Dir.glob("#{rails_root}/config/**/*.env.#{environment}")
[
    [0] "/home/dennis/github/some-project/config/development.env.development",
]

# With File::FNM_DOTMATCH
Dir.glob("#{rails_root}/config/**/*.env.#{environment}", File::FNM_DOTMATCH)
[
    [0] "/home/dennis/github/some-project/config/development.env.development",
    [1] "/home/dennis/github/some-project/config/.env.development",
]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants