promoted-ruby-client 2.0.0 → 2.0.2
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/.github/workflows/push-pull-requests_check.yml +1 -1
- data/Gemfile +0 -1
- data/Gemfile.lock +70 -61
- data/dev.md +1 -1
- data/lib/promoted/ruby/client/version.rb +1 -1
- data/lib/promoted/ruby/client.rb +8 -5
- 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: 11ce5ae07d4a391a8e052befa249acf77a5e1c2b8bd27af1cc5abb24d011551f
|
|
4
|
+
data.tar.gz: b2526b7a4b3f2940283c27930a85bcd8e9b469e63c3276271e1ef1d9ffafb096
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ca464c620e04043e7998bc12d9792931fd220b00d8fcfc9a777149a27c6b5b42710409ce48bf43787da346743837f6934df11ce56070bb725ba021c6de1c1908
|
|
7
|
+
data.tar.gz: 0c3a880b7aa8b8b16523cbe60f75af5ef89849ce5de16a7d19a907aad1429e27a873136d95194fa3b21c4fdc01b663087000e10ae05cb713b638f7b8cbb980b0
|
data/Gemfile
CHANGED
|
@@ -6,7 +6,6 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
|
|
6
6
|
gemspec
|
|
7
7
|
|
|
8
8
|
group :development do
|
|
9
|
-
gem 'ruby-debug-ide', group: :development
|
|
10
9
|
gem 'debase', '>= 0.2.5.beta2', group: :development
|
|
11
10
|
gem 'jaro_winkler', group: :development
|
|
12
11
|
gem 'solargraph', group: :development
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
promoted-ruby-client (2.0.
|
|
4
|
+
promoted-ruby-client (2.0.2)
|
|
5
5
|
concurrent-ruby (~> 1)
|
|
6
6
|
faraday (>= 0.9.0)
|
|
7
7
|
faraday_middleware (>= 0.9.0)
|
|
@@ -12,113 +12,123 @@ GEM
|
|
|
12
12
|
specs:
|
|
13
13
|
ast (2.4.2)
|
|
14
14
|
backport (1.2.0)
|
|
15
|
-
benchmark (0.
|
|
16
|
-
concurrent-ruby (1.
|
|
17
|
-
connection_pool (2.
|
|
15
|
+
benchmark (0.2.1)
|
|
16
|
+
concurrent-ruby (1.2.2)
|
|
17
|
+
connection_pool (2.4.1)
|
|
18
18
|
debase (0.2.5.beta2)
|
|
19
19
|
debase-ruby_core_source (>= 0.10.12)
|
|
20
|
-
debase-ruby_core_source (
|
|
21
|
-
diff-lcs (1.
|
|
20
|
+
debase-ruby_core_source (3.2.1)
|
|
21
|
+
diff-lcs (1.5.0)
|
|
22
22
|
docile (1.4.0)
|
|
23
23
|
e2mmap (0.1.0)
|
|
24
|
-
faraday (1.
|
|
24
|
+
faraday (1.10.3)
|
|
25
25
|
faraday-em_http (~> 1.0)
|
|
26
26
|
faraday-em_synchrony (~> 1.0)
|
|
27
27
|
faraday-excon (~> 1.1)
|
|
28
|
+
faraday-httpclient (~> 1.0)
|
|
29
|
+
faraday-multipart (~> 1.0)
|
|
28
30
|
faraday-net_http (~> 1.0)
|
|
29
|
-
faraday-net_http_persistent (~> 1.
|
|
30
|
-
|
|
31
|
+
faraday-net_http_persistent (~> 1.0)
|
|
32
|
+
faraday-patron (~> 1.0)
|
|
33
|
+
faraday-rack (~> 1.0)
|
|
34
|
+
faraday-retry (~> 1.0)
|
|
31
35
|
ruby2_keywords (>= 0.0.4)
|
|
32
36
|
faraday-em_http (1.0.0)
|
|
33
37
|
faraday-em_synchrony (1.0.0)
|
|
34
38
|
faraday-excon (1.1.0)
|
|
39
|
+
faraday-httpclient (1.0.1)
|
|
40
|
+
faraday-multipart (1.0.4)
|
|
41
|
+
multipart-post (~> 2)
|
|
35
42
|
faraday-net_http (1.0.1)
|
|
36
43
|
faraday-net_http_persistent (1.2.0)
|
|
37
|
-
|
|
44
|
+
faraday-patron (1.0.0)
|
|
45
|
+
faraday-rack (1.0.0)
|
|
46
|
+
faraday-retry (1.0.3)
|
|
47
|
+
faraday_middleware (1.2.0)
|
|
38
48
|
faraday (~> 1.0)
|
|
39
|
-
jaro_winkler (1.5.
|
|
40
|
-
|
|
49
|
+
jaro_winkler (1.5.6)
|
|
50
|
+
json (2.6.3)
|
|
51
|
+
kramdown (2.4.0)
|
|
41
52
|
rexml
|
|
42
53
|
kramdown-parser-gfm (1.1.0)
|
|
43
54
|
kramdown (~> 2.0)
|
|
44
|
-
|
|
45
|
-
multipart-post (2.
|
|
46
|
-
net-http-persistent (4.0.
|
|
55
|
+
language_server-protocol (3.17.0.3)
|
|
56
|
+
multipart-post (2.3.0)
|
|
57
|
+
net-http-persistent (4.0.2)
|
|
47
58
|
connection_pool (~> 2.2)
|
|
48
|
-
nokogiri (1.
|
|
49
|
-
mini_portile2 (~> 2.5.0)
|
|
59
|
+
nokogiri (1.15.2-arm64-darwin)
|
|
50
60
|
racc (~> 1.4)
|
|
51
|
-
nokogiri (1.
|
|
61
|
+
nokogiri (1.15.2-x86_64-linux)
|
|
52
62
|
racc (~> 1.4)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
parallel (1.20.1)
|
|
56
|
-
parser (3.0.2.0)
|
|
63
|
+
parallel (1.23.0)
|
|
64
|
+
parser (3.2.2.3)
|
|
57
65
|
ast (~> 2.4.1)
|
|
58
|
-
|
|
59
|
-
|
|
66
|
+
racc
|
|
67
|
+
racc (1.7.1)
|
|
68
|
+
rainbow (3.1.1)
|
|
60
69
|
rake (10.5.0)
|
|
61
|
-
|
|
62
|
-
|
|
70
|
+
rbs (2.8.4)
|
|
71
|
+
regexp_parser (2.8.1)
|
|
72
|
+
reverse_markdown (2.1.1)
|
|
63
73
|
nokogiri
|
|
64
74
|
rexml (3.2.5)
|
|
65
|
-
rspec (3.
|
|
66
|
-
rspec-core (~> 3.
|
|
67
|
-
rspec-expectations (~> 3.
|
|
68
|
-
rspec-mocks (~> 3.
|
|
69
|
-
rspec-core (3.
|
|
70
|
-
rspec-support (~> 3.
|
|
71
|
-
rspec-expectations (3.
|
|
75
|
+
rspec (3.12.0)
|
|
76
|
+
rspec-core (~> 3.12.0)
|
|
77
|
+
rspec-expectations (~> 3.12.0)
|
|
78
|
+
rspec-mocks (~> 3.12.0)
|
|
79
|
+
rspec-core (3.12.2)
|
|
80
|
+
rspec-support (~> 3.12.0)
|
|
81
|
+
rspec-expectations (3.12.3)
|
|
72
82
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
73
|
-
rspec-support (~> 3.
|
|
74
|
-
rspec-mocks (3.
|
|
83
|
+
rspec-support (~> 3.12.0)
|
|
84
|
+
rspec-mocks (3.12.5)
|
|
75
85
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
76
|
-
rspec-support (~> 3.
|
|
77
|
-
rspec-support (3.
|
|
78
|
-
rubocop (1.
|
|
86
|
+
rspec-support (~> 3.12.0)
|
|
87
|
+
rspec-support (3.12.1)
|
|
88
|
+
rubocop (1.53.1)
|
|
89
|
+
json (~> 2.3)
|
|
90
|
+
language_server-protocol (>= 3.17.0)
|
|
79
91
|
parallel (~> 1.10)
|
|
80
|
-
parser (>= 3.
|
|
92
|
+
parser (>= 3.2.2.3)
|
|
81
93
|
rainbow (>= 2.2.2, < 4.0)
|
|
82
94
|
regexp_parser (>= 1.8, < 3.0)
|
|
83
|
-
rexml
|
|
84
|
-
rubocop-ast (>= 1.
|
|
95
|
+
rexml (>= 3.2.5, < 4.0)
|
|
96
|
+
rubocop-ast (>= 1.28.0, < 2.0)
|
|
85
97
|
ruby-progressbar (~> 1.7)
|
|
86
|
-
unicode-display_width (>=
|
|
87
|
-
rubocop-ast (1.
|
|
88
|
-
parser (>= 3.
|
|
89
|
-
ruby-
|
|
90
|
-
rake (>= 0.8.1)
|
|
91
|
-
ruby-progressbar (1.11.0)
|
|
98
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
|
99
|
+
rubocop-ast (1.29.0)
|
|
100
|
+
parser (>= 3.2.1.0)
|
|
101
|
+
ruby-progressbar (1.13.0)
|
|
92
102
|
ruby2_keywords (0.0.5)
|
|
93
|
-
simplecov (0.
|
|
103
|
+
simplecov (0.22.0)
|
|
94
104
|
docile (~> 1.1)
|
|
95
105
|
simplecov-html (~> 0.11)
|
|
96
106
|
simplecov_json_formatter (~> 0.1)
|
|
97
107
|
simplecov-html (0.12.3)
|
|
98
|
-
simplecov_json_formatter (0.1.
|
|
99
|
-
solargraph (0.
|
|
108
|
+
simplecov_json_formatter (0.1.4)
|
|
109
|
+
solargraph (0.49.0)
|
|
100
110
|
backport (~> 1.2)
|
|
101
111
|
benchmark
|
|
102
|
-
bundler (
|
|
112
|
+
bundler (~> 2.0)
|
|
103
113
|
diff-lcs (~> 1.4)
|
|
104
114
|
e2mmap
|
|
105
115
|
jaro_winkler (~> 1.5)
|
|
106
116
|
kramdown (~> 2.3)
|
|
107
117
|
kramdown-parser-gfm (~> 1.1)
|
|
108
118
|
parser (~> 3.0)
|
|
109
|
-
|
|
110
|
-
|
|
119
|
+
rbs (~> 2.0)
|
|
120
|
+
reverse_markdown (~> 2.0)
|
|
121
|
+
rubocop (~> 1.38)
|
|
111
122
|
thor (~> 1.0)
|
|
112
123
|
tilt (~> 2.0)
|
|
113
124
|
yard (~> 0.9, >= 0.9.24)
|
|
114
|
-
thor (1.
|
|
115
|
-
tilt (2.0
|
|
116
|
-
unicode-display_width (2.
|
|
117
|
-
yard (0.9.
|
|
125
|
+
thor (1.2.2)
|
|
126
|
+
tilt (2.2.0)
|
|
127
|
+
unicode-display_width (2.4.2)
|
|
128
|
+
yard (0.9.34)
|
|
118
129
|
|
|
119
130
|
PLATFORMS
|
|
120
|
-
|
|
121
|
-
x86_64-darwin-20
|
|
131
|
+
arm64-darwin-21
|
|
122
132
|
x86_64-linux
|
|
123
133
|
|
|
124
134
|
DEPENDENCIES
|
|
@@ -128,9 +138,8 @@ DEPENDENCIES
|
|
|
128
138
|
promoted-ruby-client!
|
|
129
139
|
rake (~> 10.0)
|
|
130
140
|
rspec (~> 3.0)
|
|
131
|
-
ruby-debug-ide
|
|
132
141
|
simplecov
|
|
133
142
|
solargraph
|
|
134
143
|
|
|
135
144
|
BUNDLED WITH
|
|
136
|
-
2.
|
|
145
|
+
2.4.9
|
data/dev.md
CHANGED
|
@@ -10,5 +10,5 @@ bundle exec rspec
|
|
|
10
10
|
2. Get credentials for deployment from 1password.
|
|
11
11
|
3. Modify `promoted-ruby-client.gemspec`'s push block.
|
|
12
12
|
4. Run `gem build promoted-ruby-client.gemspec` to generate `gem`.
|
|
13
|
-
5. Run (using new output) `gem push promoted-ruby-client-2.0.
|
|
13
|
+
5. Run (using new output) `gem push promoted-ruby-client-2.0.2.gem`
|
|
14
14
|
6. Update README with new version.
|
data/lib/promoted/ruby/client.rb
CHANGED
|
@@ -177,22 +177,23 @@ module Promoted
|
|
|
177
177
|
if should_apply_treatment(cohort_membership_to_log)
|
|
178
178
|
# Call Delivery API to get insertions to use
|
|
179
179
|
delivery_request_params = delivery_request_builder.delivery_request_params
|
|
180
|
+
# Don't send shadow traffic if we've already tried normal traffic.
|
|
181
|
+
should_send_shadow_traffic = false
|
|
180
182
|
begin
|
|
181
183
|
response = send_request(delivery_request_params, @delivery_endpoint, @delivery_timeout_millis, @delivery_api_key, headers)
|
|
182
184
|
@validator.validate_response!(response)
|
|
185
|
+
raise ValidationError.new("Response shoul be a Hash") if !response.is_a?(Hash)
|
|
186
|
+
response_insertions = response && response[:insertion] || []
|
|
187
|
+
insertions_from_delivery = (response != nil && !deliver_err);
|
|
183
188
|
rescue StandardError => err
|
|
184
189
|
# Currently we don't propagate errors to the SDK caller, but rather default to returning
|
|
185
190
|
# the request insertions.
|
|
186
191
|
deliver_err = true
|
|
187
192
|
@logger.error("Error calling delivery: " + err.message) if @logger
|
|
188
193
|
end
|
|
189
|
-
should_send_shadow_traffic = false
|
|
190
194
|
else
|
|
191
195
|
should_send_shadow_traffic &&= @send_shadow_traffic_for_control
|
|
192
196
|
end
|
|
193
|
-
|
|
194
|
-
insertions_from_delivery = (response != nil && !deliver_err);
|
|
195
|
-
response_insertions = response && response[:insertion] || []
|
|
196
197
|
end
|
|
197
198
|
|
|
198
199
|
should_send_shadow_traffic &&= should_send_as_shadow_traffic?
|
|
@@ -337,7 +338,9 @@ module Promoted
|
|
|
337
338
|
response = nil
|
|
338
339
|
begin
|
|
339
340
|
response = send_request(delivery_request_params, @delivery_endpoint, @delivery_timeout_millis, @delivery_api_key, headers, @async_shadow_traffic)
|
|
340
|
-
|
|
341
|
+
if response != nil
|
|
342
|
+
@validator.validate_response!(response)
|
|
343
|
+
end
|
|
341
344
|
rescue StandardError => err
|
|
342
345
|
@logger.warn("Shadow traffic call failed with #{err}") if @logger
|
|
343
346
|
return
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: promoted-ruby-client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- scottmcmaster
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-06-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|