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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e743a5f01479b23e4e68d12262e93549d58a11540c0cf448fe4316c277422373
4
- data.tar.gz: 65b9c38eab75a844783f3595c05bd1ea6f1f668596f46be2ecd3e370b61a551f
3
+ metadata.gz: 11ce5ae07d4a391a8e052befa249acf77a5e1c2b8bd27af1cc5abb24d011551f
4
+ data.tar.gz: b2526b7a4b3f2940283c27930a85bcd8e9b469e63c3276271e1ef1d9ffafb096
5
5
  SHA512:
6
- metadata.gz: 68c1e692e7e5af9a3deb344fde3cbc0049e8aa6f775d524bc0a6196646e9736cbfdb269fedf4ae83a07ad24cdab94c7140e555709bf046d72530e2f151c252e1
7
- data.tar.gz: d0ef6502f473fb279a5a1379234c88f1263d7448d66e7d56cc65794d9d6692826f86e8d4934a69f80aececdf8752c993c96044f9b4146bc02d8721ae2d9dc626
6
+ metadata.gz: ca464c620e04043e7998bc12d9792931fd220b00d8fcfc9a777149a27c6b5b42710409ce48bf43787da346743837f6934df11ce56070bb725ba021c6de1c1908
7
+ data.tar.gz: 0c3a880b7aa8b8b16523cbe60f75af5ef89849ce5de16a7d19a907aad1429e27a873136d95194fa3b21c4fdc01b663087000e10ae05cb713b638f7b8cbb980b0
@@ -9,7 +9,7 @@ jobs:
9
9
  - uses: actions/checkout@v2
10
10
  - uses: ruby/setup-ruby@v1
11
11
  with:
12
- ruby-version: 2.5.1
12
+ ruby-version: 3.2.2
13
13
  bundler-cache: true
14
14
 
15
15
  - name: Build and test with rspec
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.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.1.1)
16
- concurrent-ruby (1.1.9)
17
- connection_pool (2.2.5)
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 (0.10.12)
21
- diff-lcs (1.4.4)
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.4.3)
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.1)
30
- multipart-post (>= 1.2, < 3)
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
- faraday_middleware (1.0.0)
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.4)
40
- kramdown (2.3.1)
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
- mini_portile2 (2.5.3)
45
- multipart-post (2.1.1)
46
- net-http-persistent (4.0.1)
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.11.7)
49
- mini_portile2 (~> 2.5.0)
59
+ nokogiri (1.15.2-arm64-darwin)
50
60
  racc (~> 1.4)
51
- nokogiri (1.11.7-x86_64-darwin)
61
+ nokogiri (1.15.2-x86_64-linux)
52
62
  racc (~> 1.4)
53
- nokogiri (1.11.7-x86_64-linux)
54
- racc (~> 1.4)
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
- racc (1.5.2)
59
- rainbow (3.0.0)
66
+ racc
67
+ racc (1.7.1)
68
+ rainbow (3.1.1)
60
69
  rake (10.5.0)
61
- regexp_parser (2.1.1)
62
- reverse_markdown (2.0.0)
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.10.0)
66
- rspec-core (~> 3.10.0)
67
- rspec-expectations (~> 3.10.0)
68
- rspec-mocks (~> 3.10.0)
69
- rspec-core (3.10.1)
70
- rspec-support (~> 3.10.0)
71
- rspec-expectations (3.10.1)
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.10.0)
74
- rspec-mocks (3.10.2)
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.10.0)
77
- rspec-support (3.10.2)
78
- rubocop (1.18.4)
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.0.0.0)
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.8.0, < 2.0)
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 (>= 1.4.0, < 3.0)
87
- rubocop-ast (1.8.0)
88
- parser (>= 3.0.1.1)
89
- ruby-debug-ide (0.7.2)
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.21.2)
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.3)
99
- solargraph (0.42.4)
108
+ simplecov_json_formatter (0.1.4)
109
+ solargraph (0.49.0)
100
110
  backport (~> 1.2)
101
111
  benchmark
102
- bundler (>= 1.17.2)
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
- reverse_markdown (>= 1.0.5, < 3)
110
- rubocop (>= 0.52)
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.1.0)
115
- tilt (2.0.10)
116
- unicode-display_width (2.0.0)
117
- yard (0.9.26)
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
- ruby
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.2.24
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.0.gem`
13
+ 5. Run (using new output) `gem push promoted-ruby-client-2.0.2.gem`
14
14
  6. Update README with new version.
@@ -1,7 +1,7 @@
1
1
  module Promoted
2
2
  module Ruby
3
3
  module Client
4
- VERSION = "2.0.0"
4
+ VERSION = "2.0.2"
5
5
  SERVER_VERSION = "rb." + VERSION
6
6
  end
7
7
  end
@@ -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
- @validator.validate_response!(response)
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.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-03-27 00:00:00.000000000 Z
11
+ date: 2023-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday