zold 0.31.10 → 0.32.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.
Files changed (222) hide show
  1. checksums.yaml +4 -4
  2. data/.0pdd.yml +2 -19
  3. data/.github/typos.toml +11 -0
  4. data/.github/workflows/actionlint.yml +5 -21
  5. data/.github/workflows/bashate.yml +25 -0
  6. data/.github/workflows/codecov.yml +11 -24
  7. data/.github/workflows/copyrights.yml +6 -21
  8. data/.github/workflows/hadolint.yml +14 -0
  9. data/.github/workflows/markdown-lint.yml +19 -0
  10. data/.github/workflows/pdd.yml +5 -20
  11. data/.github/workflows/rake.yml +8 -22
  12. data/.github/workflows/reuse.yml +19 -0
  13. data/.github/workflows/shellcheck.yml +19 -0
  14. data/.github/workflows/typos.yml +21 -0
  15. data/.github/workflows/xcop.yml +5 -20
  16. data/.github/workflows/yamllint.yml +5 -20
  17. data/.gitignore +9 -6
  18. data/.rubocop.yml +16 -20
  19. data/.ruby-version +1 -1
  20. data/.rultor.yml +6 -22
  21. data/Dockerfile +11 -27
  22. data/Gemfile +21 -33
  23. data/Gemfile.lock +181 -126
  24. data/Guardfile +0 -0
  25. data/INSTALL.md +80 -59
  26. data/LICENSE.txt +1 -1
  27. data/LICENSES/MIT.txt +21 -0
  28. data/README.md +183 -154
  29. data/REUSE.toml +40 -0
  30. data/Rakefile +4 -38
  31. data/bin/zold +7 -37
  32. data/cucumber.yml +2 -19
  33. data/deploy.sh +4 -22
  34. data/features/cli.feature +2 -0
  35. data/features/gem_package.feature +2 -0
  36. data/features/step_definitions/steps.rb +2 -19
  37. data/features/support/env.rb +2 -19
  38. data/fixtures/merge/asserts.rb +3 -19
  39. data/fixtures/merge/into_no_wallet/assert.rb +2 -19
  40. data/fixtures/merge/legacy_negatives_stay/assert.rb +2 -19
  41. data/fixtures/merge/legacy_negatives_stay/copies/0123456789abcdef/scores.zc +1 -1
  42. data/fixtures/merge/missed_wallets/0123456789abcdef.z +0 -2
  43. data/fixtures/merge/missed_wallets/assert.rb +2 -19
  44. data/fixtures/merge/missed_wallets/copies/0123456789abcdef/scores.zc +1 -1
  45. data/fixtures/merge/negative_overwriting/assert.rb +2 -19
  46. data/fixtures/merge/negatives_in_between/0123456789abcdef.z +0 -1
  47. data/fixtures/merge/negatives_in_between/assert.rb +2 -19
  48. data/fixtures/merge/negatives_in_between/copies/0123456789abcdef/2.zc +0 -1
  49. data/fixtures/merge/negatives_in_between/opts +1 -1
  50. data/fixtures/merge/random_expenses/assert.rb +2 -19
  51. data/fixtures/merge/random_expenses/opts +1 -1
  52. data/fixtures/merge/simple_case/assert.rb +2 -19
  53. data/fixtures/merge/simple_case/opts +1 -1
  54. data/fixtures/merge/unconfirmed_income/assert.rb +2 -19
  55. data/fixtures/scripts/_head.sh +16 -33
  56. data/fixtures/scripts/calculate-scores.sh +3 -20
  57. data/fixtures/scripts/distribute-wallet.sh +26 -43
  58. data/fixtures/scripts/print-helps.sh +5 -23
  59. data/fixtures/scripts/pull-on-start.sh +12 -29
  60. data/fixtures/scripts/push-and-pull.sh +10 -27
  61. data/fixtures/scripts/redeploy-on-upgrade.sh +18 -34
  62. data/fixtures/scripts/spread-wallets.sh +24 -40
  63. data/lib/zold/age.rb +3 -20
  64. data/lib/zold/amount.rb +3 -20
  65. data/lib/zold/cached_wallets.rb +3 -20
  66. data/lib/zold/commands/alias.rb +4 -21
  67. data/lib/zold/commands/args.rb +4 -21
  68. data/lib/zold/commands/calculate.rb +5 -22
  69. data/lib/zold/commands/clean.rb +6 -23
  70. data/lib/zold/commands/create.rb +5 -22
  71. data/lib/zold/commands/diff.rb +5 -22
  72. data/lib/zold/commands/fetch.rb +6 -23
  73. data/lib/zold/commands/invoice.rb +5 -22
  74. data/lib/zold/commands/list.rb +5 -22
  75. data/lib/zold/commands/merge.rb +7 -24
  76. data/lib/zold/commands/next.rb +5 -22
  77. data/lib/zold/commands/node.rb +4 -21
  78. data/lib/zold/commands/pay.rb +6 -23
  79. data/lib/zold/commands/propagate.rb +5 -22
  80. data/lib/zold/commands/pull.rb +5 -22
  81. data/lib/zold/commands/push.rb +5 -22
  82. data/lib/zold/commands/remote.rb +7 -24
  83. data/lib/zold/commands/remove.rb +5 -22
  84. data/lib/zold/commands/routines/audit.rb +4 -21
  85. data/lib/zold/commands/routines/gc.rb +6 -23
  86. data/lib/zold/commands/routines/reconcile.rb +5 -22
  87. data/lib/zold/commands/routines/reconnect.rb +4 -21
  88. data/lib/zold/commands/routines/retire.rb +4 -21
  89. data/lib/zold/commands/routines/spread.rb +5 -22
  90. data/lib/zold/commands/routines.rb +3 -20
  91. data/lib/zold/commands/show.rb +5 -22
  92. data/lib/zold/commands/taxes.rb +5 -22
  93. data/lib/zold/commands/thread_badge.rb +3 -20
  94. data/lib/zold/copies.rb +6 -25
  95. data/lib/zold/dir_items.rb +3 -20
  96. data/lib/zold/endless.rb +5 -22
  97. data/lib/zold/gem.rb +3 -20
  98. data/lib/zold/hands.rb +6 -23
  99. data/lib/zold/head.rb +4 -21
  100. data/lib/zold/hexnum.rb +3 -20
  101. data/lib/zold/http.rb +3 -20
  102. data/lib/zold/hungry_wallets.rb +6 -23
  103. data/lib/zold/id.rb +3 -20
  104. data/lib/zold/json_page.rb +5 -22
  105. data/lib/zold/key.rb +3 -20
  106. data/lib/zold/metronome.rb +5 -22
  107. data/lib/zold/node/async_entrance.rb +6 -23
  108. data/lib/zold/node/entrance.rb +7 -24
  109. data/lib/zold/node/farm.rb +5 -22
  110. data/lib/zold/node/farmers.rb +15 -32
  111. data/lib/zold/node/front.rb +6 -23
  112. data/lib/zold/node/journaled_pipeline.rb +8 -25
  113. data/lib/zold/node/nodup_entrance.rb +6 -23
  114. data/lib/zold/node/nospam_entrance.rb +6 -23
  115. data/lib/zold/node/pipeline.rb +6 -23
  116. data/lib/zold/node/safe_entrance.rb +4 -22
  117. data/lib/zold/node/soft_error.rb +3 -20
  118. data/lib/zold/node/spread_entrance.rb +5 -22
  119. data/lib/zold/node/sync_entrance.rb +5 -22
  120. data/lib/zold/node/trace.rb +3 -20
  121. data/lib/zold/patch.rb +6 -23
  122. data/lib/zold/prefixes.rb +3 -20
  123. data/lib/zold/remotes.rb +5 -22
  124. data/lib/zold/signature.rb +3 -20
  125. data/lib/zold/size.rb +3 -20
  126. data/lib/zold/sync_wallets.rb +5 -22
  127. data/lib/zold/tax.rb +4 -21
  128. data/lib/zold/thread_pool.rb +4 -21
  129. data/lib/zold/tree_wallets.rb +3 -20
  130. data/lib/zold/txn.rb +4 -21
  131. data/lib/zold/txns.rb +4 -21
  132. data/lib/zold/upgrades.rb +4 -21
  133. data/lib/zold/verbose_thread.rb +5 -22
  134. data/lib/zold/version.rb +4 -21
  135. data/lib/zold/version_file.rb +4 -21
  136. data/lib/zold/wallet.rb +6 -23
  137. data/lib/zold/wallets.rb +5 -23
  138. data/lib/zold.rb +3 -21
  139. data/resources/banned-wallets.log +6 -6
  140. data/test/commands/routines/test_audit.rb +3 -21
  141. data/test/commands/routines/test_gc.rb +3 -21
  142. data/test/commands/routines/test_reconcile.rb +3 -21
  143. data/test/commands/routines/test_reconnect.rb +3 -21
  144. data/test/commands/routines/test_retire.rb +3 -21
  145. data/test/commands/test_alias.rb +2 -20
  146. data/test/commands/test_calculate.rb +5 -23
  147. data/test/commands/test_clean.rb +5 -23
  148. data/test/commands/test_create.rb +6 -24
  149. data/test/commands/test_diff.rb +4 -22
  150. data/test/commands/test_fetch.rb +3 -21
  151. data/test/commands/test_invoice.rb +3 -21
  152. data/test/commands/test_list.rb +3 -21
  153. data/test/commands/test_merge.rb +12 -35
  154. data/test/commands/test_node.rb +3 -21
  155. data/test/commands/test_pay.rb +5 -23
  156. data/test/commands/test_propagate.rb +6 -24
  157. data/test/commands/test_pull.rb +4 -22
  158. data/test/commands/test_push.rb +3 -21
  159. data/test/commands/test_remote.rb +10 -28
  160. data/test/commands/test_remove.rb +7 -25
  161. data/test/commands/test_show.rb +3 -21
  162. data/test/commands/test_taxes.rb +5 -23
  163. data/test/fake_home.rb +5 -22
  164. data/test/node/fake_entrance.rb +3 -20
  165. data/test/node/fake_node.rb +5 -22
  166. data/test/node/test_async_entrance.rb +3 -21
  167. data/test/node/test_entrance.rb +7 -25
  168. data/test/node/test_farm.rb +15 -33
  169. data/test/node/test_farmers.rb +3 -21
  170. data/test/node/test_front.rb +22 -42
  171. data/test/node/test_nodup_entrance.rb +4 -22
  172. data/test/node/test_nospam_entrance.rb +6 -24
  173. data/test/node/test_safe_entrance.rb +3 -21
  174. data/test/node/test_spread_entrance.rb +4 -22
  175. data/test/node/test_sync_entrance.rb +4 -22
  176. data/test/node/test_trace.rb +4 -22
  177. data/test/test__helper.rb +32 -31
  178. data/test/test_age.rb +5 -23
  179. data/test/test_amount.rb +15 -34
  180. data/test/test_cached_wallets.rb +3 -21
  181. data/test/test_copies.rb +10 -28
  182. data/test/test_dir_items.rb +4 -22
  183. data/test/test_gem.rb +3 -21
  184. data/test/test_hands.rb +3 -21
  185. data/test/test_hexnum.rb +3 -21
  186. data/test/test_http.rb +9 -27
  187. data/test/test_hungry_wallets.rb +6 -24
  188. data/test/test_id.rb +10 -28
  189. data/test/test_json_page.rb +3 -21
  190. data/test/test_key.rb +5 -23
  191. data/test/test_metronome.rb +6 -24
  192. data/test/test_patch.rb +10 -28
  193. data/test/test_prefixes.rb +3 -21
  194. data/test/test_remotes.rb +17 -35
  195. data/test/test_signature.rb +3 -21
  196. data/test/test_size.rb +3 -21
  197. data/test/test_sync_wallets.rb +3 -21
  198. data/test/test_tax.rb +6 -24
  199. data/test/test_thread_pool.rb +6 -24
  200. data/test/test_tree_wallets.rb +4 -22
  201. data/test/test_txn.rb +3 -21
  202. data/test/test_upgrades.rb +3 -21
  203. data/test/test_verbose_thread.rb +6 -24
  204. data/test/test_version.rb +2 -20
  205. data/test/test_wallet.rb +15 -33
  206. data/test/test_wallets.rb +4 -22
  207. data/test/test_zold.rb +7 -25
  208. data/test/upgrades/test_delete_banned_wallets.rb +4 -22
  209. data/test/upgrades/test_protocol_up.rb +3 -21
  210. data/upgrades/2.rb +3 -20
  211. data/upgrades/delete_banned_wallets.rb +3 -20
  212. data/upgrades/move_wallets_into_tree.rb +3 -20
  213. data/upgrades/protocol_up.rb +3 -20
  214. data/upgrades/rename_foreign_wallets.rb +3 -20
  215. data/views/journal.haml +25 -0
  216. data/views/layout.haml +25 -0
  217. data/views/wallet.haml +25 -0
  218. data/zold.gemspec +5 -21
  219. metadata +33 -15
  220. data/.simplecov +0 -36
  221. data/lib/zold/log.rb +0 -139
  222. data/test/test_log.rb +0 -49
