sibit 0.25.1 → 0.27.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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +18 -28
  3. data/Gemfile.lock +187 -0
  4. data/LICENSE.txt +1 -1
  5. data/LICENSES/MIT.txt +21 -0
  6. data/README.md +80 -60
  7. data/REUSE.toml +35 -0
  8. data/Rakefile +3 -29
  9. data/bin/sibit +9 -28
  10. data/cucumber.yml +3 -0
  11. data/features/cli.feature +2 -0
  12. data/features/gem_package.feature +4 -1
  13. data/features/step_definitions/steps.rb +2 -19
  14. data/features/support/env.rb +2 -19
  15. data/lib/sibit/bestof.rb +5 -22
  16. data/lib/sibit/bitcoin/base58.rb +50 -0
  17. data/lib/sibit/bitcoin/key.rb +87 -0
  18. data/lib/sibit/bitcoin/script.rb +58 -0
  19. data/lib/sibit/bitcoin/tx.rb +212 -0
  20. data/lib/sibit/bitcoin/txbuilder.rb +120 -0
  21. data/lib/sibit/bitcoinchain.rb +5 -22
  22. data/lib/sibit/blockchain.rb +5 -22
  23. data/lib/sibit/blockchair.rb +5 -22
  24. data/lib/sibit/btc.rb +6 -23
  25. data/lib/sibit/cex.rb +5 -22
  26. data/lib/sibit/cryptoapis.rb +5 -22
  27. data/lib/sibit/error.rb +3 -20
  28. data/lib/sibit/fake.rb +3 -20
  29. data/lib/sibit/firstof.rb +5 -22
  30. data/lib/sibit/http.rb +3 -20
  31. data/lib/sibit/json.rb +6 -23
  32. data/lib/sibit/version.rb +4 -21
  33. data/lib/sibit.rb +31 -40
  34. data/logo.svg +1 -1
  35. data/sibit.gemspec +16 -32
  36. metadata +26 -48
  37. data/.0pdd.yml +0 -9
  38. data/.gitattributes +0 -7
  39. data/.github/workflows/codecov.yml +0 -21
  40. data/.github/workflows/pdd.yml +0 -15
  41. data/.github/workflows/rake.yml +0 -24
  42. data/.github/workflows/xcop.yml +0 -17
  43. data/.gitignore +0 -8
  44. data/.pdd +0 -7
  45. data/.rubocop.yml +0 -38
  46. data/.rultor.yml +0 -21
  47. data/.simplecov +0 -40
  48. data/lib/sibit/earn.rb +0 -102
  49. data/lib/sibit/log.rb +0 -49
  50. data/renovate.json +0 -6
  51. data/test/test__helper.rb +0 -29
  52. data/test/test_bestof.rb +0 -62
  53. data/test/test_bitcoinchain.rb +0 -73
  54. data/test/test_blockchain.rb +0 -58
  55. data/test/test_blockchair.rb +0 -43
  56. data/test/test_btc.rb +0 -117
  57. data/test/test_cex.rb +0 -43
  58. data/test/test_cryptoapis.rb +0 -51
  59. data/test/test_fake.rb +0 -55
  60. data/test/test_firstof.rb +0 -62
  61. data/test/test_json.rb +0 -40
  62. data/test/test_live.rb +0 -138
  63. data/test/test_sibit.rb +0 -209
data/lib/sibit.rb CHANGED
@@ -1,33 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2019-2023 Yegor Bugayenko
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) 2019-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
- require 'bitcoin'
6
+ require 'loog'
24
7
  require_relative 'sibit/version'
25
- require_relative 'sibit/log'
26
8
  require_relative 'sibit/blockchain'
9
+ require_relative 'sibit/bitcoin/base58'
10
+ require_relative 'sibit/bitcoin/key'
11
+ require_relative 'sibit/bitcoin/script'
12
+ require_relative 'sibit/bitcoin/tx'
13
+ require_relative 'sibit/bitcoin/txbuilder'
27
14
  # Sibit main class.
