openfeature-ruby-sdk-contrib 0.0.3 → 0.0.5

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: 33279a645ab02c54060f2842ae586d244b779d20c5a3bd275486f2dbecaf0687
4
- data.tar.gz: 6a9c0a4ce90d78978ddb4ef95e2cc880ab2601ef03bf23b7e58700e2a4b9c809
3
+ metadata.gz: 81acb0df43cfaad72374189f8b6f00620ecc904f06c4a615bdba854b7dda92a9
4
+ data.tar.gz: 532cd57ceaa4dbc181e24f40131cb869cab118fa1d7e7cb5c4928ac5cda08d0c
5
5
  SHA512:
6
- metadata.gz: bbf841634b916502ff751778337d6b81e8472eb1186b20a687bf7fa3accfe82a96cef52ede9a42567f04b4cdbd274d44733d07c4c043d15dc7340d0397c7e402
7
- data.tar.gz: b52c456508a087aab56ef26a42f20177e3a71145c785ba44dff405462164d112c18a3a6e30dbd93d0c22a49690085ed0ed218f521ba56f9ff1ff83b366b8b544
6
+ metadata.gz: 879064f8e107e7798e2deef08b9e7ea4d2ecf58328674816f5f23cf7525e9488bfd74f2b0164b04376fee650fee4d4f0bc2635720f31549c96fdf4f46116b349
7
+ data.tar.gz: c697452a7a87565a724c306f39a1bfd706d27a5e921b5e73d6339972fa50a625273e85a0d2746d1bf55f7fc4c5c85f7e1e7e4292a74041e4c77ab1825dbe38e3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- openfeature-ruby-sdk-contrib (0.0.2)
4
+ openfeature-ruby-sdk-contrib (0.0.4)
5
5
  concurrent-ruby (~> 1.2.2)
6
6
  faraday (~> 2.7.4)
7
7
  openfeature-sdk (~> 0.1)
@@ -134,7 +134,7 @@ module OpenFeature
134
134
  @last_cache = Time.now.to_i
135
135
  end
136
136
 
137
- deep_keys.empty? ? @flag_contents : @flag_contents.dig(*deep_keys)
137
+ (deep_keys.empty? ? @flag_contents : @flag_contents.dig(*deep_keys) || [])
138
138
  end
139
139
 
140
140
  private
@@ -154,8 +154,8 @@ module OpenFeature
154
154
  def assert_type(value:, default_value:, return_types:)
155
155
  actual_value = if value && value["enabled"]
156
156
  value
157
- elsif default_value
158
- { "value" => default_value }
157
+ elsif defined?(default_value)
158
+ { "value" => default_value, "enabled" => true }
159
159
  end
160
160
 
161
161
  return ResolutionDetails.new(value: nil) if actual_value.nil?
@@ -1,4 +1,5 @@
1
1
  require "openfeature/sdk"
2
+ require "erb"
2
3
 
3
4
  module OpenFeature
4
5
  module SDK
@@ -27,7 +28,12 @@ module OpenFeature
27
28
  NAME = "File Provider".freeze
28
29
 
29
30
  def read_and_parse_flags
30
- file_contents = File.read(File.expand_path(source))
31
+ file_contents = begin
32
+ ERB.new(File.read(File.expand_path(source))).result
33
+ rescue Errno::ENOENT
34
+ @flag_contents = {}
35
+ return
36
+ end
31
37
 
32
38
  return custom_parser.call(file_contents) if custom_parser
33
39
 
@@ -3,7 +3,7 @@
3
3
  module OpenFeature
4
4
  module SDK
5
5
  module Contrib
6
- VERSION = "0.0.3"
6
+ VERSION = "0.0.5"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openfeature-ruby-sdk-contrib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eugene Howe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-05 00:00:00.000000000 Z
11
+ date: 2023-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby