You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f52291b
Browse filesBrowse the repository at this point in the historyBrowse files
Install the official OpenFeature SDK next to Featurevisor:
817
+
The OpenFeature provider is published as a separate gem. This keeps OpenFeature code and dependencies out of applications that only use the Featurevisor SDK.
818
+
819
+
The provider currently requires Ruby 3.4 or newer because that is the minimum version supported by the official OpenFeature Ruby SDK.
820
+
821
+
Install the provider:
818
822
819
823
```ruby
820
-
gem "featurevisor"
821
-
gem "openfeature-sdk", "~> 0.6.5"
824
+
gem "featurevisor-openfeature", "~> 1.1"
822
825
```
823
826
827
+
It installs the matching `featurevisor` gem and the official `openfeature-sdk` dependency. The provider and base SDK deliberately share the same version, and the provider requires that exact Featurevisor version.
828
+
824
829
```ruby
825
830
require"featurevisor/openfeature_provider"
826
831
@@ -844,6 +849,17 @@ Use `checkout` for a flag, `checkout:variation` for its variation, and `checkout
844
849
845
850
OpenFeature's targeting key maps to `userId` by default. `targeting_key_field`, `key_separator`, and `variation_key` can customize the mapping.
846
851
852
+
You can pass any Featurevisor initialization options directly to the provider. These options are used to create the Featurevisor instance owned by the provider:
853
+
854
+
```ruby
855
+
provider =Featurevisor::OpenFeatureProvider.new(
856
+
datafile: datafile_content,
857
+
targeting_key_field:"accountId",
858
+
key_separator:"/",
859
+
variation_key:"$variation",
860
+
)
861
+
```
862
+
847
863
You can also reuse an existing Featurevisor instance:
848
864
849
865
```ruby
@@ -861,24 +877,35 @@ See the [OpenFeature provider guide](https://featurevisor.com/docs/sdks/openfeat
861
877
862
878
### Setting up
863
879
864
-
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.
880
+
After checking out the repository, run `make install`to install dependencies.
865
881
866
882
### Running tests
867
883
868
884
```bash
869
885
$ bundle exec rspec
886
+
$ make test-base
887
+
$ make test-example-1
888
+
```
889
+
890
+
Build and verify both gems with:
891
+
892
+
```bash
893
+
$ make build
870
894
```
871
895
872
-
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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
896
+
The build produces `featurevisor-VERSION.gem` and `featurevisor-openfeature-VERSION.gem`. The artifact verifier confirms that OpenFeature code and dependencies are absent from the base gem and present only in the provider gem.
873
897
874
898
### Releasing
875
899
876
-
- Update version in `lib/featurevisor/version.rb`
900
+
- Update the shared version in `lib/featurevisor/version.rb`
877
901
- Run `bundle install`
878
902
- Push commit to `main` branch
879
903
- Wait for CI to complete
880
-
- Tag the release with the version number
881
-
- This will trigger a new release to [RubyGems](https://rubygems.org/gems/featurevisor)
904
+
- Tag the release with the same version number, for example `v1.1.0`
905
+
- The workflow verifies that the tag matches the shared version
906
+
- The workflow publishes `featurevisor` first, followed by `featurevisor-openfeature`
907
+
908
+
The gems are separate RubyGems packages built from the same repository. Publishing the base gem first ensures the provider's exact Featurevisor dependency is available when the provider is published. If the second push fails, rerun or retry the provider publication without republishing the existing base version.
0 commit comments