openfeature-sdk 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef370095e429959ee1d1c0089e9a9e321cc3e4a2345f059aae26b8d965adf1b3
4
- data.tar.gz: c00d676c31455f90592bd1ff604816f468750576e5a181d3b9f02d81c27dd878
3
+ metadata.gz: 01c5b0fe23e56edfe9142031b5ad8b25e9f55b42e7eeb4ccb36692ee297b543f
4
+ data.tar.gz: 87c4f9c43567db36526725b79c9a7075b3acb47949f07820b444ef31fd59af5f
5
5
  SHA512:
6
- metadata.gz: 7d7d24acecc2f9de37b64d037316f17c58138ab78b4ef71923ec8e403fabb94d739b9bc66611a31e50012774f88792b8b9823049202a519da6b13f188a2ec389
7
- data.tar.gz: d9830c29d198b3a4b7f0aef3da391d08ac4a30042eb0bbc47e9b30602ee806e5bb76794243dfa2ea1ed235ab0a8d17ea9b64184a6de6d900a4d7d1b82f0c06b1
6
+ metadata.gz: 82b18ea505c33933f3a8798013cfac8d660d2560badcb45f11a9ec1036ab40ba2b61d14f347754f9d679dd07214228ae953a6a5e4e153b1196d53e3163c94cfd
7
+ data.tar.gz: 5af77fb1f0668477663dc04c1b7d759fc76ba899c693acf7cb53823133f89834b82ebe2591d8efb31d88638e950b33c53f91aa328c06a8abf98ce42fa795b5ea
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.2.0"
2
+ ".": "0.2.1"
3
3
  }
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- openfeature-sdk (0.2.0)
4
+ openfeature-sdk (0.2.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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(name: "my-app")
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)
@@ -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
- provider = Provider::NoOpProvider.new if provider.nil?
48
- Client.new(provider: provider, client_options: client_options, context: context)
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)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OpenFeature
4
4
  module SDK
5
- VERSION = "0.2.0"
5
+ VERSION = "0.2.1"
6
6
  end
7
7
  end
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.0
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 00:00:00.000000000 Z
11
+ date: 2024-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debug