openfeature-ruby-sdk-contrib 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +31 -32
- data/lib/open_feature/sdk/contrib/client.rb +1 -1
- data/lib/open_feature/sdk/contrib/providers/common.rb +1 -1
- data/lib/open_feature/sdk/contrib/providers/file_provider.rb +1 -1
- data/lib/open_feature/sdk/contrib/providers/http_provider.rb +7 -4
- data/lib/open_feature/sdk/contrib/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be2d89c0a27aff01c3af71cf16c50edb267f7b76347de4b390ff6130a1aa0217
|
4
|
+
data.tar.gz: 432c022ce3a40af8f9e58715aa9b6ca4b88dbfa067e8ba81ec2784a21b729d52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65b1632d328b1d91ff91cdc5e021b88d23d9dcf342328778e56d64b31bacd8126ff6064be89735e1b7c7b9004ad757e8accb18c6b17a641d6d5fa934ae33f892
|
7
|
+
data.tar.gz: a3d906869ea5a09f5e0ee88649e04e021a5802f72e3465b0d17fd580c7a321bfab9e12a78a20cec37817409a8eb5ab056200c96600354947012915821ca23309
|
data/Gemfile.lock
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
openfeature-ruby-sdk-contrib (0.
|
4
|
+
openfeature-ruby-sdk-contrib (0.4.0)
|
5
5
|
concurrent-ruby (~> 1.2.2)
|
6
6
|
faraday (~> 2.7.10)
|
7
|
-
openfeature-sdk (~> 0.
|
7
|
+
openfeature-sdk (~> 0.2)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
@@ -13,20 +13,20 @@ GEM
|
|
13
13
|
base64 (0.2.0)
|
14
14
|
byebug (11.1.3)
|
15
15
|
coderay (1.1.3)
|
16
|
-
concurrent-ruby (1.2.
|
17
|
-
diff-lcs (1.5.
|
16
|
+
concurrent-ruby (1.2.3)
|
17
|
+
diff-lcs (1.5.1)
|
18
18
|
faraday (2.7.12)
|
19
19
|
base64
|
20
20
|
faraday-net_http (>= 2.0, < 3.1)
|
21
21
|
ruby2_keywords (>= 0.0.4)
|
22
22
|
faraday-net_http (3.0.2)
|
23
|
-
json (2.
|
23
|
+
json (2.7.1)
|
24
24
|
language_server-protocol (3.17.0.3)
|
25
25
|
lint_roller (1.1.0)
|
26
26
|
method_source (1.0.0)
|
27
|
-
openfeature-sdk (0.
|
28
|
-
parallel (1.
|
29
|
-
parser (3.
|
27
|
+
openfeature-sdk (0.2.0)
|
28
|
+
parallel (1.24.0)
|
29
|
+
parser (3.3.0.5)
|
30
30
|
ast (~> 2.4.1)
|
31
31
|
racc
|
32
32
|
pry (0.14.2)
|
@@ -35,24 +35,24 @@ GEM
|
|
35
35
|
pry-byebug (3.10.1)
|
36
36
|
byebug (~> 11.0)
|
37
37
|
pry (>= 0.13, < 0.15)
|
38
|
-
racc (1.7.
|
38
|
+
racc (1.7.3)
|
39
39
|
rainbow (3.1.1)
|
40
|
-
rake (13.0
|
41
|
-
regexp_parser (2.
|
40
|
+
rake (13.1.0)
|
41
|
+
regexp_parser (2.9.0)
|
42
42
|
rexml (3.2.6)
|
43
|
-
rspec (3.
|
44
|
-
rspec-core (~> 3.
|
45
|
-
rspec-expectations (~> 3.
|
46
|
-
rspec-mocks (~> 3.
|
47
|
-
rspec-core (3.
|
48
|
-
rspec-support (~> 3.
|
49
|
-
rspec-expectations (3.
|
43
|
+
rspec (3.13.0)
|
44
|
+
rspec-core (~> 3.13.0)
|
45
|
+
rspec-expectations (~> 3.13.0)
|
46
|
+
rspec-mocks (~> 3.13.0)
|
47
|
+
rspec-core (3.13.0)
|
48
|
+
rspec-support (~> 3.13.0)
|
49
|
+
rspec-expectations (3.13.0)
|
50
50
|
diff-lcs (>= 1.2.0, < 2.0)
|
51
|
-
rspec-support (~> 3.
|
52
|
-
rspec-mocks (3.
|
51
|
+
rspec-support (~> 3.13.0)
|
52
|
+
rspec-mocks (3.13.0)
|
53
53
|
diff-lcs (>= 1.2.0, < 2.0)
|
54
|
-
rspec-support (~> 3.
|
55
|
-
rspec-support (3.
|
54
|
+
rspec-support (~> 3.13.0)
|
55
|
+
rspec-support (3.13.1)
|
56
56
|
rubocop (1.52.1)
|
57
57
|
json (~> 2.3)
|
58
58
|
parallel (~> 1.10)
|
@@ -63,19 +63,19 @@ GEM
|
|
63
63
|
rubocop-ast (>= 1.28.0, < 2.0)
|
64
64
|
ruby-progressbar (~> 1.7)
|
65
65
|
unicode-display_width (>= 2.4.0, < 3.0)
|
66
|
-
rubocop-ast (1.
|
67
|
-
parser (>= 3.
|
68
|
-
rubocop-capybara (2.
|
66
|
+
rubocop-ast (1.31.2)
|
67
|
+
parser (>= 3.3.0.4)
|
68
|
+
rubocop-capybara (2.20.0)
|
69
|
+
rubocop (~> 1.41)
|
70
|
+
rubocop-factory_bot (2.25.1)
|
69
71
|
rubocop (~> 1.41)
|
70
|
-
rubocop-factory_bot (2.23.1)
|
71
|
-
rubocop (~> 1.33)
|
72
72
|
rubocop-performance (1.18.0)
|
73
73
|
rubocop (>= 1.7.0, < 2.0)
|
74
74
|
rubocop-ast (>= 0.4.0)
|
75
75
|
rubocop-rake (0.6.0)
|
76
76
|
rubocop (~> 1.0)
|
77
|
-
rubocop-rspec (2.
|
78
|
-
rubocop (~> 1.
|
77
|
+
rubocop-rspec (2.27.1)
|
78
|
+
rubocop (~> 1.40)
|
79
79
|
rubocop-capybara (~> 2.17)
|
80
80
|
rubocop-factory_bot (~> 2.22)
|
81
81
|
ruby-progressbar (1.13.0)
|
@@ -92,11 +92,10 @@ GEM
|
|
92
92
|
standard-performance (1.1.2)
|
93
93
|
lint_roller (~> 1.1)
|
94
94
|
rubocop-performance (~> 1.18.0)
|
95
|
-
unicode-display_width (2.
|
96
|
-
yard (0.9.
|
95
|
+
unicode-display_width (2.5.0)
|
96
|
+
yard (0.9.36)
|
97
97
|
|
98
98
|
PLATFORMS
|
99
|
-
arm64-darwin-22
|
100
99
|
arm64-darwin-23
|
101
100
|
|
102
101
|
DEPENDENCIES
|
@@ -134,7 +134,7 @@ module OpenFeature
|
|
134
134
|
def read_all_values_with_cache
|
135
135
|
now = Time.now.to_i
|
136
136
|
|
137
|
-
read_from_cache = if !@flag_contents
|
137
|
+
read_from_cache = if !@flag_contents || !@last_cache
|
138
138
|
false
|
139
139
|
elsif cache_duration == Float::INFINITY
|
140
140
|
true
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "
|
3
|
+
require "open_feature/sdk"
|
4
4
|
require "faraday"
|
5
5
|
|
6
6
|
module OpenFeature
|
@@ -30,10 +30,12 @@ module OpenFeature
|
|
30
30
|
NAME = "Http Provider"
|
31
31
|
|
32
32
|
def read_and_parse_flags
|
33
|
-
|
33
|
+
options = extra_options.clone
|
34
|
+
headers = options.fetch(:headers, {})
|
34
35
|
uri = URI(source)
|
35
36
|
base_url = "#{uri.scheme}://#{uri.host}:#{uri.port}"
|
36
|
-
authentication_strategy =
|
37
|
+
authentication_strategy = options.delete(:authentication_strategy)
|
38
|
+
logger = options.delete(:logger)
|
37
39
|
|
38
40
|
if format == :yaml
|
39
41
|
headers["Content-Type"] ||= "application/yaml"
|
@@ -41,8 +43,9 @@ module OpenFeature
|
|
41
43
|
headers["Content-Type"] ||= "application/json"
|
42
44
|
end
|
43
45
|
|
44
|
-
client = Faraday.new(url: base_url, **
|
46
|
+
client = Faraday.new(url: base_url, **options, headers: headers) do |conn|
|
45
47
|
conn.request(*authentication_strategy) if authentication_strategy
|
48
|
+
conn.response(:logger, logger) if logger
|
46
49
|
end
|
47
50
|
|
48
51
|
res = client.get(uri.request_uri)
|
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.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eugene Howe
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
47
|
+
version: '0.2'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0.
|
54
|
+
version: '0.2'
|
55
55
|
description:
|
56
56
|
email:
|
57
57
|
- eugene.howe@protonmail.com
|