28
15
  #
29
16
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
30
- # Copyright:: Copyright (c) 2019-2023 Yegor Bugayenko
17
+ # Copyright:: Copyright (c) 2019-2025 Yegor Bugayenko
31
18
  # License:: MIT
32
19
  class Sibit
33
20
  # Constructor.
@@ -46,9 +33,9 @@ class Sibit
46
33
  #
47
34
  # The +api+ argument can be an object or an array of objects. If an array
48
35
  # is provided, we will make an attempt to try them one by one, until
49
- # one of them succeedes.
50
- def initialize(log: $stdout, api: Sibit::Blockchain.new(log: Sibit::Log.new(log)))
51
- @log = Sibit::Log.new(log)
36
+ # one of them succeeds.
37
+ def initialize(log: Loog::NULL, api: Sibit::Blockchain.new(log: log))
38
+ @log = log
52
39
  @api = api
53
40
  end
54
41
 
@@ -58,18 +45,16 @@ class Sibit
58
45
  @api.price(currency)
59
46
  end
60
47
 
61
- # Generates new Bitcon private key and returns in Hash160 format.
48
+ # Generates new Bitcoin private key and returns in Hash160 format.
62
49
  def generate
63
50
  key = Bitcoin::Key.generate.priv
64
51
  @log.info("Bitcoin private key generated: #{key[0..8]}...")
65
52
  key
66
53
  end
67
54
 
68
- # Creates Bitcon address using the private key in Hash160 format.
55
+ # Creates Bitcoin address using the private key in Hash160 format.
69
56
  def create(pvt)
70
- key = Bitcoin::Key.new
71
- key.priv = pvt
72
- key.addr
57
+ Bitcoin::Key.new(pvt).addr
73
58
  end
74
59
 
75
60
  # Gets the balance of the address, in satoshi.
@@ -116,7 +101,7 @@ class Sibit
116
101
  def pay(amount, fee, sources, target, change, skip_utxo: [])
117
102
  p = price('USD')
118
103
  satoshi = satoshi(amount)
119
- builder = Bitcoin::Builder::TxBuilder.new
104
+ builder = Bitcoin::TxBuilder.new
120
105
  unspent = 0
121
106
  size = 100
122
107
  utxos = @api.utxos(sources.keys)
@@ -131,8 +116,8 @@ class Sibit
131
116
  builder.input do |i|
132
117
  i.prev_out(utxo[:hash])
133
118
  i.prev_out_index(utxo[:index])
134
- i.prev_out_script = utxo[:script]
135
- address = Bitcoin::Script.new(utxo[:script]).get_address
119
+ i.prev_out_script = script_hex(utxo[:script])
120
+ address = Bitcoin::Script.new(script_hex(utxo[:script])).address
136
121
  i.signature_key(key(sources[address]))
137
122
  end
138
123
  size += 180
@@ -152,16 +137,16 @@ class Sibit
152
137
  tx = builder.tx(
153
138
  input_value: unspent,
154
139
  leave_fee: true,
155
- extra_fee: [f, Bitcoin.network[:min_tx_fee]].max,
140
+ extra_fee: [f, Bitcoin::MIN_TX_FEE].max,
156
141
  change_address: change
157
142
  )
