baza.rb 0.14.3 → 0.14.4

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: f1acb9dcb930e9c2841c7539677b8b72ffc0fc027298c966461fcb6c695d8c97
4
- data.tar.gz: 98f85b7b8ec04310d464713020a346c70d3373c6ddfb15c380e59524afc6aa49
3
+ metadata.gz: 95c2592ece77b7cd583876c9e59e182b782f2ea7bde62d6bf8eeca5b8c1698bb
4
+ data.tar.gz: 645790f7dd14d726ccbb93420988b1393a58937a6e399cf3aaaab24a9ade1526
5
5
  SHA512:
6
- metadata.gz: a8ec276866b3ec4b5f33ab0b2c9b45169ebcd3e994f33d28778e23dd0da94cb3f000265cef3b2ad653460c64b4cda670cc6c57b75d08af5630a40f4e1da7b3d8
7
- data.tar.gz: 47b362a5d1da21f98c2477bdb29b28b771f614d1b12e8034660cf96d073fff4a9ba67ffc3089e8d1c45a3d2377980c858a8c6721c25fb37b033d4ae087a593bc
6
+ metadata.gz: e2c409181614ee9f56da06b11061dc573f263e6f224130a5278847818645b052fe3b00be57448da61e4256ac8e9a4cc7bce425993f9522e513603641e370150a
7
+ data.tar.gz: 5a18ecae4d599ef36f9fe6c273a53cd40d1235402574bd79196cc5f3bd95c5c4831d9163ed133c9ce6ad843697d6353bd19b6a2034370715365248f68addd75b
data/Gemfile CHANGED
@@ -35,4 +35,4 @@ gem 'sinatra', '~>4.1', require: false
35
35
  gem 'wait_for', '~>0.1', require: false
36
36
  gem 'webmock', '~>3.24', require: false
37
37
  gem 'webrick', '~>1.9', require: false
38
- gem 'yard', '0.9.38', require: false # GPL
38
+ gem 'yard', '0.9.43', require: false # GPL
data/Gemfile.lock CHANGED
@@ -17,7 +17,7 @@ PATH
17
17
  GEM
18
18
  remote: https://rubygems.org/
19
19
  specs:
20
- activesupport (8.1.2)
20
+ activesupport (8.1.3)
21
21
  base64
22
22
  bigdecimal
23
23
  concurrent-ruby (~> 1.0, >= 1.3.1)
@@ -58,7 +58,7 @@ GEM
58
58
  ffi (>= 1.15.0)
59
59
  expgen (0.1.1)
60
60
  parslet
61
- factbase (0.19.4)
61
+ factbase (0.19.10)
62
62
  backtrace (~> 0.4)
63
63
  decoor (~> 0.1)
64
64
  ellipsized (~> 0.3)
@@ -90,16 +90,17 @@ GEM
90
90
  i18n (1.14.8)
91
91
  concurrent-ruby (~> 1.0)
92
92
  iri (0.11.8)
93
- json (2.18.1)
93
+ json (2.19.4)
94
94
  jsonpath (1.1.5)
95
95
  multi_json
96
96
  language_server-protocol (3.17.0.5)
97
97
  lint_roller (1.1.0)
98
98
  logger (1.7.0)
99
- loog (0.7.2)
99
+ loog (0.8.0)
100
100
  ellipsized
101
101
  logger (~> 1.0)
102
- minitest (6.0.1)
102
+ minitest (6.0.6)
103
+ drb (~> 2.0)
103
104
  prism (~> 1.5)
104
105
  minitest-reporters (1.7.1)
105
106
  ansi
@@ -113,13 +114,13 @@ GEM
113
114
  net-http (0.9.1)
114
115
  uri (>= 0.11.1)
115
116
  nio4r (2.7.5)
116
- nokogiri (1.19.0-arm64-darwin)
117
+ nokogiri (1.19.3-arm64-darwin)
117
118
  racc (~> 1.4)
118
- nokogiri (1.19.0-x86_64-darwin)
119
+ nokogiri (1.19.3-x86_64-darwin)
119
120
  racc (~> 1.4)
120
- nokogiri (1.19.0-x86_64-linux-gnu)
121
+ nokogiri (1.19.3-x86_64-linux-gnu)
121
122
  racc (~> 1.4)
