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

sourcing additional files #17

Open
brewster1134 opened this issue Mar 31, 2011 · 5 comments
Open

sourcing additional files #17

brewster1134 opened this issue Mar 31, 2011 · 5 comments

Comments

@brewster1134
Copy link

im wondering how i can source an additional file and override values. what i am trying to do is have a settings.yml file.... and an additional user_settings.yml file. user_settings.yml will be omitted form version control and unique to each developer.

an example of what i would like to do is...

settings.yml
defaults: &defaults
interceptor_email: noreply@domain.com

user_settings.yml # for userfoo
defaults:
interceptor_email: userfoo@domain.com

user_settings.yml # for userbar
defaults:
interceptor_email: userbar@domain.com

say my class is Settings, calling on Settings.interceptor_email for the developer userfoo would return userfoo@domain.com, and for userxyz, it would return noreply@domain.com since he doesnt have a local user_settings.yml file.

maybe i am going about this the wrong way?

@greghaygood
Copy link

I would like to see something like this, as well. Is any work being done on it, or shall I take a stab?

@brewster1134
Copy link
Author

i had hoped to have a go at it, but never got around to it.

@greghaygood
Copy link

OK, maybe I'll give it a go this weekend.

On Wed, Jul 13, 2011 at 5:02 PM, brewster1134 <
reply@reply.github.com>wrote:

i had hoped to have a go at it, but never got around to it.

Reply to this email directly or view it on GitHub:
#17 (comment)

@greghaygood
Copy link

I added support to my fork this morning, and it seems to work well. Give it a shot, and if it's all good, I'll request a pull. Thanks!

https://github.com/greghaygood/settingslogic

@brewster1134
Copy link
Author

sorry just got around to checking out your fork. works great! But 1 thing...

I think the hashes need to be recursively merged. otherwise if a deeply nested key/value is missing from the 2nd hash, when its merged, the new hash will be missing that key/value as well instead of falling back on the key/value from the 1st hash. thoughts?

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

2 participants