Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inloco/unleash-incognia-ruby
Ruby gem that extends Unleash Ruby client with Incognia strategies
https://github.com/inloco/unleash-incognia-ruby
Last synced: 7 days ago
JSON representation
Ruby gem that extends Unleash Ruby client with Incognia strategies
- Host: GitHub
- URL: https://github.com/inloco/unleash-incognia-ruby
- Owner: inloco
- License: mit
- Created: 2021-10-05T13:09:19.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-10-11T13:35:19.000Z (about 3 years ago)
- Last Synced: 2023-03-01T10:31:05.773Z (almost 2 years ago)
- Language: Ruby
- Size: 14.6 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Unleash::Incognia
This gem contains our Unleash custom strategies.
## Installation
You must set up [Unleash Ruby SDK](https://github.com/Unleash/unleash-client-ruby) in order to use these custom strategies.
Add this line to your application's Gemfile:
```ruby
gem 'unleash-incognia', '~> 0.1'
```And then execute:
$ bundle install
Or install it yourself as:
$ gem install unleash-incognia
## Usage
You must set up [Unleash Ruby SDK](https://github.com/Unleash/unleash-client-ruby) in order to use these custom strategies.
```ruby
> user = OpenStruct.new(id: 2, email: '[email protected]')
=> #> Unleash::Incognia::Client.new(user: user).enabled_features
=> ["incognia_feature_1"]> organization = OpenStruct.new(id: 5)
=> #> client = Unleash::Incognia::Client.new(user: user, organization: organization)
=> #, @organization=#># List enabled features
> client.enabled_features
=> ["incognia_feature_1", "incognia_feature_2", "incognia_feature_3"]# Ask if some feature is enabled
> client.feature_enabled?("disabled_feature")
=> false> client.feature_enabled?("incognia_feature_2")
=> true
```### Configuration
Whenever you have `Unleash::Client` being instanciated change it to:
```ruby
Unleash::Incognia.configure do |config|
config.unleash_client = Unleash::Client.new
end
```Or:
```ruby
Unleash::Incognia.configuration.unleash_client = Unleash::Client.new
```This way, `Unleash::Incognia` client will use proper `Unleash` client.
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/unleash-incognia.
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).