@@ -1,24 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2018-2024 Zerocracy
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  require 'slop'
24
7
  require 'json'
@@ -27,7 +10,7 @@ require 'zold/score'
27
10
  require_relative 'thread_badge'
28
11
  require_relative 'args'
29
12
  require_relative 'pay'
30
- require_relative '../log'
13
+ require 'loog'
31
14
  require_relative '../json_page'
32
15
  require_relative '../id'
33
16
  require_relative '../tax'
@@ -35,7 +18,7 @@ require_relative '../http'
35
18
 
36
19
  # Zold module.
37
20
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
38
- # Copyright:: Copyright (c) 2018-2024 Zerocracy
21
+ # Copyright:: Copyright (c) 2018-2025 Zerocracy
39
22
  # License:: MIT
40
23
  module Zold
41
24
  # Taxes command.
@@ -54,7 +37,7 @@ module Zold
54
37
  class Taxes
55
38
  prepend ThreadBadge
56
39
 
57
- def initialize(wallets:, remotes:, log: Log::NULL)
40
+ def initialize(wallets:, remotes:, log: Loog::NULL)
58
41
  @wallets = wallets
59
42
  @remotes = remotes
60
43
  @log = log
@@ -1,28 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2018-2024 Zerocracy
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  # Thread badge.
24
7
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
25
- # Copyright:: Copyright (c) 2018-2024 Zerocracy
8
+ # Copyright:: Copyright (c) 2018-2025 Zerocracy
26
9
  # License:: MIT
