Beautiful, performant feature flags for Ruby.
Flipper gives you control over who has access to features in your app.
Control your software — don't let it control you.
Add this line to your application's Gemfile:
You'll also want to pick a storage adapter, for example:
And then execute:
Or install it yourself with:
$ gem install flipper
Flipper#enabled? in your app to check if a feature is enabled.
# check if search is enabled if Flipper.enabled? :search, current_user puts 'Search away!' else puts 'No search for you!' end
All features are disabled by default, so you'll need to explicitly enable them.
Flipper.enable_actor :search, current_user
First tell Flipper about your groups:
# config/initializers/flipper.rb Flipper.register(:admin) do |actor| actor.respond_to?(:admin?) && actor.admin? end
Then enable the feature for that group:
Flipper.enable_group :search, :admin
Flipper.enable_percentage_of_actors :search, 2
Flipper is built on adapters for maximum flexibility. Regardless of what data store you are using, Flipper can performantly store data in it.
Pick one of our supported adapters and follow the installation instructions:
Or roll your own. We even provide automatic (rspec and minitest) tests for you, so you know you've built your custom adapter correctly.
Read more about Adapters.
If you prefer a web UI to an IRB console, you can setup the Flipper UI.
It's simple and pretty.
Or, (even better than OSS + UI) use Flipper Cloud which comes with:
Cloud is super simple to integrate with Rails (demo app), Sinatra or any other framework.
A few miscellaneous docs with more info for the hungry.
git checkout -b my-new-feature)
bundle exec rake)
git commit -am 'Added some feature')
git push origin my-new-feature)