Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

sourcing additional files #17

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

Comments

Projects
None yet
2 participants

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?

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

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

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)

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

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