27
10
  module Zold
28
11
  # This module should be included in each command, in order to label
data/lib/zold/copies.rb CHANGED
@@ -1,38 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2018-2024 Zerocracy
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  require 'time'
24
7
  require 'openssl'
25
8
  require 'csv'
26
9
  require 'futex'
27
10
  require 'backtrace'
28
- require_relative 'log'
11
+ require 'loog'
29
12
  require_relative 'size'
30
13
  require_relative 'wallet'
31
14
  require_relative 'dir_items'
32
15
 
33
16
  # The list of copies.
34
17
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
35
- # Copyright:: Copyright (c) 2018-2024 Zerocracy
18
+ # Copyright:: Copyright (c) 2018-2025 Zerocracy
36
19
  # License:: MIT
37
20
  module Zold
38
21
  # All copies
@@ -40,7 +23,7 @@ module Zold
40
23
  # Extension for copy files
41
24
  EXT = '.zc'
42
25
 
43
- def initialize(dir, log: Log::NULL)
26
+ def initialize(dir, log: Loog::NULL)
44
27
  @dir = dir
45
28
  @log = log
46
29
  end
@@ -150,9 +133,7 @@ module Zold
150
133
  path: File.join(@dir, "#{name}#{Copies::EXT}"),
151
134
  total: scores.count,
