Bastet - The criteria based feature rollout beast
Gemfile
gem "bastet"
Configuration
redis = Redis.new
bastet = Bastet.setup(redis)
Usage
Activate
group = Bastet::Group.new('admin_users') { |user| user.admin? }
bastet.activate("admin_only_feature", group)
Test
user = User.new(admin: true)
bastet.active?("admin_only_feature", user)
Deactivate
bastet.deactivate("admin_only_feature", group)
bastet.inactive?("admin_only_feature", user)
Criteria
Bastet::Group.new('all') { true } Bastet::Group.new('none') { false } Bastet::Group.new('admins') { |user| user.admin? } Bastet::Group.new('10_percent') { |user| (entity.id % 10) < (20 / 10) }
To Do
- Support activating/deactivating for multiple users/groups at once
- Percentage support
- Logging
Contibuting
- Fork Basteet
- Create a topic branch -
git checkout -b my_branch
- Push to your branch -
git push origin my_branch
- Create a pull request from your branch