baza.rb 0.14.0 → 0.14.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: 7b42731ee7a39431f64ebfdafd7bd4fb578bd417fa0968dcdf7e1ab64e955eef
4
- data.tar.gz: 357ad2833dc08249611d1d55da5a6a8533a79cfe4871606c2653bfa8b41d366e
3
+ metadata.gz: 26df440ccfe84171d852206f625f5ddbe7fc531205bdc49af6478f1eac318458
4
+ data.tar.gz: e8758ca5b64f2fa1f255bffbb1affea6a5a74d9e647230feab19665cf11a5023
5
5
  SHA512:
6
- metadata.gz: 9cb45551c80288ce451df626b686740adf3119a1fb7c6a81037766222168aba543c0d20c4539920cfb5dc7ce75000f87a017b7e809566413c455aa514fc57ebd
7
- data.tar.gz: f43274d67eddff023ef8a45a1e7bf5fa4a04157ec3bf17f62920ac90a6a95dbcec84759b557d8f6224a64f180c3b70d958e773cfbf6562b27873c2faa955bcdb
6
+ metadata.gz: 3c3d71a4fe52587afa624f4ce4a11c48b9f64fee61ec1fa029991a9963289093f09f767ea9d6f5ae8036efeaa2f3a7f82b2b7586a015d70207bd4fc300db7104
7
+ data.tar.gz: 8b5e149185a5954d0457c97c002bbbb55c23a509fc01cfcc4bccf8d1a4276add1a4b7fc370cc0213a0bf529d01c5da7ced1900d4037cf91216441d28a4030de3
data/Gemfile CHANGED
@@ -6,15 +6,18 @@
6
6
  source 'https://rubygems.org'
7
7
  gemspec
8
8
 
9
- gem 'activesupport', '~>7.0', require: false
9
+ gem 'activesupport', '~>8.0', require: false
10
10
  gem 'base64', '~>0.3', require: false
11
+ gem 'diff-lcs', '1.6.2', require: false # GPL
11
12
  gem 'factbase', '~>0.16', require: false
12
13
  gem 'minitest', '~>6.0', require: false
13
14
  gem 'minitest-reporters', '~>1.7', require: false
15
+ gem 'nio4r', '2.7.5', require: false
14
16
  gem 'online', '~>0.1', require: false
15
17
  gem 'os', '~>1.1', require: false
16
18
  gem 'pact', '~>1.65', require: false
17
19
  gem 'pact-ffi', '0.4.28.0', require: false
20
+ gem 'psych', '5.3.1', require: false # GPL
18
21
  gem 'puma', '~>7.0', require: false
19
22
  gem 'qbash', '~>0.4', require: false
20
23
  gem 'rack', '~>3.1', require: false
@@ -32,4 +35,4 @@ gem 'sinatra', '~>4.1', require: false
32
35
  gem 'wait_for', '~>0.1', require: false
33
36
  gem 'webmock', '~>3.24', require: false
34
37
  gem 'webrick', '~>1.9', require: false
35
- gem 'yard', '~>0.9', require: false
38
+ gem 'yard', '0.9.38', require: false # GPL
data/Gemfile.lock CHANGED
@@ -17,18 +17,19 @@ PATH
17
17
  GEM
18
18
  remote: https://rubygems.org/
19
19
  specs:
20
- activesupport (7.2.3)
20
+ activesupport (8.1.2)
21
21
  base64
22
- benchmark (>= 0.3)
23
22
  bigdecimal
24
23
  concurrent-ruby (~> 1.0, >= 1.3.1)
25
24
  connection_pool (>= 2.2.5)
26
25
  drb
27
26
  i18n (>= 1.6, < 2)
27
+ json
28
28
  logger (>= 1.4.2)
29
29
  minitest (>= 5.1)
30
30
  securerandom (>= 0.3)
31
31
  tzinfo (~> 2.0, >= 2.0.5)
32
+ uri (>= 0.13.1)
32
33
  addressable (2.8.8)