158
- left = unspent - tx.outputs.map(&:value).inject(&:+)
143
+ left = unspent - tx.outputs.sum(&:value)
159
144
  @log.info("A new Bitcoin transaction #{tx.hash} prepared:
160
- #{tx.in.count} input#{tx.in.count > 1 ? 's' : ''}:
161
- #{tx.inputs.map { |i| " in: #{i.prev_out.bth}:#{i.prev_out_index}" }.join("\n ")}
162
- #{tx.out.count} output#{tx.out.count > 1 ? 's' : ''}:
163
- #{tx.outputs.map { |o| "out: #{o.script.bth} / #{num(o.value, p)}" }.join("\n ")}
164
- Min tx fee: #{num(Bitcoin.network[:min_tx_fee], p)}
145
+ #{tx.in.count} input#{'s' if tx.in.count > 1}:
146
+ #{tx.inputs.map { |i| " in: #{i.prev_out.unpack1('H*')}:#{i.prev_out_index}" }.join("\n ")}
147
+ #{tx.out.count} output#{'s' if tx.out.count > 1}:
148
+ #{tx.outputs.map { |o| "out: #{o.script_hex} / #{num(o.value, p)}" }.join("\n ")}
149
+ Min tx fee: #{num(Bitcoin::MIN_TX_FEE, p)}
165
150
  Fee requested: #{num(f, p)} as \"#{fee}\"
166
151
  Fee actually paid: #{num(left, p)}
167
152
  Tx size: #{size} bytes
@@ -291,4 +276,10 @@ in block #{block} (by #{json[:provider]})")
291
276
  def key(hash160)
292
277
  Bitcoin::Key.new(hash160)
293
278
  end
279
+
280
+ # Convert script to hex string if needed.
281
+ def script_hex(script)
282
+ return script if script.is_a?(String) && script.match?(/\A[0-9a-f]+\z/i)
283
+ script.unpack1('H*')
284
+ end
294
285
  end
data/logo.svg CHANGED
@@ -16,4 +16,4 @@
16
16
  </text>
17
17
  </g>
18
18
  </g>
19
- </svg>
19
+ </svg>
data/sibit.gemspec CHANGED
@@ -1,24 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2019-2023 Yegor Bugayenko
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 NONINFRINGEMENT. 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) 2019-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  require 'English'
24
7
 
@@ -34,22 +17,23 @@ Gem::Specification.new do |s|
34
17
  s.version = Sibit::VERSION
35
18
  s.license = 'MIT'
36
19
  s.summary = 'Simple Bitcoin Client'
37
- s.description = "This is a simple Bitcoin client, to use from command line \
38
- or from your Ruby app. You don't need to run any Bitcoin software, \
39
- no need to install anything, etc. All you need is just a command line \
40
- and Ruby 2.5+."
20
+ s.description =
21
+ 'This is a simple Bitcoin client, to use from command line ' \
22
+ 'or from your Ruby app. You don\'t need to run any Bitcoin software, ' \
23
+ 'no need to install anything, etc. All you need is just a command line ' \
24
+ 'and Ruby 2.5+.'
41
25
  s.authors = ['Yegor Bugayenko']
42
26
  s.email = 'yegor256@gmail.com'
43
- s.homepage = 'http://github.com/yegor256/sibit'
44
- s.files = `git ls-files`.split($RS)
27
+ s.homepage = 'https://github.com/yegor256/sibit'
28
+ s.files = `git ls-files | grep -v -E '^(test/|\\.|renovate)'`.split($RS)
45
29
  s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
46
30
  s.rdoc_options = ['--charset=UTF-8']
47
31
  s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
48
- s.add_runtime_dependency 'backtrace', '~> 0.3'
49
- s.add_runtime_dependency 'bitcoin-ruby', '0.0.20'
50
- s.add_runtime_dependency 'iri', '~> 0.5'
51
- s.add_runtime_dependency 'json', '~> 2'
52
- s.add_runtime_dependency 'openssl', '~>2.0'
53
- s.add_runtime_dependency 'retriable_proxy', '~> 1.0'
54
- s.add_runtime_dependency 'slop', '~> 4.6'
32
+ s.add_dependency 'backtrace', '~> 0.3'
33
+ s.add_dependency 'iri', '~> 0.5'
34
+ s.add_dependency 'json', '~> 2'
35
+ s.add_dependency 'loog', '~> 0.6'
36
+ s.add_dependency 'openssl', '>= 2.0'
37
+ s.add_dependency 'retriable_proxy', '~> 1.0'
38
+ s.add_dependency 'slop', '~> 4.6'
55
39
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sibit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.25.1
4
+ version: 0.27.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-12-01 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: backtrace
@@ -25,59 +24,59 @@ dependencies:
25
24
  - !ruby/object:Gem::Version