122
- nokogiri (1.19.0-x86_64-linux-musl)
123
+ nokogiri (1.19.3-x86_64-linux-musl)
123
124
  racc (~> 1.4)
124
125
  online (0.3.0)
125
126
  openssl (>= 3)
@@ -127,8 +128,7 @@ GEM
127
128
  openssl (4.0.0)
128
129
  os (1.1.4)
129
130
  others (0.1.1)
130
- pact (1.67.3)
131
- jsonpath (~> 1.0)
131
+ pact (1.67.5)
132
132
  pact-mock_service (~> 3.0, >= 3.3.1)
133
133
  pact-support (~> 1.21, >= 1.21.2)
134
134
  rack
@@ -136,7 +136,6 @@ GEM
136
136
  rack-test (>= 0.6.3, < 3.0.0)
137
137
  rainbow (~> 3.1)
138
138
  rspec (~> 3.0)
139
- string_pattern (~> 2.0)
140
139
  thor (>= 0.20, < 2.0)
141
140
  webrick (~> 1.8)
142
141
  zeitwerk (~> 2.3)
@@ -165,8 +164,8 @@ GEM
165
164
  jsonpath (~> 1.0)
166
165
  rainbow (~> 3.1.1)
167
166
  string_pattern (~> 2.0)
168
- parallel (1.27.0)
169
- parser (3.3.10.1)
167
+ parallel (1.28.0)
168
+ parser (3.3.11.1)
170
169
  ast (~> 2.4.1)
171
170
  racc
172
171
  parslet (2.0.0)
@@ -177,13 +176,13 @@ GEM
177
176
  public_suffix (7.0.2)
178
177
  puma (7.2.0)
179
178
  nio4r (~> 2.0)
180
- qbash (0.7.2)
179
+ qbash (0.8.3)
181
180
  backtrace (> 0)
182
181
  elapsed (> 0)
183
182
  loog (> 0)
184
183
  tago (> 0)
185
184
  racc (1.8.1)
186
- rack (3.2.4)
185
+ rack (3.2.6)
187
186
  rack-protection (4.2.1)
188
187
  base64 (>= 0.1.0)
189
188
  logger (>= 1.6.0)
@@ -198,14 +197,14 @@ GEM
198
197
  rackup (2.3.1)
199
198
  rack (>= 3)
200
199
  rainbow (3.1.1)
201
- rake (13.3.1)
202
- random-port (0.7.6)
200
+ rake (13.4.2)
201
+ random-port (0.8.2)
203
202
  tago (~> 0.0)
204
203
  rdoc (7.1.0)
205
204
  erb
206
205
  psych (>= 4.0.0)
207
206
  tsort
208
- regexp_parser (2.11.3)
207
+ regexp_parser (2.12.0)
209
208
  retries (0.0.5)
210
209
  rexml (3.4.4)
211
210
  rspec (3.13.2)
@@ -217,22 +216,22 @@ GEM
217
216
  rspec-expectations (3.13.5)
218
217
  diff-lcs (>= 1.2.0, < 2.0)
219
218
  rspec-support (~> 3.13.0)
220
- rspec-mocks (3.13.7)
219
+ rspec-mocks (3.13.8)
221
220
  diff-lcs (>= 1.2.0, < 2.0)
222
221
  rspec-support (~> 3.13.0)
223
222
  rspec-support (3.13.7)
224
- rubocop (1.84.1)
223
+ rubocop (1.86.1)
225
224
  json (~> 2.3)
226
225
  language_server-protocol (~> 3.17.0.2)
227
226
  lint_roller (~> 1.1.0)
228
- parallel (~> 1.10)
227
+ parallel (>= 1.10)
229
228
  parser (>= 3.3.0.2)
230
229
  rainbow (>= 2.2.2, < 4.0)
231
230
  regexp_parser (>= 2.9.3, < 3.0)
232
231
  rubocop-ast (>= 1.49.0, < 2.0)
233
232
  ruby-progressbar (~> 1.7)
234
233
  unicode-display_width (>= 2.4.0, < 4.0)
235
- rubocop-ast (1.49.0)
234
+ rubocop-ast (1.49.1)
236
235
  parser (>= 3.3.7.2)
237
236
  prism (~> 1.7)
