README.md in captain_config-1.0.0 vs README.md in captain_config-1.1.0
- old
+ new
@@ -1,7 +1,9 @@
# CaptainConfig
+[![Build Status](https://travis-ci.org/dirk/captain_config.svg?branch=master)](https://travis-ci.org/dirk/captain_config)
+
`CaptainConfig` makes it easy to add developer-friendly configuration to control your application's behavior.
## Getting Started
Add the gem to your application's Gemfile:
@@ -16,11 +18,11 @@
bundle exec rails generate captain_config
```
**Not on Rails?** Check out the [template](https://github.com/dirk/captain_config/blob/master/lib/generators/templates/create_captain_configs.rb.tt) for the ActiveRecord migration that would have been generated; that describes how this gem expects that table to look.
-Then—assuming you're using Rails—set up some configuration in your config:
+Then—assuming you're using Rails—set up some configuration in your `config/initializers`:
```rb
# config/initializers/captain_config.rb
CONFIG = CaptainConfig::Service.new do
new_feature_enabled :boolean, default: false
@@ -53,10 +55,41 @@
<% if CONFIG[:new_feature_enabled] %>
<%= link_to 'New Stuff!', new_feature_path %>
<% end >
```
+### Sidekiq
+
+There is a Sidekiq middleware to automatically reload configuration.
+
+```rb
+Sidekiq.configure_server do |config|
+ config.server_middleware do |chain|
+ chain.add CaptainConfig::SidekiqMiddlewareFactory.build
+
+ # By default it only reloads every 1 second. Use the `interval:` argument
+ # to change this frequency:
+ #
+ # chain.add CaptainConfig::SidekiqMiddlewareFactory.build(interval: 5.0)
+ end
+end
+```
+
## Contributing
+
+Clone the repo and run `bundle install` to get started developing locally.
+
+There are integration specs which set up a sample Rails application and run tests against it. As that takes some time (more than a few seconds), there is a script to run just the non-integration specs:
+
+```sh
+./script/rspec-without-integration
+```
+
+Arguments are forwarded to RSpec, so if you want to run an individual spec file:
+
+```sh
+./script/rspec-without-integration spec/captain_config_spec.rb
+```
Bug reports and pull requests are welcome on [the GitHub repository](https://github.com/dirk/captain_config).
## Code of Conduct