26
25
  version: '0.3'
27
26
  - !ruby/object:Gem::Dependency
28
- name: bitcoin-ruby
27
+ name: iri
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
- - - '='
30
+ - - "~>"
32
31
  - !ruby/object:Gem::Version
33
- version: 0.0.20
32
+ version: '0.5'
34
33
  type: :runtime
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
- - - '='
37
+ - - "~>"
39
38
  - !ruby/object:Gem::Version
40
- version: 0.0.20
39
+ version: '0.5'
41
40
  - !ruby/object:Gem::Dependency
42
- name: iri
41
+ name: json
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
44
  - - "~>"
46
45
  - !ruby/object:Gem::Version
47
- version: '0.5'
46
+ version: '2'
48
47
  type: :runtime
49
48
  prerelease: false
50
49
  version_requirements: !ruby/object:Gem::Requirement
51
50
  requirements:
52
51
  - - "~>"
53
52
  - !ruby/object:Gem::Version
54
- version: '0.5'
53
+ version: '2'
55
54
  - !ruby/object:Gem::Dependency
56
- name: json
55
+ name: loog
57
56
  requirement: !ruby/object:Gem::Requirement
58
57
  requirements:
59
58
  - - "~>"
60
59
  - !ruby/object:Gem::Version
61
- version: '2'
60
+ version: '0.6'
62
61
  type: :runtime
63
62
  prerelease: false
64
63
  version_requirements: !ruby/object:Gem::Requirement
65
64
  requirements:
66
65
  - - "~>"
67
66
  - !ruby/object:Gem::Version
68
- version: '2'
67
+ version: '0.6'
69
68
  - !ruby/object:Gem::Dependency
70
69
  name: openssl
71
70
  requirement: !ruby/object:Gem::Requirement
72
71
  requirements:
73
- - - "~>"
72
+ - - ">="
74
73
  - !ruby/object:Gem::Version
75
74
  version: '2.0'
76
75
  type: :runtime
77
76
  prerelease: false
78
77
  version_requirements: !ruby/object:Gem::Requirement
79
78
  requirements:
80
- - - "~>"
79
+ - - ">="
81
80
  - !ruby/object:Gem::Version
82
81
  version: '2.0'
83
82
  - !ruby/object:Gem::Dependency
@@ -116,23 +115,15 @@ executables:
116
115
  - sibit
117
116
  extensions: []
118
117
  extra_rdoc_files:
119
- - README.md
120
118
  - LICENSE.txt
119
+ - README.md
121
120
  files:
122
- - ".0pdd.yml"
123
- - ".gitattributes"
124
- - ".github/workflows/codecov.yml"
125
- - ".github/workflows/pdd.yml"
126
- - ".github/workflows/rake.yml"
127
- - ".github/workflows/xcop.yml"
128
- - ".gitignore"
129
- - ".pdd"
130
- - ".rubocop.yml"
131
- - ".rultor.yml"
132
- - ".simplecov"
133
121
  - Gemfile
122
+ - Gemfile.lock
134
123
  - LICENSE.txt
124
+ - LICENSES/MIT.txt
135
125
  - README.md
126
+ - REUSE.toml
136
127
  - Rakefile
137
128
  - bin/sibit
138
129
  - cucumber.yml
@@ -142,41 +133,29 @@ files:
142
133
  - features/support/env.rb
143
134
  - lib/sibit.rb
144
135
  - lib/sibit/bestof.rb
136
+ - lib/sibit/bitcoin/base58.rb
137
+ - lib/sibit/bitcoin/key.rb
138
+ - lib/sibit/bitcoin/script.rb
139
+ - lib/sibit/bitcoin/tx.rb
140
+ - lib/sibit/bitcoin/txbuilder.rb
145
141
  - lib/sibit/bitcoinchain.rb
146
142
  - lib/sibit/blockchain.rb
147
143
  - lib/sibit/blockchair.rb
148
144
  - lib/sibit/btc.rb
