Question

I am working on a gem that needs to be configured with a hostname, username, and password. I would prefer to store this configuration information in config/directoryservices.yml

How do I make my gem automatically create this file when installed?

I've seen a lot of places say that config information should be passed as hashes with gems. The main use of this gem will be in an app that is installed on ~15 servers. Each server will need different config information.

If it is better to include the YAML code in the app and then pass the data as a hash to the gem, I can do that, but I would still like pointers on the best way to do that.

An example of a gem that uses this kind of config is activeldap

Was it helpful?

Solution

If are you working on rails gem, you can create install generator which will copy default config file and then load it into your app.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top