Project

rcurtain

0.01
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Open the curtain and see if your feature is enabled
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 3.2
 Project Readme

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.

  1. Fork it ( https://github.com/moip/rcurtain/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

License

The gem is available as open source under the terms of the MIT License.