152
135
  master: scores.any? { |s| s[:master] },
153
- score: scores.select { |s| s[:time] > Time.now - (24 * 60 * 60) }
154
- .map { |s| s[:score] }
155
- .inject(&:+) || 0
136
+ score: scores.select { |s| s[:time] > Time.now - (24 * 60 * 60) }.sum { |s| s[:score] } || 0
156
137
  }
157
138
  end.select { |c| File.exist?(c[:path]) }
158
139
  if masters_first
@@ -1,24 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2018-2024 Zerocracy
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  require 'shellwords'
24
7
 
@@ -29,7 +12,7 @@ require 'shellwords'
29
12
  # More: https://stackoverflow.com/questions/52987672/
30
13
  #
31
14
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
32
- # Copyright:: Copyright (c) 2018-2024 Zerocracy
15
+ # Copyright:: Copyright (c) 2018-2025 Zerocracy
33
16
  # License:: MIT
34
17
  module Zold
35
18
  # Items in a dir
data/lib/zold/endless.rb CHANGED
@@ -1,37 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2018-2024 Zerocracy
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
- require_relative 'log'
6
+ require 'loog'
24
7
  require_relative 'verbose_thread'
25
8
  require_relative 'age'
26
9
 
27
10
  # Endless loop.
28
11
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
29
- # Copyright:: Copyright (c) 2018-2024 Zerocracy
12
+ # Copyright:: Copyright (c) 2018-2025 Zerocracy
30
13
  # License:: MIT
