Reputation: 1019
I'm new to the gem-writing world, and I'm trying to make sure that my gem is as flexible as it can be out of the box. I've got a couple configuration options that will need to be set for things like testing, but I'd like for those options to be able to be overridden at the Ruby on Rails level.
I know that certain gems like Devise do this already, but I'm not sure exactly how it should be accomplished (primarily from the "put these files here, put those files there" kind of perspective). Can anyone give me any tips or suggestions?
Edit: What I'm really looking to know is how these gems manage having configuration settings defined locally to the gem and having them defined in Rails, and defining for the Rails application which takes precedence.
Upvotes: 0
Views: 665
Reputation: 18845
there are gems that help you create rails initializer style configuration.
an example is https://github.com/phoet/confiture/
Upvotes: 1