openfeature-sdk 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +1 -1
- data/README.md +8 -8
- data/lib/open_feature/sdk/api.rb +6 -4
- data/lib/open_feature/sdk/metadata.rb +6 -3
- data/lib/open_feature/sdk/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01c5b0fe23e56edfe9142031b5ad8b25e9f55b42e7eeb4ccb36692ee297b543f
|
4
|
+
data.tar.gz: 87c4f9c43567db36526725b79c9a7075b3acb47949f07820b444ef31fd59af5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82b18ea505c33933f3a8798013cfac8d660d2560badcb45f11a9ec1036ab40ba2b61d14f347754f9d679dd07214228ae953a6a5e4e153b1196d53e3163c94cfd
|
7
|
+
data.tar.gz: 5af77fb1f0668477663dc04c1b7d759fc76ba899c693acf7cb53823133f89834b82ebe2591d8efb31d88638e950b33c53f91aa328c06a8abf98ce42fa795b5ea
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.2.1](https://github.com/open-feature/ruby-sdk/compare/v0.2.0...v0.2.1) (2024-03-29)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* Add domain to build_client ([#109](https://github.com/open-feature/ruby-sdk/issues/109)) ([56ccf17](https://github.com/open-feature/ruby-sdk/commit/56ccf17ec340df0ea14a72ea7379c51dbb9d7b13))
|
9
|
+
|
3
10
|
## [0.2.0](https://github.com/open-feature/ruby-sdk/compare/v0.1.1...v0.2.0) (2024-03-09)
|
4
11
|
|
5
12
|
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -12,12 +12,11 @@ We support multiple data types for flags (numbers, strings, booleans, objects) a
|
|
12
12
|
|
13
13
|
## Support Matrix
|
14
14
|
|
15
|
-
| Ruby Version | OS
|
16
|
-
|
|
17
|
-
| Ruby 3.1.4 | Windows, MacOS, Linux
|
18
|
-
| Ruby 3.2.3 | Windows, MacOS, Linux
|
19
|
-
| Ruby 3.3.0 | Windows, MacOS, Linux
|
20
|
-
|
15
|
+
| Ruby Version | OS |
|
16
|
+
| ------------ | --------------------- |
|
17
|
+
| Ruby 3.1.4 | Windows, MacOS, Linux |
|
18
|
+
| Ruby 3.2.3 | Windows, MacOS, Linux |
|
19
|
+
| Ruby 3.3.0 | Windows, MacOS, Linux |
|
21
20
|
|
22
21
|
## Installation
|
23
22
|
|
@@ -54,7 +53,9 @@ OpenFeature::SDK.configure do |config|
|
|
54
53
|
end
|
55
54
|
|
56
55
|
# Create a client
|
57
|
-
client = OpenFeature::SDK.build_client
|
56
|
+
client = OpenFeature::SDK.build_client
|
57
|
+
# Create a client for a different domain, this will use the provider assigned to that domain
|
58
|
+
legacy_flag_client = OpenFeature::SDK.build_client(domain: "legacy_flags")
|
58
59
|
|
59
60
|
# fetching boolean value feature flag
|
60
61
|
bool_value = client.fetch_boolean_value(flag_key: 'boolean_flag', default_value: false)
|
@@ -102,7 +103,6 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to the O
|
|
102
103
|
|
103
104
|
Our community meetings are held regularly and open to everyone. Check the [OpenFeature community calendar](https://calendar.google.com/calendar/u/0?cid=MHVhN2kxaGl2NWRoMThiMjd0b2FoNjM2NDRAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ) for specific dates and for the Zoom meeting links.
|
104
105
|
|
105
|
-
|
106
106
|
## License
|
107
107
|
|
108
108
|
[Apache License 2.0](LICENSE)
|
data/lib/open_feature/sdk/api.rb
CHANGED
@@ -42,10 +42,12 @@ module OpenFeature
|
|
42
42
|
block.call(configuration)
|
43
43
|
end
|
44
44
|
|
45
|
-
def build_client(name: nil, version: nil)
|
46
|
-
client_options = Metadata.new(name: name, version: version).freeze
|
47
|
-
|
48
|
-
|
45
|
+
def build_client(name: nil, version: nil, domain: nil)
|
46
|
+
client_options = Metadata.new(name: name, version: version, domain: domain).freeze
|
47
|
+
|
48
|
+
active_provider = provider(domain:).nil? ? Provider::NoOpProvider.new : provider(domain:)
|
49
|
+
|
50
|
+
Client.new(provider: active_provider, client_options:, context:)
|
49
51
|
end
|
50
52
|
end
|
51
53
|
end
|
@@ -10,19 +10,22 @@ module OpenFeature
|
|
10
10
|
#
|
11
11
|
# * <tt>version</tt> - Allows you to specify version of the Metadata structure
|
12
12
|
#
|
13
|
+
# * <tt>domain</tt> - Allows you to specify the domain of the Metadata structure
|
14
|
+
#
|
13
15
|
# Usage:
|
14
16
|
#
|
15
|
-
# metadata = Metadata.new(name: 'name-for-metadata', version: 'v1.1.3')
|
17
|
+
# metadata = Metadata.new(name: 'name-for-metadata', version: 'v1.1.3', domain: 'test')
|
16
18
|
# metadata.name # 'name-for-metadata'
|
17
19
|
# metadata.version # version
|
18
20
|
# metadata_two = Metadata.new(name: 'name-for-metadata')
|
19
21
|
# metadata_two == metadata # true - equality based on values
|
20
22
|
class Metadata
|
21
|
-
attr_reader :name, :version
|
23
|
+
attr_reader :name, :version, :domain
|
22
24
|
|
23
|
-
def initialize(name:, version: nil)
|
25
|
+
def initialize(name:, version: nil, domain: nil)
|
24
26
|
@name = name
|
25
27
|
@version = version
|
28
|
+
@domain = domain
|
26
29
|
end
|
27
30
|
|
28
31
|
def ==(other)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openfeature-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenFeature Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debug
|