31
14
  module Zold
32
15
  # Endless loop
33
16
  class Endless
34
- def initialize(title, log: Log::NULL)
17
+ def initialize(title, log: Loog::NULL)
35
18
  @title = title
36
19
  @log = log
37
20
  end
data/lib/zold/gem.rb CHANGED
@@ -1,24 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2018-2024 Zerocracy
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  require 'uri'
24
7
  require 'zold/score'
@@ -27,7 +10,7 @@ require_relative 'http'
27
10
 
28
11
  # Class representing the Zold gem on Rubygems
29
12
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
30
- # Copyright:: Copyright (c) 2018-2024 Zerocracy
13
+ # Copyright:: Copyright (c) 2018-2025 Zerocracy
31
14
  # License:: MIT
32
15
  module Zold
33
16
  # Gem
data/lib/zold/hands.rb CHANGED
@@ -1,34 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2018-2024 Zerocracy
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  require 'concurrent'
24
7
  require 'total'
25
8
  require_relative 'thread_pool'
26
- require_relative 'log'
9
+ require 'loog'
27
10
  require_relative 'endless'
28
11
 
29
12
  # Multiple threads that can do something useful together.
30
13
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
31
- # Copyright:: Copyright (c) 2018-2024 Zerocracy
14
+ # Copyright:: Copyright (c) 2018-2025 Zerocracy
32
15
  # License:: MIT
33
16
  module Zold
34
17
  # Hands
@@ -49,7 +32,7 @@ module Zold
49
32
  end
50
33
 
51
34
  # Start
52
- def self.start(max = Hands.threshold, log: Log::NULL)
35
+ def self.start(max = Hands.threshold, log: Loog::NULL)
53
36
  while POOL.count < max
54
37
  POOL.add do
55
38
  Endless.new('hands').run do
@@ -66,7 +49,7 @@ module Zold
66
49
  end
67
50
 
68
51
  # Run this code in many threads
69
- def self.exec(threads, set = (0..threads - 1).to_a, &block)
52
+ def self.exec(threads, set = (0..(threads - 1)).to_a, &block)
70
53
  raise 'The thread pool is empty' if POOL.empty?
71
54
  raise "Number of threads #{threads} has to be positive" unless threads.positive?
72
55
  list = set.dup
data/lib/zold/head.rb CHANGED
@@ -1,30 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2018-2024 Zerocracy
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  require_relative 'txn'
24
7
 
25
8
  # Head of a wallet.
26
9
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
27
- # Copyright:: Copyright (c) 2018-2024 Zerocracy
10
+ # Copyright:: Copyright (c) 2018-2025 Zerocracy
28
11
  # License:: MIT
29
12
  module Zold
30
13
  # Head of the wallet.
@@ -53,7 +36,7 @@ module Zold
53
36
 
54
37
  # Cached head.
55
38
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
56
- # Copyright:: Copyright (c) 2018-2024 Zerocracy
39
+ # Copyright:: Copyright (c) 2018-2025 Zerocracy
57
40
  # License:: MIT
58
41
  class CachedHead
59
42
  def initialize(head)
data/lib/zold/hexnum.rb CHANGED
@@ -1,29 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2018-2024 Zerocracy
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  # Hex num.
24
7
  #
25
8
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
26
- # Copyright:: Copyright (c) 2018-2024 Zerocracy
9
+ # Copyright:: Copyright (c) 2018-2025 Zerocracy
27
10
  # License:: MIT
28
11
  module Zold
29
12
  # A hex num
data/lib/zold/http.rb CHANGED
@@ -1,24 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2018-2024 Zerocracy
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  require 'rainbow'
24
7
  require 'uri'
@@ -29,7 +12,7 @@ require_relative 'version'
29
12
 
30
13
  # HTTP page.
31
14
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
32
- # Copyright:: Copyright (c) 2018-2024 Zerocracy
15
+ # Copyright:: Copyright (c) 2018-2025 Zerocracy
33
16
  # License:: MIT
34
17
  module Zold
35
18
  # Some clients waits for status method in response
@@ -1,29 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2018-2024 Zerocracy
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  require 'delegate'
24
7
  require 'zache'
25
8
  require 'shellwords'
26
- require_relative 'log'
9
+ require 'loog'
27
10
  require_relative 'thread_pool'
28
11
  require_relative 'commands/pull'
29
12
  require_relative 'commands/fetch'