149
145
  - lib/sibit/cex.rb
150
146
  - lib/sibit/cryptoapis.rb
151
- - lib/sibit/earn.rb
152
147
  - lib/sibit/error.rb
153
148
  - lib/sibit/fake.rb
154
149
  - lib/sibit/firstof.rb
155
150
  - lib/sibit/http.rb
156
151
  - lib/sibit/json.rb
157
- - lib/sibit/log.rb
158
152
  - lib/sibit/version.rb
159
153
  - logo.svg
160
- - renovate.json
161
154
  - sibit.gemspec
162
- - test/test__helper.rb
163
- - test/test_bestof.rb
164
- - test/test_bitcoinchain.rb
165
- - test/test_blockchain.rb
166
- - test/test_blockchair.rb
167
- - test/test_btc.rb
168
- - test/test_cex.rb
169
- - test/test_cryptoapis.rb
170
- - test/test_fake.rb
171
- - test/test_firstof.rb
172
- - test/test_json.rb
173
- - test/test_live.rb
174
- - test/test_sibit.rb
175
- homepage: http://github.com/yegor256/sibit
155
+ homepage: https://github.com/yegor256/sibit
176
156
  licenses:
177
157
  - MIT
178
158
  metadata: {}
179
- post_install_message:
180
159
  rdoc_options:
181
160
  - "--charset=UTF-8"
182
161
  require_paths:
@@ -192,8 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
171
  - !ruby/object:Gem::Version
193
172
  version: '0'
194
173
  requirements: []
195
- rubygems_version: 3.1.6
196
- signing_key:
174
+ rubygems_version: 3.6.9
197
175
  specification_version: 4
198
176
  summary: Simple Bitcoin Client
199
177
  test_files: []
