Project

togl

0.0
No commit activity in last 3 years
No release in over 3 years
Multi-strategy feature flags.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
~> 3.1

Runtime

~> 1.0
>= 0
 Project Readme

Togl

Installation

Add this line to your application's Gemfile:

gem 'togl'

And then execute:

$ gem install -g

Or install it directly:

$ gem install togl

Usage

First have a configuration file where you add features as you introduce them

Togl.configure do
  use Togl::Adapter::RackSession.new

  feature :recommendations
  feature :threaded_comments
end

This example uses only one adapter, one that monitors get parameters for special enable_features or disable_features keys. To make it work, add the Togl::Rack::Middleware to your Rack stack.

use Togl::Rack::Middleware

Now in your code you can check if a feature is on

if Togl.on? :recommendations
  # ... implement the feature ...
end

Have a look at the rails_example/ directory for how to use it with Rails, in particular how to have a "features" model, so you can do this on the console:

> Feature.enable! :recommendations
> Feature.disable! :recommendations
> Feature.reset! :recommendations

Contributing

  1. Fork it ( https://github.com/plexus/togl/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request