openfeature-sdk-sorbet 0.2.0.2 → 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: f86d05fc2703e01176ac80a51297027246905986a3beaf46d4e9629d38bd99eb
4
- data.tar.gz: 57410ffd1d14077f79f2c3c7ca304fee018ad0b4e2310d9fc88e47c838e1400e
3
+ metadata.gz: c5c2231f2741a4d89cde28735ddfd5c509bba978559bb732a98a1864bb65dd30
4
+ data.tar.gz: 54d011f1a7bc30a14647632914440ea2814eee934773996d4e70ce9119ec52bc
5
5
  SHA512:
6
- metadata.gz: 0737b0782fe51eb2ab3f3c6b99bcf32cf126a33ed0ac973a74c44c3c180cab0e45a13407fc564b51964d32117e523ba53225b48d3ea855c5bb715e07d2899b15
7
- data.tar.gz: 2d1f478c466d10943286adc4d34d1a6d675cc1814575105e48b4f811031cc2b50eb1cf852bb77af524829e6a797c4f9232a338a404d2994a26290ab61fc3eff7
6
+ metadata.gz: 11643994331234597fc371c44162f95445ba7e3c5b347a0af614206ebf82df2b884dae463727f68011268a9250bedd00c9c161f3428bcc1f48aeb3090d815236
7
+ data.tar.gz: ee4e892b17b5661ccbab5260a32fa8c460be9ee711f83d99ddc1451e29bdf6edb23e96ef1925aad0bc57c3f77f13b6c44154d24338e591b3a5d3b49987fbf571
data/CHANGELOG.md CHANGED
@@ -6,18 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
- ## [0.2.0.2] - 2023-07-27
9
+ ## [0.2.1] - 2023-07-27
10
10
 
11
11
  ### Fixed
12
12
 
13
13
  - Fixed an issue where the `OpenFeature::MultipleSourceProvider` did not properly pass evaluation context to the internal providers.
14
14
 
15
- ## [0.2.0.1] - 2023-07-21
16
-
17
- ### Changed
18
-
19
- * Loosened the type for the `EvaluationContext` underlying Hash to `T::Hash[T.untyped, T.untyped]`. This allows for more varied context to be past to flag evaluation. This is necessary since we don't fully support the Hooks specification and cannot handle all flag evaluation use cases. This behavior will be reverted once the Hooks spec is fully implemented.
20
-
21
15
  ## [0.2.0] - 2023-05-17
22
16
 
23
17
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- openfeature-sdk-sorbet (0.2.0.2)
4
+ openfeature-sdk-sorbet (0.2.1)
5
5
  sorbet-runtime (~> 0.5)
6
6
  sorbet-struct-comparable (~> 1.3)
7
7
  zeitwerk (~> 2.6)
@@ -11,20 +11,22 @@ module OpenFeature
11
11
 
12
12
  include T::Struct::ActsAsComparable
13
13
 
14
- const :targeting_key, T.nilable(String), default: nil
15
- const :fields, T::Hash[T.untyped, T.untyped], default: {}
14
+ FieldValueType = T.type_alias { T.any(T::Boolean, String, Numeric, DateTime, Structure) }
15
+
16
+ const :targeting_key, T.nilable(String)
17
+ const :fields, T::Hash[String, FieldValueType], default: {}
16
18
 
17
19
  sig { params(method_name: Symbol).returns(T::Boolean) }
18
20
  def respond_to_missing?(method_name)
19
21
  fields.key?(method_name.to_s)
20
22
  end
21
23
 
22
- sig { params(method_name: Symbol).returns(T.untyped) }
24
+ sig { params(method_name: Symbol).returns(T.nilable(FieldValueType)) }
23
25
  def method_missing(method_name)
24
26
  fields.fetch(method_name.to_s, nil)
25
27
  end
26
28
 
27
- sig { params(key: T.untyped, value: T.untyped).returns(EvaluationContext) }
29
+ sig { params(key: String, value: FieldValueType).returns(EvaluationContext) }
28
30
  def add_field(key, value)
29
31
  EvaluationContext.new(
30
32
  targeting_key: targeting_key,
@@ -32,7 +34,7 @@ module OpenFeature
32
34
  )
33
35
  end
34
36
 
35
- sig { returns(T::Hash[T.untyped, T.untyped]) }
37
+ sig { returns(T::Hash[String, FieldValueType]) }
36
38
  def to_h
37
39
  targeting_key.nil? ? fields : fields.merge("targeting_key" => targeting_key)
38
40
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "openfeature-sdk-sorbet"
5
- spec.version = "0.2.0.2"
5
+ spec.version = "0.2.1"
6
6
  spec.authors = ["Max VelDink"]
7
7
  spec.email = ["maxveldink@gmail.com"]
8
8
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openfeature-sdk-sorbet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.2
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max VelDink