238
237
  rubocop-minitest (0.38.2)
@@ -288,8 +287,8 @@ GEM
288
287
  hashdiff (>= 0.4.0, < 2.0.0)
289
288
  webrick (1.9.2)
290
289
  yaml (0.4.0)
291
- yard (0.9.38)
292
- zeitwerk (2.7.4)
290
+ yard (0.9.43)
291
+ zeitwerk (2.7.5)
293
292
 
294
293
  PLATFORMS
295
294
  arm64-darwin
@@ -328,7 +327,7 @@ DEPENDENCIES
328
327
  wait_for (~> 0.1)
329
328
  webmock (~> 3.24)
330
329
  webrick (~> 1.9)
331
- yard (= 0.9.38)
330
+ yard (= 0.9.43)
332
331
 
333
332
  BUNDLED WITH
334
333
  2.6.8
@@ -13,5 +13,5 @@
13
13
  # Copyright:: Copyright (c) 2024-2026 Yegor Bugayenko
14
14
  # License:: MIT
15
15
  class BazaRb
16
- VERSION = '0.14.3'
16
+ VERSION = '0.14.4'
17
17
  end
data/lib/baza-rb.rb CHANGED
@@ -44,6 +44,11 @@ class BazaRb
44
44
  # When request timeout.
45
45
  class TimedOut < StandardError; end
46
46
 
47
+ # When libcurl reported a transport-level failure (HTTP code 0, e.g.
48
+ # connection reset, partial file, SSL error). Subclasses {TimedOut} so
49
+ # {#retry_it} retries it as a transient failure.
50
+ class ConnectionFailed < TimedOut; end
51
+
47
52
  # Unexpected response arrived from the server.
48
53
  class BadResponse < StandardError; end
49
54
 
@@ -226,6 +231,7 @@ class BazaRb
226
231
  raise 'The "pname" of the product is nil' if pname.nil?
227
232
  raise 'The "pname" of the product may not be empty' if pname.empty?
228
233
  raise 'The "owner" of the lock is nil' if owner.nil?
234
+ raise 'The "owner" of the lock may not be empty' if owner.empty?
229
235
  elapsed(@loog, level: Logger::INFO) do
230
236
  ret = post(
231
237
  home.append('lock').append(pname),
@@ -654,7 +660,13 @@ class BazaRb
654
660
  end
655
661
  end
656
662
 
657
- # Execute a block with retries on 500 status codes.
663
+ # Execute a block with retries on server-side failures.
664
+ #
665
+ # Retries on any HTTP status >= 499. The 499 code ("Client Closed Request")
666
+ # is emitted by upstream proxies such as nginx when they abort an in-flight
667
+ # request, typically because of a load-balancer or upstream timeout. From
668
+ # the client's point of view this is a transient server-side failure and
669
+ # should be retried just like 5xx responses.
658
670
  #
659
671
  # @yield The block to execute with retries
660
672
  # @return [Object] The result of the block execution
@@ -662,7 +674,7 @@ class BazaRb
662
674
  attempt = 0
663
675
  loop do
664
676
  ret = yield
665
- if ret.code >= 500 && attempt < @retries
677
+ if ret.code >= 499 && attempt < @retries
666
678
  attempt += 1
667
679
  seconds = @pause * (2**attempt)
668
680
  @loog.info("Server seems to be in trouble (#{ret.code}), sleep #{seconds}s (attempt no.#{attempt})...")
@@ -723,7 +735,7 @@ class BazaRb
723
735
  "(r:#{ret.return_code}, m:#{ret.return_message})"
724
736
  end
725
737
  @loog.error(msg)
726
- raise ServerFailure, msg
738
+ raise(ret.code.zero? ? ConnectionFailed : ServerFailure, msg)
727
739
  end
728
740
 
729
741
  # Make a GET request.
data/pact.json CHANGED
@@ -1769,7 +1769,7 @@
1769
1769
  "client": {
1770
1770
  "name": "BazaRb",
1771
1771
  "version": "0.0.0",
1772
- "date": "2026-02-04T13:40:44Z"
1772
+ "date": "2026-05-01T05:46:22Z"
1773
1773
  }
1774
1774
  },
1775
1775
  "provider": {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: baza.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.3
4
+ version: 0.14.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko