Oshuma / app_config

Simple Ruby framework-agnostic application configuration.
http://oshuma.github.io/app_config/
MIT License
20 stars 7 forks source link

Multiple Storage Engines #10

Closed jacquescrocker closed 10 years ago

jacquescrocker commented 14 years ago

I'd like to implement a feature on app_config that allows multiple storage engines. So I could define any number of yaml, mongo, or memory settings.

The trick here is the deep merge. It should work with deeply embedded configuration options and merge settings properly.

I'll spec out the feature first before implementing.

Oshuma commented 14 years ago

How would the config accessor methods (AppConfig[] and AppConfig[]=) know which storage engine to use?

If I'm understanding you correctly, you'd like to have configuration stored in an arbitrary number of locations (yaml, mongo, etc.), but all be accessed from the same AppConfig setup?

Pretty neat idea, methinks. Let me know when you've got it spec'ed out and I'll take a look.

jacquescrocker commented 14 years ago

Was thinking it would be merged into one config (using the order .setup was called)

I set up my project with config/app_config.yml and config/app_config/#{env}.yml

So that the env setup would be able to overwrite any of the deep nested configs in the default app_config.yml

Oshuma commented 14 years ago

Ah, I see where you're going. That's not a bad idea. Feel free to give it a go.