flaggle_rock/README.md

69 lines
1.4 KiB
Markdown
Raw Normal View History

2024-01-25 15:55:49 +00:00
# Flaggle Rock
[View on RubyGems](https://rubygems.org/gems/flaggle_rock)
Flaggle Rock is a simple feature flagging gem for use with Ruby on Rails applications.
It is designed for easily hiding features from end users to help enable a fast-moving
CI workflow. It currently does not aim to support more advanced features such as A/B
testing.
## Installation
Add Flaggle Rock to your Gemfile:
```ruby
gem "flaggle_rock"
```
And install
```sh
bundle install
```
Generate the migrations, and run them to add feature flags to your database:
```sh
bundle exec rails generate flaggle_rock:install
bundle exec rails db:migrate
```
## Usage
All flags are _off by default_. There is no need to explicitly create a new flag—turning
it on will do this.
To enable/disable a flag:
```ruby
Rock.on(:flag_name)
Rock.off(:flag_name)
```
To check whether a flag is on:
```ruby
Rock.on?(:flag_name)
Rock.off?(:flag_name)
```
To remove a flag which is no longer used:
```ruby
Rock.delete(:flag_name)
```
To remove all disabled flags:
```ruby
Rock.delete_all_disabled
```
## Future
Goals with Flaggle Rock include the creation of a web UI for easily administering flags.
## Compatibility
Flaggle Rock has been tested with Rails 7 and PostgreSQL 11, but should work with older versions of
Rails and other database engines.
## License
Flaggle Rock is released under the [MIT License](MIT-LICENSE.md).