Oshuma / app_config

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

'create' boolean option to AppConfig.setup!() #14

Open Oshuma opened 12 years ago

Oshuma commented 12 years ago

Using a create: true storage option when calling AppConfig.setup!() creates (or writes to) the given storage (YAML file, Mongo collection, etc.).

DSIW commented 12 years ago

Does it create the given storage at the first time (in setup) or does it save each change?

Oshuma commented 12 years ago

Hasn't been implemented yet, but it will probably work like this: After AppConfig.setup() is called and completed, it will write the file once, then you must call AppConfig.save! in order to write to disk. I'd advise against writing on each change, as that may not always be the desired behavior and might lead to hammering the disk (if you assign a lot of config vars).

DSIW commented 12 years ago

Does it make sense to create the database? You have to start the MongoDB deamon first and it will create the specified directory if it doesn't exist.

This is my opinion.