@@ -31,13 +14,13 @@ require_relative 'commands/fetch'
31
14
  # Wallets that PULL what's missing, in the background.
32
15
  #
33
16
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
34
- # Copyright:: Copyright (c) 2018-2024 Zerocracy
17
+ # Copyright:: Copyright (c) 2018-2025 Zerocracy
35
18
  # License:: MIT
36
19
  module Zold
37
20
  # Wallets decorator that adds missing wallets to the queue to be pulled later.
38
21
  class HungryWallets < SimpleDelegator
39
22
  def initialize(wallets, remotes, copies, pool,
40
- log: Log::NULL, network: 'test')
23
+ log: Loog::NULL, network: 'test')
41
24
  @wallets = wallets
42
25
  @remotes = remotes
43
26
  @copies = copies
@@ -60,7 +43,7 @@ module Zold
60
43
  @log.error("Hungry queue is full with #{@queue.size} wallets, can't add #{id}")
61
44
  elsif @missed.exists?(id.to_s)
62
45
  @log.debug("Hungry queue has seen #{id} just #{Age.new(@missed.mtime(id.to_s))} ago \
63
- (amoung #{@missed.size} others) and it was not found")
46
+ (among #{@missed.size} others) and it was not found")
64
47
  else
65
48
  @mutex.synchronize do
66
49
  unless @queue.include?(id)
data/lib/zold/id.rb CHANGED
@@ -1,31 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2018-2024 Zerocracy
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  require 'csv'
24
7
  require 'securerandom'
25
8
 
26
9
  # The ID of the wallet.
27
10
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
28
- # Copyright:: Copyright (c) 2018-2024 Zerocracy
11
+ # Copyright:: Copyright (c) 2018-2025 Zerocracy
29
12
  # License:: MIT
30
13
  module Zold
31
14
  # Id of the wallet
@@ -1,30 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2018-2024 Zerocracy
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  require 'json'
24
7
 
25
8
  # JSON page.
26
9
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
27
- # Copyright:: Copyright (c) 2018-2024 Zerocracy
10
+ # Copyright:: Copyright (c) 2018-2025 Zerocracy
28
11
  # License:: MIT
29
12
  module Zold
30
13
  # JSON page
@@ -40,10 +23,10 @@ module Zold
40
23
  end
41
24
 
42
25
  def to_hash
43
- raise CantParse, "JSON is empty, can't parse#{@uri.empty? ? '' : " at #{@uri}"}" if @text.empty?
26
+ raise CantParse, "JSON is empty, can't parse#{" at #{@uri}" unless @uri.empty?}" if @text.empty?
44
27
  JSON.parse(@text)
45
28
  rescue JSON::ParserError => e
46
- raise CantParse, "Failed to parse JSON #{@uri.empty? ? '' : "at #{@uri}"} (#{short(e.message)}): #{short(@text)}"
29
+ raise CantParse, "Failed to parse JSON #{"at #{@uri}" unless @uri.empty?} (#{short(e.message)}): #{short(@text)}"
47
30
  end
48
31
 
49
32
  private
data/lib/zold/key.rb CHANGED
@@ -1,24 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2018-2024 Zerocracy
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  gem 'openssl'
24
7
  require 'openssl'
@@ -27,7 +10,7 @@ require 'tempfile'
27
10
 
28
11
  # The RSA key (either private or public).
29
12
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
30
- # Copyright:: Copyright (c) 2018-2024 Zerocracy
13
+ # Copyright:: Copyright (c) 2018-2025 Zerocracy
31
14
  # License:: MIT
32
15
  module Zold
33
16
  # A key
@@ -1,27 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2018-2024 Zerocracy
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  require 'backtrace'
24
- require_relative 'log'
7
+ require 'loog'
25
8
  require_relative 'age'
26
9
  require_relative 'endless'
27
10
  require_relative 'verbose_thread'
@@ -29,12 +12,12 @@ require_relative 'thread_pool'
29
12
 
30
13
  # Background routines.
31
14
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
32
- # Copyright:: Copyright (c) 2018-2024 Zerocracy
15
+ # Copyright:: Copyright (c) 2018-2025 Zerocracy
33
16
  # License:: MIT
34
17
  module Zold
35
18
  # Metronome
36
19
  class Metronome
37
- def initialize(log = Log::NULL)
20
+ def initialize(log = Loog::NULL)
38
21
  @log = log
39
22
  @routines = []
40
23
  @threads = ThreadPool.new('metronome', log: log)