RCurtain
Easy way to control your features using redis.
Also available for Java -> JCurtain!
Installation
Add this line to your application's Gemfile:
gem 'rcurtain'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install rcurtain
Usage
- Rcurtain uses redis to control features, which can be checked by a percentage or a set of users.
feature:[name-of-feature]:percentage
feature:[name-of-feature]:users
- To use Rcurtain, first your need to initialize the configuration defining your redis URL (password@ip:port/database). Optionally, you can also configure the default response when the feature is not found, which by default is false.
Rcurtain.configure do |config|
config.url = 'redis://:p4ssw0rd@10.0.1.1:6380/15'
# config.default_response = true
end
- Get the instance of Rcurtain.
rcurtain = Rcurtain.instance
- Consult if the curtain is opened for a feature using the method "opened?", passing the name of the feature you want to check.
rcurtain.opened? 'feature'
- You can also pass a set of users to be checked.
rcurtain.opened?('feature', ['user-1','user-2'])
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/moip/rcurtain. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
- Fork it ( https://github.com/moip/rcurtain/fork )
- 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 a new Pull Request
License
The gem is available as open source under the terms of the MIT License.