baza.rb 0.10.1 → 0.11.0
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/Gemfile +3 -3
- data/Gemfile.lock +37 -37
- data/baza.rb.gemspec +3 -3
- data/lib/baza-rb/version.rb +1 -1
- data/lib/baza-rb.rb +60 -57
- metadata +6 -28
- data/.0pdd.yml +0 -8
- data/.gitattributes +0 -7
- data/.github/workflows/actionlint.yml +0 -25
- data/.github/workflows/codecov.yml +0 -25
- data/.github/workflows/copyrights.yml +0 -19
- data/.github/workflows/markdown-lint.yml +0 -23
- data/.github/workflows/pdd.yml +0 -19
- data/.github/workflows/rake.yml +0 -29
- data/.github/workflows/reuse.yml +0 -19
- data/.github/workflows/typos.yml +0 -19
- data/.github/workflows/xcop.yml +0 -19
- data/.github/workflows/yamllint.yml +0 -21
- data/.gitignore +0 -11
- data/.pdd +0 -7
- data/.rubocop.yml +0 -55
- data/.rultor.yml +0 -26
- data/.simplecov +0 -24
- data/.yamllint.yml +0 -7
- data/renovate.json +0 -6
- data/test/test__helper.rb +0 -32
- data/test/test_baza-rb.rb +0 -821
- data/test/test_fake.rb +0 -135
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3f6b8fd3d4ae976677a1b3307a3c5c3279b61aae5469ffb0f113103dae1c8b5
|
4
|
+
data.tar.gz: 6954c6b824ac00e1951b6dc43cc4ee0824739f7a73370599cd4ac5a1081a885d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5eccf68db6789c2e02861917eb036c6da42970182c2d92dfbf2d1c646c193e29479e2eadc11ca1eadf1cb3ea24bdfd95397f194771496a275d2d80b9dc641f4a
|
7
|
+
data.tar.gz: d229ff82c8c01651d5dc5c46f62c4b373651624e91c8a126de8888ec098c30374fad72254c86998c4a5c5f16a9f6fb09e03c29be1fd6d0fd7f14855d64fbf6f8
|
data/Gemfile
CHANGED
@@ -7,12 +7,12 @@ source 'https://rubygems.org'
|
|
7
7
|
gemspec
|
8
8
|
|
9
9
|
gem 'base64', '~>0.3', require: false
|
10
|
-
gem 'factbase', '~>0.
|
10
|
+
gem 'factbase', '~>0.16', require: false
|
11
11
|
gem 'minitest', '~>5.25', require: false
|
12
12
|
gem 'minitest-reporters', '~>1.7', require: false
|
13
|
-
gem 'online', '~>0.
|
13
|
+
gem 'online', '~>0.1', require: false
|
14
14
|
gem 'os', '~>1.1', require: false
|
15
|
-
gem 'puma', '~>
|
15
|
+
gem 'puma', '~>7.0', require: false
|
16
16
|
gem 'qbash', '~>0.4', require: false
|
17
17
|
gem 'rack', '~>3.1', require: false
|
18
18
|
gem 'rackup', '~>2.2', require: false
|
data/Gemfile.lock
CHANGED
@@ -3,7 +3,7 @@ PATH
|
|
3
3
|
specs:
|
4
4
|
baza.rb (0.0.0)
|
5
5
|
backtrace (~> 0.4)
|
6
|
-
elapsed (~> 0.
|
6
|
+
elapsed (~> 0.2)
|
7
7
|
faraday (~> 2.13)
|
8
8
|
faraday-http-cache (~> 2.5)
|
9
9
|
faraday-multipart (~> 1.1)
|
@@ -11,7 +11,7 @@ PATH
|
|
11
11
|
iri (~> 0.11)
|
12
12
|
loog (~> 0.6)
|
13
13
|
retries (~> 0.0)
|
14
|
-
tago (~> 0.
|
14
|
+
tago (~> 0.2)
|
15
15
|
typhoeus (~> 1.4)
|
16
16
|
|
17
17
|
GEM
|
@@ -23,7 +23,7 @@ GEM
|
|
23
23
|
ast (2.4.3)
|
24
24
|
backtrace (0.4.1)
|
25
25
|
base64 (0.3.0)
|
26
|
-
bigdecimal (3.2.
|
26
|
+
bigdecimal (3.2.3)
|
27
27
|
builder (3.3.0)
|
28
28
|
crack (1.0.0)
|
29
29
|
bigdecimal
|
@@ -34,18 +34,18 @@ GEM
|
|
34
34
|
loog (~> 0.6)
|
35
35
|
tago (~> 0.1)
|
36
36
|
ellipsized (0.3.0)
|
37
|
-
ethon (0.
|
37
|
+
ethon (0.15.0)
|
38
38
|
ffi (>= 1.15.0)
|
39
|
-
factbase (0.
|
39
|
+
factbase (0.16.7)
|
40
40
|
backtrace (~> 0.4)
|
41
|
-
decoor (~> 0.
|
41
|
+
decoor (~> 0.1)
|
42
42
|
ellipsized (~> 0.3)
|
43
43
|
json (~> 2.7)
|
44
44
|
logger (~> 1.0)
|
45
45
|
loog (~> 0.6)
|
46
46
|
nokogiri (~> 1.10)
|
47
|
-
others (~> 0.
|
48
|
-
tago (~> 0.
|
47
|
+
others (~> 0.1)
|
48
|
+
tago (~> 0.1)
|
49
49
|
yaml (~> 0.3)
|
50
50
|
faraday (2.13.4)
|
51
51
|
faraday-net_http (>= 2.0, < 3.5)
|
@@ -63,9 +63,9 @@ GEM
|
|
63
63
|
ffi (1.17.2-x64-mingw-ucrt)
|
64
64
|
ffi (1.17.2-x86_64-darwin)
|
65
65
|
ffi (1.17.2-x86_64-linux-gnu)
|
66
|
-
hashdiff (1.2.
|
66
|
+
hashdiff (1.2.1)
|
67
67
|
iri (0.11.2)
|
68
|
-
json (2.
|
68
|
+
json (2.15.0)
|
69
69
|
language_server-protocol (3.17.0.5)
|
70
70
|
lint_roller (1.1.0)
|
71
71
|
logger (1.7.0)
|
@@ -83,15 +83,15 @@ GEM
|
|
83
83
|
net-http (0.6.0)
|
84
84
|
uri
|
85
85
|
nio4r (2.7.4)
|
86
|
-
nokogiri (1.18.
|
86
|
+
nokogiri (1.18.10-arm64-darwin)
|
87
87
|
racc (~> 1.4)
|
88
|
-
nokogiri (1.18.
|
88
|
+
nokogiri (1.18.10-x64-mingw-ucrt)
|
89
89
|
racc (~> 1.4)
|
90
|
-
nokogiri (1.18.
|
90
|
+
nokogiri (1.18.10-x86_64-darwin)
|
91
91
|
racc (~> 1.4)
|
92
|
-
nokogiri (1.18.
|
92
|
+
nokogiri (1.18.10-x86_64-linux-gnu)
|
93
93
|
racc (~> 1.4)
|
94
|
-
online (0.0
|
94
|
+
online (0.1.0)
|
95
95
|
timeout (~> 0.4)
|
96
96
|
os (1.1.4)
|
97
97
|
others (0.1.1)
|
@@ -99,9 +99,9 @@ GEM
|
|
99
99
|
parser (3.3.9.0)
|
100
100
|
ast (~> 2.4.1)
|
101
101
|
racc
|
102
|
-
prism (1.
|
102
|
+
prism (1.5.1)
|
103
103
|
public_suffix (6.0.2)
|
104
|
-
puma (
|
104
|
+
puma (7.0.3)
|
105
105
|
nio4r (~> 2.0)
|
106
106
|
qbash (0.4.5)
|
107
107
|
backtrace (> 0)
|
@@ -109,7 +109,7 @@ GEM
|
|
109
109
|
loog (> 0)
|
110
110
|
tago (> 0)
|
111
111
|
racc (1.8.1)
|
112
|
-
rack (3.2.
|
112
|
+
rack (3.2.1)
|
113
113
|
rack-protection (4.1.1)
|
114
114
|
base64 (>= 0.1.0)
|
115
115
|
logger (>= 1.6.0)
|
@@ -121,12 +121,12 @@ GEM
|
|
121
121
|
rack (>= 3)
|
122
122
|
rainbow (3.1.1)
|
123
123
|
rake (13.3.0)
|
124
|
-
random-port (0.7.
|
125
|
-
tago (
|
126
|
-
regexp_parser (2.11.
|
124
|
+
random-port (0.7.6)
|
125
|
+
tago (~> 0.0)
|
126
|
+
regexp_parser (2.11.3)
|
127
127
|
retries (0.0.5)
|
128
|
-
rexml (3.4.
|
129
|
-
rubocop (1.
|
128
|
+
rexml (3.4.4)
|
129
|
+
rubocop (1.80.2)
|
130
130
|
json (~> 2.3)
|
131
131
|
language_server-protocol (~> 3.17.0.2)
|
132
132
|
lint_roller (~> 1.1.0)
|
@@ -137,17 +137,17 @@ GEM
|
|
137
137
|
rubocop-ast (>= 1.46.0, < 2.0)
|
138
138
|
ruby-progressbar (~> 1.7)
|
139
139
|
unicode-display_width (>= 2.4.0, < 4.0)
|
140
|
-
rubocop-ast (1.
|
140
|
+
rubocop-ast (1.47.1)
|
141
141
|
parser (>= 3.3.7.2)
|
142
142
|
prism (~> 1.4)
|
143
|
-
rubocop-minitest (0.38.
|
143
|
+
rubocop-minitest (0.38.2)
|
144
144
|
lint_roller (~> 1.1)
|
145
145
|
rubocop (>= 1.75.0, < 2.0)
|
146
146
|
rubocop-ast (>= 1.38.0, < 2.0)
|
147
|
-
rubocop-performance (1.
|
147
|
+
rubocop-performance (1.26.0)
|
148
148
|
lint_roller (~> 1.1)
|
149
149
|
rubocop (>= 1.75.0, < 2.0)
|
150
|
-
rubocop-ast (>= 1.
|
150
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
151
151
|
rubocop-rake (0.7.1)
|
152
152
|
lint_roller (~> 1.1)
|
153
153
|
rubocop (>= 1.72.1)
|
@@ -157,7 +157,7 @@ GEM
|
|
157
157
|
docile (~> 1.1)
|
158
158
|
simplecov-html (~> 0.11)
|
159
159
|
simplecov_json_formatter (~> 0.1)
|
160
|
-
simplecov-cobertura (3.
|
160
|
+
simplecov-cobertura (3.1.0)
|
161
161
|
rexml
|
162
162
|
simplecov (~> 0.19)
|
163
163
|
simplecov-html (0.13.2)
|
@@ -169,14 +169,14 @@ GEM
|
|
169
169
|
rack-protection (= 4.1.1)
|
170
170
|
rack-session (>= 2.0.0, < 3)
|
171
171
|
tilt (~> 2.0)
|
172
|
-
tago (0.
|
172
|
+
tago (0.2.0)
|
173
173
|
tilt (2.6.1)
|
174
174
|
timeout (0.4.3)
|
175
|
-
typhoeus (1.
|
176
|
-
ethon (>= 0.9.0)
|
177
|
-
unicode-display_width (3.
|
178
|
-
unicode-emoji (~> 4.
|
179
|
-
unicode-emoji (4.0
|
175
|
+
typhoeus (1.5.0)
|
176
|
+
ethon (>= 0.9.0, < 0.16.0)
|
177
|
+
unicode-display_width (3.2.0)
|
178
|
+
unicode-emoji (~> 4.1)
|
179
|
+
unicode-emoji (4.1.0)
|
180
180
|
uri (1.0.3)
|
181
181
|
wait_for (0.1.1)
|
182
182
|
webmock (3.25.1)
|
@@ -199,12 +199,12 @@ PLATFORMS
|
|
199
199
|
DEPENDENCIES
|
200
200
|
base64 (~> 0.3)
|
201
201
|
baza.rb!
|
202
|
-
factbase (~> 0.
|
202
|
+
factbase (~> 0.16)
|
203
203
|
minitest (~> 5.25)
|
204
204
|
minitest-reporters (~> 1.7)
|
205
|
-
online (~> 0.
|
205
|
+
online (~> 0.1)
|
206
206
|
os (~> 1.1)
|
207
|
-
puma (~>
|
207
|
+
puma (~> 7.0)
|
208
208
|
qbash (~> 0.4)
|
209
209
|
rack (~> 3.1)
|
210
210
|
rackup (~> 2.2)
|
data/baza.rb.gemspec
CHANGED
@@ -20,11 +20,11 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.authors = ['Yegor Bugayenko']
|
21
21
|
s.email = 'yegor256@gmail.com'
|
22
22
|
s.homepage = 'https://github.com/zerocracy/baza.rb'
|
23
|
-
s.files = `git ls-files`.split($RS)
|
23
|
+
s.files = `git ls-files | grep -v -E '^(test/|\\.|renovate)'`.split($RS)
|
24
24
|
s.rdoc_options = ['--charset=UTF-8']
|
25
25
|
s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
|
26
26
|
s.add_dependency 'backtrace', '~>0.4'
|
27
|
-
s.add_dependency 'elapsed', '~>0.
|
27
|
+
s.add_dependency 'elapsed', '~>0.2'
|
28
28
|
s.add_dependency 'faraday', '~>2.13'
|
29
29
|
s.add_dependency 'faraday-http-cache', '~>2.5'
|
30
30
|
s.add_dependency 'faraday-multipart', '~>1.1'
|
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
|
|
32
32
|
s.add_dependency 'iri', '~>0.11'
|
33
33
|
s.add_dependency 'loog', '~>0.6'
|
34
34
|
s.add_dependency 'retries', '~>0.0'
|
35
|
-
s.add_dependency 'tago', '~>0.
|
35
|
+
s.add_dependency 'tago', '~>0.2'
|
36
36
|
s.add_dependency 'typhoeus', '~>1.4'
|
37
37
|
s.metadata['rubygems_mfa_required'] = 'true'
|
38
38
|
end
|
data/lib/baza-rb/version.rb
CHANGED
data/lib/baza-rb.rb
CHANGED
@@ -102,21 +102,21 @@ class BazaRb
|
|
102
102
|
|
103
103
|
# Push factbase to the server to create a new job.
|
104
104
|
#
|
105
|
-
# @param [String] name The unique name of the
|
105
|
+
# @param [String] name The unique name of the product on the server
|
106
106
|
# @param [String] data The binary data to push to the server (factbase content)
|
107
107
|
# @param [Array<String>] meta List of metadata strings to attach to the job
|
108
108
|
# @param [Integer] chunk_size Maximum size of one chunk
|
109
109
|
# @raise [ServerFailure] If the push operation fails
|
110
|
-
def push(
|
111
|
-
raise 'The "name" of the job is nil' if
|
112
|
-
raise 'The "name" of the job may not be empty' if
|
110
|
+
def push(pname, data, meta, chunk_size: DEFAULT_CHUNK_SIZE)
|
111
|
+
raise 'The "name" of the job is nil' if pname.nil?
|
112
|
+
raise 'The "name" of the job may not be empty' if pname.empty?
|
113
113
|
raise 'The "data" of the job is nil' if data.nil?
|
114
114
|
raise 'The "meta" of the job is nil' if meta.nil?
|
115
115
|
elapsed(@loog) do
|
116
116
|
Tempfile.open do |file|
|
117
117
|
File.binwrite(file.path, data)
|
118
118
|
upload(
|
119
|
-
home.append('push').append(
|
119
|
+
home.append('push').append(pname),
|
120
120
|
file.path,
|
121
121
|
headers.merge(
|
122
122
|
'X-Zerocracy-Meta' => meta.map { |v| Base64.encode64(v).delete("\n") }.join(' ')
|
@@ -217,41 +217,41 @@ class BazaRb
|
|
217
217
|
|
218
218
|
# Lock the name.
|
219
219
|
#
|
220
|
-
# @param [String]
|
220
|
+
# @param [String] pname The name of the product on the server
|
221
221
|
# @param [String] owner The owner of the lock (any string)
|
222
222
|
# @raise [RuntimeError] If the name is already locked
|
223
223
|
# @raise [ServerFailure] If the lock operation fails
|
224
|
-
def lock(
|
225
|
-
raise 'The "
|
226
|
-
raise 'The "
|
224
|
+
def lock(pname, owner)
|
225
|
+
raise 'The "pname" of the product is nil' if pname.nil?
|
226
|
+
raise 'The "pname" of the product may not be empty' if pname.empty?
|
227
227
|
raise 'The "owner" of the lock is nil' if owner.nil?
|
228
228
|
elapsed(@loog) do
|
229
229
|
ret = post(
|
230
|
-
home.append('lock').append(
|
230
|
+
home.append('lock').append(pname),
|
231
231
|
{ 'owner' => owner },
|
232
232
|
[302, 409]
|
233
233
|
)
|
234
|
-
throw :"
|
235
|
-
raise "Failed to lock
|
234
|
+
throw :"Product name #{pname.inspect} locked at #{@host}" if ret.code == 302
|
235
|
+
raise "Failed to lock #{pname.inspect} product at #{@host}, it's already locked"
|
236
236
|
end
|
237
237
|
end
|
238
238
|
|
239
239
|
# Unlock the name.
|
240
240
|
#
|
241
|
-
# @param [String]
|
241
|
+
# @param [String] pname The name of the job on the server
|
242
242
|
# @param [String] owner The owner of the lock (any string)
|
243
243
|
# @raise [ServerFailure] If the unlock operation fails
|
244
|
-
def unlock(
|
245
|
-
raise 'The "
|
246
|
-
raise 'The "
|
244
|
+
def unlock(pname, owner)
|
245
|
+
raise 'The "pname" of the job is nil' if pname.nil?
|
246
|
+
raise 'The "pname" of the job may not be empty' if pname.empty?
|
247
247
|
raise 'The "owner" of the lock is nil' if owner.nil?
|
248
248
|
raise 'The "owner" of the lock may not be empty' if owner.empty?
|
249
249
|
elapsed(@loog) do
|
250
250
|
post(
|
251
|
-
home.append('unlock').append(
|
251
|
+
home.append('unlock').append(pname),
|
252
252
|
{ 'owner' => owner }
|
253
253
|
)
|
254
|
-
throw :"Job name
|
254
|
+
throw :"Job name #{pname.inspect} unlocked at #{@host}"
|
255
255
|
end
|
256
256
|
end
|
257
257
|
|
@@ -274,51 +274,53 @@ class BazaRb
|
|
274
274
|
|
275
275
|
# Check whether the name of the job exists on the server.
|
276
276
|
#
|
277
|
-
# @param [String] name The name of the
|
277
|
+
# @param [String] name The name of the product on the server
|
278
278
|
# @return [Boolean] TRUE if such name exists
|
279
|
-
def name_exists?(
|
280
|
-
raise 'The "
|
281
|
-
raise 'The "
|
279
|
+
def name_exists?(pname)
|
280
|
+
raise 'The "pname" of the product is nil' if pname.nil?
|
281
|
+
raise 'The "pname" of the product may not be empty' if pname.empty?
|
282
282
|
exists = false
|
283
283
|
elapsed(@loog) do
|
284
|
-
ret = get(home.append('exists').append(
|
284
|
+
ret = get(home.append('exists').append(pname))
|
285
285
|
exists = ret.body == 'yes'
|
286
|
-
throw :"The name
|
286
|
+
throw :"The name #{pname.inspect} #{exists ? 'exists' : "doesn't exist"} at #{@host}"
|
287
287
|
end
|
288
288
|
exists
|
289
289
|
end
|
290
290
|
|
291
291
|
# Place a single durable file on the server.
|
292
292
|
#
|
293
|
-
#
|
293
|
+
# The file provided will only be uploaded to the server if the durable
|
294
|
+
# is currently absent. If the durable is present, the file will be
|
295
|
+
# ignored. It is expected to use only small placeholder files, not real
|
296
|
+
# data.
|
297
|
+
#
|
298
|
+
# @param [String] pname The name of the product on the server
|
294
299
|
# @param [String] file The path to the file to upload
|
295
|
-
# @param [Integer] chunk_size Maximum size of one chunk
|
296
300
|
# @return [Integer] The ID of the created durable
|
297
301
|
# @raise [ServerFailure] If the upload fails
|
298
|
-
def durable_place(
|
299
|
-
raise 'The "
|
300
|
-
raise 'The "
|
302
|
+
def durable_place(pname, file)
|
303
|
+
raise 'The "pname" of the durable is nil' if pname.nil?
|
304
|
+
raise 'The "pname" of the durable may not be empty' if pname.empty?
|
301
305
|
raise 'The "file" of the durable is nil' if file.nil?
|
302
306
|
raise "The file '#{file}' is absent" unless File.exist?(file)
|
307
|
+
if File.size(file) > 1024
|
308
|
+
raise "The file '#{file}' is too big (#{File.size(file)} bytes) for durable_place(), use durable_save() instead"
|
309
|
+
end
|
303
310
|
id = nil
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
throw :"Durable ##{id} (#{file}, #{File.size(file)} bytes) placed for job \"#{jname}\" at #{@host}"
|
317
|
-
end
|
311
|
+
elapsed(@loog) do
|
312
|
+
ret = post(
|
313
|
+
home.append('durables').append('place'),
|
314
|
+
{
|
315
|
+
'pname' => pname,
|
316
|
+
'jname' => pname,
|
317
|
+
'file' => File.basename(file),
|
318
|
+
'zip' => File.open(file, 'rb')
|
319
|
+
}
|
320
|
+
)
|
321
|
+
id = ret.headers['X-Zerocracy-DurableId'].to_i
|
322
|
+
throw :"Durable ##{id} (#{file}, #{File.size(file)} bytes) placed for job \"#{pname}\" at #{@host}"
|
318
323
|
end
|
319
|
-
durable_lock(id, user_agent)
|
320
|
-
durable_save(id, file, chunk_size:)
|
321
|
-
durable_unlock(id, user_agent)
|
322
324
|
id
|
323
325
|
end
|
324
326
|
|
@@ -398,22 +400,22 @@ class BazaRb
|
|
398
400
|
|
399
401
|
# Find a durable by job name and file name.
|
400
402
|
#
|
401
|
-
# @param [String]
|
403
|
+
# @param [String] pname The name of the job
|
402
404
|
# @param [String] file The file name
|
403
405
|
# @return [Integer, nil] The ID of the durable if found, nil if not found
|
404
|
-
def durable_find(
|
405
|
-
raise 'The "
|
406
|
-
raise 'The "
|
406
|
+
def durable_find(pname, file)
|
407
|
+
raise 'The "pname" is nil' if pname.nil?
|
408
|
+
raise 'The "pname" may not be empty' if pname.empty?
|
407
409
|
raise 'The "file" is nil' if file.nil?
|
408
410
|
raise 'The "file" may not be empty' if file.empty?
|
409
411
|
id = nil
|
410
412
|
elapsed(@loog) do
|
411
|
-
ret = get(home.append('durables').append('find').add(jname:, file:), [200, 404])
|
413
|
+
ret = get(home.append('durables').append('find').add(jname: pname, pname:, file:), [200, 404])
|
412
414
|
if ret.code == 200
|
413
415
|
id = ret.body.to_i
|
414
|
-
throw :"Found durable ##{id} for job \"#{
|
416
|
+
throw :"Found durable ##{id} for job \"#{pname}\" file \"#{file}\" at #{@host}"
|
415
417
|
else
|
416
|
-
throw :"Durable not found for job \"#{
|
418
|
+
throw :"Durable not found for job \"#{pname}\" file \"#{file}\" at #{@host}"
|
417
419
|
end
|
418
420
|
end
|
419
421
|
id
|
@@ -529,15 +531,15 @@ class BazaRb
|
|
529
531
|
# for the given badge already exists, it's returned. Otherwise, the block
|
530
532
|
# is executed and its result is cached.
|
531
533
|
#
|
532
|
-
# @param [String] name Name of the
|
534
|
+
# @param [String] name Name of the product
|
533
535
|
# @param [String] badge Unique identifier for this valve/computation
|
534
536
|
# @param [String] why The reason/description for entering this valve
|
535
537
|
# @param [nil|Integer] job Optional job ID to associate with this valve
|
536
538
|
# @yield Block that computes the result if not cached
|
537
539
|
# @return [String] The cached result or newly computed result from the block
|
538
540
|
# @raise [ServerFailure] If the valve operation fails
|
539
|
-
def enter(
|
540
|
-
elapsed(@loog, good: "Entered valve #{badge} to #{
|
541
|
+
def enter(pname, badge, why, job)
|
542
|
+
elapsed(@loog, good: "Entered valve #{badge} to #{pname}") do
|
541
543
|
retry_it do
|
542
544
|
ret = get(home.append('valves').append('result').add(badge:), [200, 204])
|
543
545
|
return ret.body if ret.code == 200
|
@@ -547,7 +549,8 @@ class BazaRb
|
|
547
549
|
post(
|
548
550
|
uri,
|
549
551
|
{
|
550
|
-
'name' =>
|
552
|
+
'name' => pname,
|
553
|
+
'pname' => pname,
|
551
554
|
'badge' => badge,
|
552
555
|
'why' => why,
|
553
556
|
'result' => r.to_s
|
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.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
@@ -29,14 +29,14 @@ dependencies:
|
|
29
29
|
requirements:
|
30
30
|
- - "~>"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '0.
|
32
|
+
version: '0.2'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '0.
|
39
|
+
version: '0.2'
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: faraday
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
@@ -141,14 +141,14 @@ dependencies:
|
|
141
141
|
requirements:
|
142
142
|
- - "~>"
|
143
143
|
- !ruby/object:Gem::Version
|
144
|
-
version: '0.
|
144
|
+
version: '0.2'
|
145
145
|
type: :runtime
|
146
146
|
prerelease: false
|
147
147
|
version_requirements: !ruby/object:Gem::Requirement
|
148
148
|
requirements:
|
149
149
|
- - "~>"
|
150
150
|
- !ruby/object:Gem::Version
|
151
|
-
version: '0.
|
151
|
+
version: '0.2'
|
152
152
|
- !ruby/object:Gem::Dependency
|
153
153
|
name: typhoeus
|
154
154
|
requirement: !ruby/object:Gem::Requirement
|
@@ -173,24 +173,6 @@ extra_rdoc_files:
|
|
173
173
|
- LICENSE.txt
|
174
174
|
- README.md
|
175
175
|
files:
|
176
|
-
- ".0pdd.yml"
|
177
|
-
- ".gitattributes"
|
178
|
-
- ".github/workflows/actionlint.yml"
|
179
|
-
- ".github/workflows/codecov.yml"
|
180
|
-
- ".github/workflows/copyrights.yml"
|
181
|
-
- ".github/workflows/markdown-lint.yml"
|
182
|
-
- ".github/workflows/pdd.yml"
|
183
|
-
- ".github/workflows/rake.yml"
|
184
|
-
- ".github/workflows/reuse.yml"
|
185
|
-
- ".github/workflows/typos.yml"
|
186
|
-
- ".github/workflows/xcop.yml"
|
187
|
-
- ".github/workflows/yamllint.yml"
|
188
|
-
- ".gitignore"
|
189
|
-
- ".pdd"
|
190
|
-
- ".rubocop.yml"
|
191
|
-
- ".rultor.yml"
|
192
|
-
- ".simplecov"
|
193
|
-
- ".yamllint.yml"
|
194
176
|
- Gemfile
|
195
177
|
- Gemfile.lock
|
196
178
|
- LICENSE.txt
|
@@ -202,10 +184,6 @@ files:
|
|
202
184
|
- lib/baza-rb.rb
|
203
185
|
- lib/baza-rb/fake.rb
|
204
186
|
- lib/baza-rb/version.rb
|
205
|
-
- renovate.json
|
206
|
-
- test/test__helper.rb
|
207
|
-
- test/test_baza-rb.rb
|
208
|
-
- test/test_fake.rb
|
209
187
|
homepage: https://github.com/zerocracy/baza.rb
|
210
188
|
licenses:
|
211
189
|
- MIT
|
@@ -226,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
226
204
|
- !ruby/object:Gem::Version
|
227
205
|
version: '0'
|
228
206
|
requirements: []
|
229
|
-
rubygems_version: 3.6.
|
207
|
+
rubygems_version: 3.6.9
|
230
208
|
specification_version: 4
|
231
209
|
summary: Zerocracy API Ruby Client
|
232
210
|
test_files: []
|
data/.0pdd.yml
DELETED
data/.gitattributes
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Zerocracy
|
2
|
-
# SPDX-License-Identifier: MIT
|
3
|
-
---
|
4
|
-
# yamllint disable rule:line-length
|
5
|
-
name: actionlint
|
6
|
-
'on':
|
7
|
-
push:
|
8
|
-
branches:
|
9
|
-
- master
|
10
|
-
pull_request:
|
11
|
-
branches:
|
12
|
-
- master
|
13
|
-
jobs:
|
14
|
-
actionlint:
|
15
|
-
timeout-minutes: 15
|
16
|
-
runs-on: ubuntu-24.04
|
17
|
-
steps:
|
18
|
-
- uses: actions/checkout@v5
|
19
|
-
- name: Download actionlint
|
20
|
-
id: get_actionlint
|
21
|
-
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
|
22
|
-
shell: bash
|
23
|
-
- name: Check workflow files
|
24
|
-
run: ${{ steps.get_actionlint.outputs.executable }} -color
|
25
|
-
shell: bash
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Zerocracy
|
2
|
-
# SPDX-License-Identifier: MIT
|
3
|
-
---
|
4
|
-
# yamllint disable rule:line-length
|
5
|
-
name: codecov
|
6
|
-
'on':
|
7
|
-
push:
|
8
|
-
branches:
|
9
|
-
- master
|
10
|
-
jobs:
|
11
|
-
codecov:
|
12
|
-
timeout-minutes: 15
|
13
|
-
runs-on: ubuntu-24.04
|
14
|
-
steps:
|
15
|
-
- uses: actions/checkout@v5
|
16
|
-
- uses: ruby/setup-ruby@v1
|
17
|
-
with:
|
18
|
-
ruby-version: 3.3
|
19
|
-
bundler-cache: true
|
20
|
-
- run: bundle config set --global path "$(pwd)/vendor/bundle"
|
21
|
-
- run: bundle install --no-color
|
22
|
-
- run: bundle exec rake
|
23
|
-
- uses: codecov/codecov-action@v5
|
24
|
-
with:
|
25
|
-
token: ${{ secrets.CODECOV_TOKEN }}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Zerocracy
|
2
|
-
# SPDX-License-Identifier: MIT
|
3
|
-
---
|
4
|
-
# yamllint disable rule:line-length
|
5
|
-
name: copyrights
|
6
|
-
'on':
|
7
|
-
push:
|
8
|
-
branches:
|
9
|
-
- master
|
10
|
-
pull_request:
|
11
|
-
branches:
|
12
|
-
- master
|
13
|
-
jobs:
|
14
|
-
copyrights:
|
15
|
-
timeout-minutes: 15
|
16
|
-
runs-on: ubuntu-24.04
|
17
|
-
steps:
|
18
|
-
- uses: actions/checkout@v5
|
19
|
-
- uses: yegor256/copyrights-action@0.0.12
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 Zerocracy
|
2
|
-
# SPDX-License-Identifier: MIT
|
3
|
-
---
|
4
|
-
# yamllint disable rule:line-length
|
5
|
-
name: markdown-lint
|
6
|
-
'on':
|
7
|
-
push:
|
8
|
-
branches:
|
9
|
-
- master
|
10
|
-
pull_request:
|
11
|
-
branches:
|
12
|
-
- master
|
13
|
-
paths-ignore: ['paper/**', 'sandbox/**']
|
14
|
-
concurrency:
|
15
|
-
group: markdown-lint-${{ github.ref }}
|
16
|
-
cancel-in-progress: true
|
17
|
-
jobs:
|
18
|
-
markdown-lint:
|
19
|
-
timeout-minutes: 15
|
20
|
-
runs-on: ubuntu-24.04
|
21
|
-
steps:
|
22
|
-
- uses: actions/checkout@v5
|
23
|
-
- uses: DavidAnson/markdownlint-cli2-action@v20.0.0
|