33
34
  public_suffix (>= 2.0.2, < 8.0)
34
35
  ansi (1.5.0)
@@ -36,7 +37,6 @@ GEM
36
37
  awesome_print (1.9.2)
37
38
  backtrace (0.4.1)
38
39
  base64 (0.3.0)
39
- benchmark (0.5.0)
40
40
  bigdecimal (4.0.1)
41
41
  builder (3.3.0)
42
42
  concurrent-ruby (1.3.6)
@@ -49,7 +49,7 @@ GEM
49
49
  diff-lcs (1.6.2)
50
50
  docile (1.4.1)
51
51
  drb (2.2.3)
52
- elapsed (0.2.2)
52
+ elapsed (0.3.1)
53
53
  loog (~> 0.6)
54
54
  tago (~> 0.1)
55
55
  ellipsized (0.3.0)
@@ -58,7 +58,7 @@ GEM
58
58
  ffi (>= 1.15.0)
59
59
  expgen (0.1.1)
60
60
  parslet
61
- factbase (0.19.3)
61
+ factbase (0.19.4)
62
62
  backtrace (~> 0.4)
63
63
  decoor (~> 0.1)
64
64
  ellipsized (~> 0.3)
@@ -90,7 +90,7 @@ GEM
90
90
  i18n (1.14.8)
91
91
  concurrent-ruby (~> 1.0)
92
92
  iri (0.11.8)
93
- json (2.18.0)
93
+ json (2.18.1)
94
94
  jsonpath (1.1.5)
95
95
  multi_json
96
96
  language_server-protocol (3.17.0.5)
@@ -221,7 +221,7 @@ GEM
221
221
  diff-lcs (>= 1.2.0, < 2.0)
222
222
  rspec-support (~> 3.13.0)
223
223
  rspec-support (3.13.7)
224
- rubocop (1.84.0)
224
+ rubocop (1.84.1)
225
225
  json (~> 2.3)
226
226
  language_server-protocol (~> 3.17.0.2)
227
227
  lint_roller (~> 1.1.0)
@@ -298,16 +298,19 @@ PLATFORMS
298
298
  x86_64-linux-musl
299
299
 
300
300
  DEPENDENCIES
301
- activesupport (~> 7.0)
301
+ activesupport (~> 8.0)
302
302
  base64 (~> 0.3)
303
303
  baza.rb!
304
+ diff-lcs (= 1.6.2)
304
305
  factbase (~> 0.16)
305
306
  minitest (~> 6.0)
306
307
  minitest-reporters (~> 1.7)
308
+ nio4r (= 2.7.5)
307
309
  online (~> 0.1)
308
310
  os (~> 1.1)
309
311
  pact (~> 1.65)
310
312
  pact-ffi (= 0.4.28.0)
313
+ psych (= 5.3.1)
311
314
  puma (~> 7.0)
312
315
  qbash (~> 0.4)
313
316
  rack (~> 3.1)
@@ -325,7 +328,7 @@ DEPENDENCIES
325
328
  wait_for (~> 0.1)
326
329
  webmock (~> 3.24)
327
330
  webrick (~> 1.9)
328
- yard (~> 0.9)
331
+ yard (= 0.9.38)
329
332
 
330
333
  BUNDLED WITH
331
334
  2.6.8
data/Rakefile CHANGED
@@ -23,7 +23,7 @@ task default: %i[clean test picks rubocop yard]
23
23
  require 'rake/testtask'
24
24
  desc 'Run all unit tests'
25
25
  Rake::TestTask.new(:test) do |t|
26
- Rake::Cleaner.cleanup_files(['coverage'])
26
+ Rake::Cleaner.cleanup_files(['coverage', 'BazaRb-Zerocracy.json'])
27
27
  t.libs << 'lib' << 'test'
28
28
  t.pattern = 'test/**/test_*.rb'
29
29
  t.warning = true