data/.0pdd.yml DELETED
@@ -1,9 +0,0 @@
1
- errors:
2
- - yegor256@gmail.com
3
- # alerts:
4
- # github:
5
- # - yegor256
6
-
7
- tags:
8
- - pdd
9
- - bug
data/.gitattributes DELETED
@@ -1,7 +0,0 @@
1
- # Check out all text files in UNIX format, with LF as end of line
2
- # Don't change this file. If you have any ideas about it, please
3
- # submit a separate issue about it and we'll discuss.
4
-
5
- * text=auto eol=lf
6
- *.rb ident
7
- *.xml ident
@@ -1,21 +0,0 @@
1
- ---
2
- name: codecov
3
- on:
4
- push:
5
- branches:
6
- - master
7
- jobs:
8
- codecov:
9
- runs-on: ubuntu-22.04
10
- steps:
11
- - uses: actions/checkout@v4
12
- - uses: ruby/setup-ruby@v1
13
- with:
14
- ruby-version: 2.7
15
- - run: bundle update
16
- - run: bundle exec rake
17
- - uses: codecov/codecov-action@v4.0.0-beta.3
18
- with:
19
- token: ${{ secrets.CODECOV_TOKEN }}
20
- file: coverage/.resultset.json
21
- fail_ci_if_error: true
@@ -1,15 +0,0 @@
1
- ---
2
- name: pdd
3
- "on":
4
- push:
5
- branches:
6
- - master
7
- pull_request:
8
- branches:
9
- - master
10
- jobs:
11
- pdd:
12
- runs-on: ubuntu-22.04
13
- steps:
14
- - uses: actions/checkout@v4
15
- - uses: g4s8/pdd-action@master
@@ -1,24 +0,0 @@
1
- ---
2
- name: rake
3
- on:
4
- push:
5
- branches:
6
- - master
7
- pull_request:
8
- branches:
9
- - master
10
- jobs:
11
- test:
12
- name: test
13
- strategy:
14
- matrix:
15
- os: [ubuntu-20.04]
16
- ruby: [2.7, 3.1]
17
- runs-on: ${{ matrix.os }}
18
- steps:
19
- - uses: actions/checkout@v4
20
- - uses: ruby/setup-ruby@v1
21
- with:
22
- ruby-version: ${{ matrix.ruby }}
23
- - run: bundle update
24
- - run: bundle exec rake
@@ -1,17 +0,0 @@
1
- ---
2
- name: xcop
3
- "on":
4
- push:
5
- branches:
6
- - master
7
- pull_request:
8
- branches:
9
- - master
10
- jobs:
11
- xcop:
12
- runs-on: ubuntu-22.04
13
- steps:
14
- - uses: actions/checkout@v4
15
- - uses: g4s8/xcop-action@master
16
- with:
17
- files: '**/*.xml'
data/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- coverage/
2
- Gemfile.lock
3
- .idea/
4
- *.gem
5
- .bundle/
6
- .DS_Store
7
- rdoc/
8
- tmp/
data/.pdd DELETED
@@ -1,7 +0,0 @@
1
- --source=.
2
- --verbose
3
- --exclude target/**/*
4
- --exclude coverage/**/*
5
- --rule min-words:20
6
- --rule min-estimate:15
7
- --rule max-estimate:90
data/.rubocop.yml DELETED
@@ -1,38 +0,0 @@
1
- AllCops:
2
- NewCops: enable
3
- Exclude:
4
- - 'assets/**/*'
5
- DisplayCopNames: true
6
- TargetRubyVersion: 2.5
7
- SuggestExtensions: false
8
-
9
- Gemspec/RequireMFA:
10
- Enabled: false
11
- Style/ClassAndModuleChildren:
12
- Enabled: false
13
- Layout/LineLength:
14
- Max: 100
15
- Layout/EndOfLine:
16
- EnforcedStyle: lf
17
- Metrics/CyclomaticComplexity:
18
- Max: 20
19
- Metrics/MethodLength:
20
- Enabled: false
21
- Layout/MultilineMethodCallIndentation:
22
- Enabled: false
23
- Metrics/ParameterLists:
24
- Max: 6
25
- Metrics/ClassLength:
26
- Max: 250
27
- Metrics/AbcSize:
28
- Enabled: false
29
- Metrics/BlockLength:
30
- Max: 100
31
- Metrics/PerceivedComplexity:
32
- Max: 20
33
- Style/MultilineTernaryOperator:
34
- Enabled: false
35
- Layout/EmptyLineAfterGuardClause:
36
- Enabled: false
37
- Lint/OrAssignmentToConstant:
38
- Enabled: false
data/.rultor.yml DELETED
@@ -1,21 +0,0 @@
1
- docker:
2
- image: yegor256/rultor-image:1.22.0
3
- assets:
4
- rubygems.yml: yegor256/home#assets/rubygems.yml
5
- install: |
6
- rvm default 2.7.6 && source /usr/local/rvm/scripts/rvm
7
- gem install pdd
8
- pdd -f /dev/null
9
- bundle install --no-color "--gemfile=$(pwd)/Gemfile"
10
- release:
11
- script: |-
12
- bundle exec rake clean test rubocop copyright
13
- sed -i "s/0\.0\.0/${tag}/g" lib/sibit/version.rb
14
- git add lib/sibit/version.rb
15
- git commit -m "version set to ${tag}"
16
- gem build sibit.gemspec
17
- chmod 0600 ../rubygems.yml
18
- gem push *.gem --config-file ../rubygems.yml
19
- merge:
20
- script: |-
21
- bundle exec rake clean test rubocop copyright
data/.simplecov DELETED
@@ -1,40 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright (c) 2019-2023 Yegor Bugayenko
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.
22
-
23
- if Gem.win_platform?
24
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
25
- SimpleCov::Formatter::HTMLFormatter
26
- ]
27
- SimpleCov.start do
28
- add_filter '/test/'
29
- add_filter '/features/'
30
- end
31
- else
32
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
33
- [SimpleCov::Formatter::HTMLFormatter]
34
- )
35
- SimpleCov.start do
36
- add_filter '/test/'
37
- add_filter '/features/'
38
- minimum_coverage 60
39
- end
40
- end