SupportingCast
Opinionated generators for common Rails backing services, e.g. Redis, nginx, sidekiq, nginx, i.e., the supporting cast.
Installation
Add this line to your application's Gemfile:
gem 'supporting_cast', :group => :development
And then execute:
$ bundle
Or install it yourself as:
$ gem install supporting_cast
Usage
$ rails g supporting_cast:config # Bootstrap the whole supporting cast
$ rails g supporting_cast:<name>_config # Generate config for given cast member
Configurations
SupportingCast is intended to make it easier to get backing services up and running for Rails local (development and test) environments. A guiding principle, largely inspired by the 12 Factor App, is to minimize divergence between local and production environments.
Redis
As Francis Hwang said in his post, Testing Rails Against a Running Redis Instance:
If your Rails app uses Redis, there are basically three approaches you can take for when the code under test hits Redis.
- Mock Redis
- Stub Redis
- Stop messing around and just use Redis
SupportingCast will generate configurations for running separate Redis instances for development and test. Paired with the foreman configuration, it's dead simple to start/stop multiple Redis instances for local environments. You could use Redis namespaces to separate environments, but why mess around?
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request