zold-score 0.4.6 → 0.6.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/.0pdd.yml +3 -0
- data/.github/workflows/actionlint.yml +25 -0
- data/.github/workflows/codecov.yml +27 -0
- data/.github/workflows/copyrights.yml +19 -0
- data/.github/workflows/markdown-lint.yml +19 -0
- data/.github/workflows/pdd.yml +19 -0
- data/.github/workflows/rake.yml +28 -0
- data/.github/workflows/reuse.yml +19 -0
- data/.github/workflows/typos.yml +19 -0
- data/.github/workflows/xcop.yml +15 -0
- data/.github/workflows/yamllint.yml +19 -0
- data/.gitignore +9 -4
- data/.rubocop.yml +12 -2
- data/.rultor.yml +11 -12
- data/.simplecov +16 -37
- data/Gemfile +17 -20
- data/LICENSE.txt +1 -1
- data/LICENSES/MIT.txt +21 -0
- data/README.md +28 -24
- data/REUSE.toml +35 -0
- data/Rakefile +3 -29
- data/ext/score_suffix/ScoreSuffix.cpp +14 -27
- data/ext/score_suffix/extconf.rb +10 -22
- data/lib/zold/score.rb +28 -59
- data/renovate.json +6 -0
- data/test/test__helper.rb +33 -0
- data/test/zold/test_score.rb +17 -34
- data/zold-score.gemspec +7 -35
- metadata +29 -118
- data/.travis.yml +0 -20
- data/appveyor.yml +0 -39
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dac51b7d65ae8e4850d4fa7377b165f0cc74b1754e07165b1999bbadc6d2c4a5
|
|
4
|
+
data.tar.gz: 2fbf8f49a88f0eec7e91f9bc383eb9d9a4c4e3c184ec3247e8e0860ed78800b2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d7419912f9df6476e4c0322449bc32051e8613e5b012941f183f5011c498258f6e634df781ae145e560afbddd9315a9edda5741b84efaa31075c02a70a2d514f
|
|
7
|
+
data.tar.gz: f34c9b86ee7880218632513984815a678db68229313b3dc45ffd9866ffb3222641a1fd4836bd30cd6dd94da0497acb793a248cdfd901e931ea4745e4b782beb7
|
data/.0pdd.yml
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-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@v4
|
|
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
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-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@v4
|
|
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 }}
|
|
26
|
+
files: coverage/.resultset.json
|
|
27
|
+
fail_ci_if_error: true
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-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@v4
|
|
19
|
+
- uses: yegor256/copyrights-action@0.0.12
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-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
|
+
jobs:
|
|
14
|
+
markdown-lint:
|
|
15
|
+
timeout-minutes: 15
|
|
16
|
+
runs-on: ubuntu-24.04
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
- uses: DavidAnson/markdownlint-cli2-action@v22.0.0
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
---
|
|
4
|
+
# yamllint disable rule:line-length
|
|
5
|
+
name: pdd
|
|
6
|
+
'on':
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- master
|
|
10
|
+
pull_request:
|
|
11
|
+
branches:
|
|
12
|
+
- master
|
|
13
|
+
jobs:
|
|
14
|
+
pdd:
|
|
15
|
+
timeout-minutes: 15
|
|
16
|
+
runs-on: ubuntu-24.04
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
- uses: volodya-lombrozo/pdd-action@master
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
---
|
|
4
|
+
# yamllint disable rule:line-length
|
|
5
|
+
name: rake
|
|
6
|
+
'on':
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- master
|
|
10
|
+
pull_request:
|
|
11
|
+
branches:
|
|
12
|
+
- master
|
|
13
|
+
jobs:
|
|
14
|
+
test:
|
|
15
|
+
strategy:
|
|
16
|
+
matrix:
|
|
17
|
+
os: [ubuntu-24.04]
|
|
18
|
+
ruby: [3.3]
|
|
19
|
+
runs-on: ${{ matrix.os }}
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
- uses: ruby/setup-ruby@v1
|
|
23
|
+
with:
|
|
24
|
+
ruby-version: ${{ matrix.ruby }}
|
|
25
|
+
bundler-cache: true
|
|
26
|
+
- run: bundle config set --global path "$(pwd)/vendor/bundle"
|
|
27
|
+
- run: bundle install --no-color
|
|
28
|
+
- run: bundle exec rake
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
---
|
|
4
|
+
# yamllint disable rule:line-length
|
|
5
|
+
name: reuse
|
|
6
|
+
'on':
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- master
|
|
10
|
+
pull_request:
|
|
11
|
+
branches:
|
|
12
|
+
- master
|
|
13
|
+
jobs:
|
|
14
|
+
reuse:
|
|
15
|
+
timeout-minutes: 15
|
|
16
|
+
runs-on: ubuntu-24.04
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
- uses: fsfe/reuse-action@v5
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
---
|
|
4
|
+
# yamllint disable rule:line-length
|
|
5
|
+
name: typos
|
|
6
|
+
'on':
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- master
|
|
10
|
+
pull_request:
|
|
11
|
+
branches:
|
|
12
|
+
- master
|
|
13
|
+
jobs:
|
|
14
|
+
typos:
|
|
15
|
+
timeout-minutes: 15
|
|
16
|
+
runs-on: ubuntu-24.04
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
- uses: crate-ci/typos@v1.40.0
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
---
|
|
4
|
+
# yamllint disable rule:line-length
|
|
5
|
+
name: xcop
|
|
6
|
+
'on':
|
|
7
|
+
push:
|
|
8
|
+
pull_request:
|
|
9
|
+
jobs:
|
|
10
|
+
xcop:
|
|
11
|
+
timeout-minutes: 15
|
|
12
|
+
runs-on: ubuntu-24.04
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: g4s8/xcop-action@master
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
---
|
|
4
|
+
# yamllint disable rule:line-length
|
|
5
|
+
name: yamllint
|
|
6
|
+
'on':
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- master
|
|
10
|
+
pull_request:
|
|
11
|
+
branches:
|
|
12
|
+
- master
|
|
13
|
+
jobs:
|
|
14
|
+
yamllint:
|
|
15
|
+
timeout-minutes: 15
|
|
16
|
+
runs-on: ubuntu-24.04
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
- uses: ibiqlik/action-yamllint@v3
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
---
|
|
1
4
|
AllCops:
|
|
2
5
|
DisplayCopNames: true
|
|
3
6
|
TargetRubyVersion: 2.5
|
|
4
|
-
|
|
7
|
+
SuggestExtensions: false
|
|
8
|
+
NewCops: enable
|
|
9
|
+
plugins:
|
|
10
|
+
- rubocop-rake
|
|
11
|
+
- rubocop-minitest
|
|
12
|
+
- rubocop-performance
|
|
5
13
|
Layout/EmptyLineAfterGuardClause:
|
|
6
14
|
Enabled: false
|
|
7
15
|
Layout/EndOfLine:
|
|
@@ -16,9 +24,11 @@ Metrics/ClassLength:
|
|
|
16
24
|
Max: 180
|
|
17
25
|
Metrics/ParameterLists:
|
|
18
26
|
Max: 7
|
|
19
|
-
Layout/
|
|
27
|
+
Layout/ParameterAlignment:
|
|
20
28
|
Enabled: false
|
|
21
29
|
Metrics/CyclomaticComplexity:
|
|
22
30
|
Max: 20
|
|
23
31
|
Metrics/PerceivedComplexity:
|
|
24
32
|
Max: 20
|
|
33
|
+
Minitest/EmptyLineBeforeAssertionMethods:
|
|
34
|
+
Enabled: false
|
data/.rultor.yml
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
---
|
|
4
|
+
# yamllint disable rule:line-length
|
|
5
|
+
docker:
|
|
6
|
+
image: yegor256/ruby
|
|
1
7
|
assets:
|
|
2
8
|
rubygems.yml: zerocracy/home#assets/rubygems.yml
|
|
3
9
|
install: |-
|
|
4
|
-
|
|
5
|
-
|
|
10
|
+
pdd -f /dev/null
|
|
11
|
+
sudo bundle install --no-color "--gemfile=$(pwd)/Gemfile"
|
|
6
12
|
release:
|
|
13
|
+
pre: false
|
|
7
14
|
script: |-
|
|
8
|
-
bundle
|
|
9
|
-
rake
|
|
15
|
+
bundle exec rake
|
|
10
16
|
rm -rf *.gem
|
|
11
17
|
sed -i "s/0\.0\.0/${tag}/g" zold-score.gemspec
|
|
12
18
|
git add zold-score.gemspec
|
|
@@ -14,13 +20,6 @@ release:
|
|
|
14
20
|
gem build zold-score.gemspec
|
|
15
21
|
chmod 0600 ../rubygems.yml
|
|
16
22
|
gem push *.gem --config-file ../rubygems.yml
|
|
17
|
-
commanders:
|
|
18
|
-
- yegor256
|
|
19
|
-
architect:
|
|
20
|
-
- yegor256
|
|
21
23
|
merge:
|
|
22
|
-
commanders: []
|
|
23
24
|
script: |-
|
|
24
|
-
bundle
|
|
25
|
-
rake
|
|
26
|
-
deploy: {}
|
|
25
|
+
bundle exec rake
|
data/.simplecov
CHANGED
|
@@ -1,40 +1,19 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# Copyright (c) 2018-2019 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.
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
14
3
|
#
|
|
15
|
-
#
|
|
16
|
-
#
|
|
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.
|
|
4
|
+
# SPDX-FileCopyrightText: Copyright (c) 2018-2025 Zerocracy
|
|
5
|
+
# SPDX-License-Identifier: MIT
|
|
22
6
|
|
|
23
|
-
if Gem.win_platform?
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
SimpleCov.start do
|
|
36
|
-
add_filter "/test/"
|
|
37
|
-
add_filter "/features/"
|
|
38
|
-
# minimum_coverage 30
|
|
39
|
-
end
|
|
7
|
+
SimpleCov.formatter = if Gem.win_platform?
|
|
8
|
+
SimpleCov::Formatter::MultiFormatter[
|
|
9
|
+
SimpleCov::Formatter::HTMLFormatter
|
|
10
|
+
]
|
|
11
|
+
else
|
|
12
|
+
SimpleCov::Formatter::MultiFormatter.new(
|
|
13
|
+
[SimpleCov::Formatter::HTMLFormatter]
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
SimpleCov.start do
|
|
17
|
+
add_filter '/test/'
|
|
18
|
+
add_filter '/features/'
|
|
40
19
|
end
|
data/Gemfile
CHANGED
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2018-
|
|
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) 2018-2025 Zerocracy
|
|
4
|
+
# SPDX-License-Identifier: MIT
|
|
22
5
|
|
|
23
6
|
source 'https://rubygems.org'
|
|
24
|
-
ruby '2.6.0'
|
|
25
7
|
gemspec
|
|
8
|
+
|
|
9
|
+
gem 'minitest', '~>6.0', require: false
|
|
10
|
+
gem 'minitest-hooks', '~>1.5', require: false
|
|
11
|
+
gem 'minitest-reporters', '~>1.7', require: false
|
|
12
|
+
gem 'rake-compiler', '~>1.2', require: false
|
|
13
|
+
gem 'rdoc', '7.0.2', require: false
|
|
14
|
+
gem 'rspec-rails', '~>6.0', require: false
|
|
15
|
+
gem 'rubocop', '~>1.53', require: false
|
|
16
|
+
gem 'rubocop-minitest', '>0', require: false
|
|
17
|
+
gem 'rubocop-performance', '>0', require: false
|
|
18
|
+
gem 'rubocop-rake', '>0', require: false
|
|
19
|
+
gem 'rubocop-rspec', '~>2.22', require: false
|
|
20
|
+
gem 'simplecov', '~>0.22', require: false
|
|
21
|
+
gem 'simplecov-cobertura', '~>3.0', require: false
|
|
22
|
+
gem 'webmock', '~>3.23', require: false
|
data/LICENSE.txt
CHANGED
data/LICENSES/MIT.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018-2025 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 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.
|
data/README.md
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
# Zold Score Calculator, in Ruby and C++
|
|
2
2
|
|
|
3
|
-
[](https://www.elegantobjects.org)
|
|
4
|
+
[](https://www.rultor.com/p/yegor256/zold)
|
|
5
|
+
[](https://www.jetbrains.com/ruby/)
|
|
4
6
|
|
|
5
|
-
[](https://www.jetbrains.com/ruby/)
|
|
9
|
-
|
|
10
|
-
[](https://travis-ci.org/zold-io/zold-score)
|
|
11
|
-
[](https://ci.appveyor.com/project/yegor256/zold-score)
|
|
12
|
-
[](http://www.0pdd.com/p?name=zold-io/zold-score)
|
|
13
|
-
[](http://badge.fury.io/rb/zold-score)
|
|
7
|
+
[](https://github.com/zold-io/zold-score/actions/workflows/rake.yml)
|
|
8
|
+
[](https://www.0pdd.com/p?name=zold-io/zold-score)
|
|
9
|
+
[](https://badge.fury.io/rb/zold-score)
|
|
14
10
|
[](https://codecov.io/github/zold-io/zold-score?branch=master)
|
|
11
|
+
[](https://github.com/yegor256/takes/blob/master/LICENSE.txt)
|
|
12
|
+
[](https://hitsofcode.com/view/github/zold-io/zold-score)
|
|
15
13
|
|
|
16
14
|
Here is the [White Paper](https://papers.zold.io/wp.pdf).
|
|
17
15
|
|
|
18
16
|
Join our [Telegram group](https://t.me/zold_io) to discuss it all live.
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
This small Ruby Gem calculates the score for Zold nodes. The idea of the
|
|
19
|
+
"score" is explained in the [White Paper](https://papers.zold.io/wp.pdf).
|
|
20
|
+
To get a better understanding of it you may want to read
|
|
21
|
+
[our blog](https://blog.zold.io).
|
|
23
22
|
|
|
24
23
|
To calculate a new Score you create an object first:
|
|
25
24
|
|
|
@@ -32,7 +31,8 @@ score = Zold::Score.new(
|
|
|
32
31
|
)
|
|
33
32
|
```
|
|
34
33
|
|
|
35
|
-
This score has zero value and the strength of six.
|
|
34
|
+
This score has zero value and the strength of six.
|
|
35
|
+
Then you just ask it to calculate the next score:
|
|
36
36
|
|
|
37
37
|
```ruby
|
|
38
38
|
n = score.next
|
|
@@ -40,18 +40,22 @@ n = score.next
|
|
|
40
40
|
|
|
41
41
|
That's it.
|
|
42
42
|
|
|
43
|
-
This project is actively used in our
|
|
43
|
+
This project is actively used in our
|
|
44
|
+
[main Ruby repo](https://github.com/zold-io/zold).
|
|
44
45
|
|
|
45
|
-
|
|
46
|
+
## How to contribute
|
|
46
47
|
|
|
47
|
-
Read
|
|
48
|
-
Make sure
|
|
49
|
-
|
|
50
|
-
[Bundler](https://bundler.io/) installed.
|
|
48
|
+
Read these [guidelines].
|
|
49
|
+
Make sure your build is green before you contribute your pull request.
|
|
50
|
+
You will need to have [Ruby](https://www.ruby-lang.org/en/) 2.3+ and
|
|
51
|
+
[Bundler](https://bundler.io/) installed.
|
|
52
|
+
Then:
|
|
51
53
|
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
```bash
|
|
55
|
+
bundle update
|
|
56
|
+
bundle exec rake
|
|
55
57
|
```
|
|
56
58
|
|
|
57
59
|
If it's clean and you don't see any error messages, submit your pull request.
|
|
60
|
+
|
|
61
|
+
[guidelines]: https://www.yegor256.com/2014/04/15/github-guidelines.html
|
data/REUSE.toml
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2025 Yegor Bugayenko
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
version = 1
|
|
5
|
+
[[annotations]]
|
|
6
|
+
path = [
|
|
7
|
+
".DS_Store",
|
|
8
|
+
".gitattributes",
|
|
9
|
+
".gitignore",
|
|
10
|
+
".pdd",
|
|
11
|
+
"**.json",
|
|
12
|
+
"**.md",
|
|
13
|
+
"**.png",
|
|
14
|
+
"**.txt",
|
|
15
|
+
"**/.DS_Store",
|
|
16
|
+
"**/.gitignore",
|
|
17
|
+
"**/.pdd",
|
|
18
|
+
"**/*.csv",
|
|
19
|
+
"**/*.jpg",
|
|
20
|
+
"**/*.json",
|
|
21
|
+
"**/*.md",
|
|
22
|
+
"**/*.pdf",
|
|
23
|
+
"**/*.png",
|
|
24
|
+
"**/*.svg",
|
|
25
|
+
"**/*.txt",
|
|
26
|
+
"**/*.vm",
|
|
27
|
+
"**/CNAME",
|
|
28
|
+
"**/Gemfile.lock",
|
|
29
|
+
"Gemfile.lock",
|
|
30
|
+
"README.md",
|
|
31
|
+
"renovate.json",
|
|
32
|
+
]
|
|
33
|
+
precedence = "override"
|
|
34
|
+
SPDX-FileCopyrightText = "Copyright (c) 2025 Yegor Bugayenko"
|
|
35
|
+
SPDX-License-Identifier = "MIT"
|
data/Rakefile
CHANGED
|
@@ -1,24 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2018-
|
|
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) 2018-2025 Zerocracy
|
|
4
|
+
# SPDX-License-Identifier: MIT
|
|
22
5
|
|
|
23
6
|
require 'rubygems'
|
|
24
7
|
require 'rake'
|
|
@@ -33,7 +16,7 @@ def version
|
|
|
33
16
|
Gem::Specification.load(Dir['*.gemspec'].first).version
|
|
34
17
|
end
|
|
35
18
|
|
|
36
|
-
task default: %i[clean compile test rubocop
|
|
19
|
+
task default: %i[clean compile test rubocop]
|
|
37
20
|
|
|
38
21
|
require 'rake/extensiontask'
|
|
39
22
|
Rake::ExtensionTask.new 'score_suffix' do |ext|
|
|
@@ -64,13 +47,4 @@ require 'rubocop/rake_task'
|
|
|
64
47
|
desc 'Run RuboCop on all directories'
|
|
65
48
|
RuboCop::RakeTask.new(:rubocop) do |task|
|
|
66
49
|
task.fail_on_error = true
|
|
67
|
-
task.requires << 'rubocop-rspec'
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
task :copyright do
|
|
71
|
-
sh "grep -q -r '2018-#{Date.today.strftime('%Y')}' \
|
|
72
|
-
--include '*.rb' \
|
|
73
|
-
--include '*.txt' \
|
|
74
|
-
--include 'Rakefile' \
|
|
75
|
-
."
|
|
76
50
|
end
|