openfeature.cr v0.2.0
openfeature
OpenFeature is an open specification that provides a vendor-agnostic, community-driven API for feature flagging that works with your favorite feature flag management tool or in-house solution.
Feature flags are a software development technique that allows teams to enable, disable or change the behavior of certain features or code paths in a product or service, without modifying the source code.
Standardizing feature flags unifies tools and vendors behind a common interface, avoiding vendor lock-in at the code level. It provides a framework for building extensions and integrations that can be shared across the community.
This library implements the crystal version of this specification.
Installation
-
Add the dependency to your
shard.yml
:dependencies: openfeature: github: threez/openfeature.cr
-
Run
shards install
Usage
require "openfeature"
require "openfeature/providers/*"
OpenFeature.provider = OpenFeature::Providers::InMemory.new
client = OpenFeature.client("app")
v2_enabled = client.boolean_value("v2_enabled", true)
v2_enabled.should eq(true)
The above code first sets the default provider. It then creates a client that can be used to resolve feature flags, in this case it checks if the v2_enabled is enabled.
Contributing
- Fork it (https://github.com/threez/openfeature.cr/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
Contributors
- Vincent Landgraf - creator and maintainer
API
openfeature.cr
- 0
- 0
- 0
- 0
- 1
- 4 months ago
- June 14, 2024
MIT License
Thu, 07 Nov 2024 04:29:01 GMT