data/lib/baza-rb/fake.rb CHANGED
@@ -219,29 +219,6 @@ class BazaRb::Fake
219
219
  42
220
220
  end
221
221
 
222
- # Pop the next available job from the server's queue.
223
- #
224
- # @param [String] owner Identifier of who is taking the job
225
- # @param [String] zip The local file path where the job's ZIP will be saved
226
- # @return [Boolean] Always returns TRUE and creates an empty file
227
- # rubocop:disable Naming/PredicateMethod
228
- def pop(owner, zip)
229
- assert_owner(owner)
230
- FileUtils.mkdir_p(File.dirname(zip))
231
- FileUtils.touch(zip)
232
- true
233
- end
234
- # rubocop:enable Naming/PredicateMethod
235
-
236
- # Submit a ZIP archive to finish a previously popped job.
237
- #
238
- # @param [Integer] id The ID of the job to finish
239
- # @param [String] zip The path to the ZIP file containing job results
240
- def finish(id, zip)
241
- assert_id(id)
242
- assert_file(zip)
243
- end
244
-
245
222
  # Enter a valve to cache or retrieve a computation result.
246
223
  #
247
224
  # @param [String] name Name of the job
@@ -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.0'
16
+ VERSION = '0.14.2'
17
17
  end
data/lib/baza-rb.rb CHANGED
@@ -484,47 +484,6 @@ class BazaRb
484
484
  id
485
485
  end
486
486
 
487
- # Pop the next available job from the server's queue.
488
- #
489
- # @param [String] owner Identifier of who is taking the job (any descriptive text)
490
- # @param [String] zip The local file path where the job's ZIP archive will be saved
491
- # @return [Boolean] TRUE if a job was successfully popped, FALSE if queue is empty
492
- # @raise [ServerFailure] If the pop operation fails
493
- def pop(owner, zip)
494
- success = false
495
- elapsed(@loog, level: Logger::INFO) do
496
- uri = home.append('pop').add(owner:)
497
- ret = get(uri, [204, 302])
498
- if ret.code == 204
499
- FileUtils.rm_f(zip)
500
- throw :"Nothing to pop at #{uri}"
501
- end
502
- job = ret.headers['X-Zerocracy-JobId']
503
- raise 'Job ID is not returned in X-Zerocracy-JobId' if job.nil?
504
- raise "Job ID returned in X-Zerocracy-JobId is not valid (#{job.inspect})" unless job.match?(/^[0-9]+$/)
505
- download(uri.add(job:), zip)
506
- success = true
507
- throw :"Popped #{File.size(zip)} bytes in ZIP archive at #{@host}"
508
- end
509
- success
510
- end
511
-
512
- # Submit a ZIP archive to finish a previously popped job.
513
- #
514
- # @param [Integer] id The ID of the job to finish
515
- # @param [String] zip The path to the ZIP file containing job results
516
- # @raise [ServerFailure] If the submission fails
517
- def finish(id, zip)
518
- raise 'The ID of the job is nil' if id.nil?
519
- raise 'The ID of the job must be a positive integer' unless id.positive?
520
- raise 'The "zip" of the job is nil' if zip.nil?
521
- raise "The 'zip' file is absent: #{zip}" unless File.exist?(zip)
522
- elapsed(@loog, level: Logger::INFO) do
523
- upload(home.append('finish').add(id:), zip)
524
- throw :"Pushed #{File.size(zip)} bytes to #{@host}, finished job ##{id}"
525
- end
526
- end
527
-
528
487
  # Enter a valve to cache or retrieve a computation result.
529
488
  #
530
489
  # Valves prevent duplicate computations by caching results. If a result
@@ -925,7 +884,7 @@ class BazaRb
925
884
  File.binread(file)
926
885
  end
927
886
  params[:body] = slice
928
- params[:headers]['Content-Length'] = slice.bytesize
887
+ params[:headers]['Content-Length'] = slice.bytesize.to_s
929
888
  params = zipped(params) if @compress
930
889
  ret =
931
890
  retry_it do