zache 0.13.1 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.0pdd.yml +22 -0
- data/.github/workflows/actionlint.yml +43 -0
- data/.github/workflows/codecov.yml +26 -6
- data/.github/workflows/copyrights.yml +32 -0
- data/.github/workflows/license.yml +59 -0
- data/.github/workflows/markdown-lint.yml +40 -0
- data/.github/workflows/pdd.yml +25 -4
- data/.github/workflows/rake.yml +25 -3
- data/.github/workflows/xcop.yml +23 -2
- data/.github/workflows/yamllint.yml +36 -0
- data/.gitignore +0 -1
- data/.rubocop.yml +23 -0
- data/.rultor.yml +23 -1
- data/Gemfile +8 -8
- data/Gemfile.lock +77 -0
- data/LICENSE.txt +1 -1
- data/README.md +11 -8
- data/Rakefile +1 -1
- data/lib/zache.rb +8 -4
- data/test/test__helper.rb +1 -1
- data/test/test_zache.rb +13 -5
- data/zache.gemspec +2 -2
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 239afad7743bd2f58375201b79c3368ef98ba75621eeacdabf20dd2d5b3f1879
|
4
|
+
data.tar.gz: 348062c765fccb666346e22a068dbfd5dcc1d87952b7fdf635eb840e9bd89f46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b65995f073b8cf06cfea5b0a778df5d0f47d8a09f42075034a07d4f4b84afa350d01f654ca3d00940d928f2a14f1e92c45c26995f66ef605599ea898f22f2b95
|
7
|
+
data.tar.gz: da7d27e255d7920171ed0433c1f81a7a7ce29671f43cdb082f818ac55cf9a57831d5786f6ecef7b93d97562ea8c6deb88ead9a6c7c35a9ad519d03780ba8018b
|
data/.0pdd.yml
CHANGED
@@ -1,3 +1,25 @@
|
|
1
|
+
# (The MIT License)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2018-2024 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.
|
22
|
+
---
|
1
23
|
errors:
|
2
24
|
- yegor256@gmail.com
|
3
25
|
# alerts:
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# (The MIT License)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2018-2024 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.
|
22
|
+
---
|
23
|
+
name: actionlint
|
24
|
+
'on':
|
25
|
+
push:
|
26
|
+
branches:
|
27
|
+
- master
|
28
|
+
pull_request:
|
29
|
+
branches:
|
30
|
+
- master
|
31
|
+
jobs:
|
32
|
+
actionlint:
|
33
|
+
runs-on: ubuntu-22.04
|
34
|
+
steps:
|
35
|
+
- uses: actions/checkout@v4
|
36
|
+
- name: Download actionlint
|
37
|
+
id: get_actionlint
|
38
|
+
# yamllint disable-line rule:line-length
|
39
|
+
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
|
40
|
+
shell: bash
|
41
|
+
- name: Check workflow files
|
42
|
+
run: ${{ steps.get_actionlint.outputs.executable }} -color
|
43
|
+
shell: bash
|
@@ -1,3 +1,24 @@
|
|
1
|
+
# (The MIT License)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2018-2024 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.
|
1
22
|
---
|
2
23
|
name: codecov
|
3
24
|
on:
|
@@ -6,15 +27,14 @@ on:
|
|
6
27
|
- master
|
7
28
|
jobs:
|
8
29
|
codecov:
|
9
|
-
runs-on: ubuntu-
|
30
|
+
runs-on: ubuntu-22.04
|
10
31
|
steps:
|
11
|
-
- uses: actions/checkout@
|
32
|
+
- uses: actions/checkout@v4
|
12
33
|
- uses: actions/setup-ruby@v1
|
13
34
|
with:
|
14
35
|
ruby-version: 3.0
|
15
|
-
- run: bundle
|
36
|
+
- run: bundle install
|
16
37
|
- run: bundle exec rake
|
17
|
-
- uses: codecov/codecov-action@
|
38
|
+
- uses: codecov/codecov-action@v4.0.0-beta.3
|
18
39
|
with:
|
19
|
-
|
20
|
-
fail_ci_if_error: true
|
40
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# (The MIT License)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2018-2024 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.
|
22
|
+
---
|
23
|
+
name: copyrights
|
24
|
+
'on':
|
25
|
+
push:
|
26
|
+
pull_request:
|
27
|
+
jobs:
|
28
|
+
copyrights:
|
29
|
+
runs-on: ubuntu-22.04
|
30
|
+
steps:
|
31
|
+
- uses: actions/checkout@v4
|
32
|
+
- uses: yegor256/copyrights-action@0.0.5
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# (The MIT License)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2018-2024 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.
|
22
|
+
---
|
23
|
+
name: license
|
24
|
+
'on':
|
25
|
+
push:
|
26
|
+
branches:
|
27
|
+
- master
|
28
|
+
pull_request:
|
29
|
+
branches:
|
30
|
+
- master
|
31
|
+
jobs:
|
32
|
+
license:
|
33
|
+
runs-on: ubuntu-22.04
|
34
|
+
steps:
|
35
|
+
- uses: actions/checkout@v4
|
36
|
+
- shell: bash
|
37
|
+
run: |
|
38
|
+
header="Copyright (c) 2018-$(date +%Y) Yegor Bugayenko"
|
39
|
+
failed="false"
|
40
|
+
while IFS= read -r file; do
|
41
|
+
if ! grep -q "${header}" "${file}"; then
|
42
|
+
failed="true"
|
43
|
+
echo "⚠️ Copyright header is not found in: ${file}"
|
44
|
+
else
|
45
|
+
echo "File looks good: ${file}"
|
46
|
+
fi
|
47
|
+
done < <(find . -type f \( \
|
48
|
+
-name "Dockerfile" -o \
|
49
|
+
-name "LICENSE.txt" -o \
|
50
|
+
-name "Makefile" -o \
|
51
|
+
-name "Rakefile" -o \
|
52
|
+
-name "*.sh" -o \
|
53
|
+
-name "*.rb" -o \
|
54
|
+
-name "*.fe" -o \
|
55
|
+
-name "*.yml" \
|
56
|
+
\) -print)
|
57
|
+
if [ "${failed}" = "true" ]; then
|
58
|
+
exit 1
|
59
|
+
fi
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# (The MIT License)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2018-2024 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.
|
22
|
+
---
|
23
|
+
name: markdown-lint
|
24
|
+
'on':
|
25
|
+
push:
|
26
|
+
branches:
|
27
|
+
- master
|
28
|
+
pull_request:
|
29
|
+
branches:
|
30
|
+
- master
|
31
|
+
paths-ignore: ['paper/**', 'sandbox/**']
|
32
|
+
concurrency:
|
33
|
+
group: markdown-lint-${{ github.ref }}
|
34
|
+
cancel-in-progress: true
|
35
|
+
jobs:
|
36
|
+
markdown-lint:
|
37
|
+
runs-on: ubuntu-22.04
|
38
|
+
steps:
|
39
|
+
- uses: actions/checkout@v4
|
40
|
+
- uses: articulate/actions-markdownlint@v1
|
data/.github/workflows/pdd.yml
CHANGED
@@ -1,6 +1,27 @@
|
|
1
|
+
# (The MIT License)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2018-2024 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.
|
1
22
|
---
|
2
23
|
name: pdd
|
3
|
-
|
24
|
+
on:
|
4
25
|
push:
|
5
26
|
branches:
|
6
27
|
- master
|
@@ -9,7 +30,7 @@ name: pdd
|
|
9
30
|
- master
|
10
31
|
jobs:
|
11
32
|
pdd:
|
12
|
-
runs-on: ubuntu-
|
33
|
+
runs-on: ubuntu-22.04
|
13
34
|
steps:
|
14
|
-
- uses: actions/checkout@
|
15
|
-
- uses:
|
35
|
+
- uses: actions/checkout@v4
|
36
|
+
- uses: volodya-lombrozo/pdd-action@master
|
data/.github/workflows/rake.yml
CHANGED
@@ -1,3 +1,24 @@
|
|
1
|
+
# (The MIT License)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2018-2024 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.
|
1
22
|
---
|
2
23
|
name: rake
|
3
24
|
on:
|
@@ -13,12 +34,13 @@ jobs:
|
|
13
34
|
strategy:
|
14
35
|
matrix:
|
15
36
|
os: [ubuntu-20.04, macos-12]
|
16
|
-
ruby: [3.0, 2
|
37
|
+
ruby: [3.0, 3.2]
|
17
38
|
runs-on: ${{ matrix.os }}
|
18
39
|
steps:
|
19
|
-
- uses: actions/checkout@
|
40
|
+
- uses: actions/checkout@v4
|
20
41
|
- uses: ruby/setup-ruby@v1
|
21
42
|
with:
|
22
43
|
ruby-version: ${{ matrix.ruby }}
|
23
|
-
|
44
|
+
bundler-cache: true
|
45
|
+
- run: bundle install
|
24
46
|
- run: bundle exec rake
|
data/.github/workflows/xcop.yml
CHANGED
@@ -1,3 +1,24 @@
|
|
1
|
+
# (The MIT License)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2018-2024 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.
|
1
22
|
---
|
2
23
|
name: xcop
|
3
24
|
"on":
|
@@ -9,9 +30,9 @@ name: xcop
|
|
9
30
|
- master
|
10
31
|
jobs:
|
11
32
|
xcop:
|
12
|
-
runs-on: ubuntu-
|
33
|
+
runs-on: ubuntu-22.04
|
13
34
|
steps:
|
14
|
-
- uses: actions/checkout@
|
35
|
+
- uses: actions/checkout@v4
|
15
36
|
- uses: g4s8/xcop-action@master
|
16
37
|
with:
|
17
38
|
files: '**/*.xml'
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# (The MIT License)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2018-2024 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.
|
22
|
+
---
|
23
|
+
name: yamllint
|
24
|
+
'on':
|
25
|
+
push:
|
26
|
+
branches:
|
27
|
+
- master
|
28
|
+
pull_request:
|
29
|
+
branches:
|
30
|
+
- master
|
31
|
+
jobs:
|
32
|
+
yamllint:
|
33
|
+
runs-on: ubuntu-22.04
|
34
|
+
steps:
|
35
|
+
- uses: actions/checkout@v4
|
36
|
+
- uses: ibiqlik/action-yamllint@v3
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,3 +1,25 @@
|
|
1
|
+
# (The MIT License)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2018-2024 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.
|
22
|
+
---
|
1
23
|
AllCops:
|
2
24
|
DisplayCopNames: true
|
3
25
|
TargetRubyVersion: 2.5
|
@@ -7,6 +29,7 @@ AllCops:
|
|
7
29
|
Metrics/ClassLength:
|
8
30
|
Exclude:
|
9
31
|
- 'test/*.rb'
|
32
|
+
- 'vendor/**/**'
|
10
33
|
Layout/EmptyLineAfterGuardClause:
|
11
34
|
Enabled: false
|
12
35
|
Layout/MultilineMethodCallIndentation:
|
data/.rultor.yml
CHANGED
@@ -1,5 +1,27 @@
|
|
1
|
+
# (The MIT License)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2018-2024 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.
|
22
|
+
---
|
1
23
|
docker:
|
2
|
-
image: yegor256/rultor-image:1.
|
24
|
+
image: yegor256/rultor-image:1.23.1
|
3
25
|
assets:
|
4
26
|
rubygems.yml: yegor256/home#assets/rubygems.yml
|
5
27
|
install: |
|
data/Gemfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018-
|
3
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -23,11 +23,11 @@
|
|
23
23
|
source 'https://rubygems.org'
|
24
24
|
gemspec
|
25
25
|
|
26
|
-
gem 'concurrent-ruby', '1.
|
27
|
-
gem 'minitest', '5.
|
28
|
-
gem 'rake', '13.
|
29
|
-
gem 'rdoc', '6.
|
30
|
-
gem 'rubocop', '1.
|
31
|
-
gem 'rubocop-rspec', '
|
26
|
+
gem 'concurrent-ruby', '1.3.3', require: false
|
27
|
+
gem 'minitest', '5.24.1', require: false
|
28
|
+
gem 'rake', '13.2.1', require: false
|
29
|
+
gem 'rdoc', '6.7.0', require: false
|
30
|
+
gem 'rubocop', '1.65.0', require: false
|
31
|
+
gem 'rubocop-rspec', '3.0.3', require: false
|
32
32
|
gem 'simplecov', '0.22.0', require: false
|
33
|
-
gem 'threads', '0.
|
33
|
+
gem 'threads', '0.4.0', require: false
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
zache (0.0.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
ast (2.4.2)
|
10
|
+
backtrace (0.4.0)
|
11
|
+
concurrent-ruby (1.3.3)
|
12
|
+
docile (1.4.0)
|
13
|
+
json (2.7.2)
|
14
|
+
language_server-protocol (3.17.0.3)
|
15
|
+
minitest (5.24.1)
|
16
|
+
parallel (1.25.1)
|
17
|
+
parser (3.3.4.0)
|
18
|
+
ast (~> 2.4.1)
|
19
|
+
racc
|
20
|
+
psych (5.1.2)
|
21
|
+
stringio
|
22
|
+
racc (1.8.0)
|
23
|
+
rainbow (3.1.1)
|
24
|
+
rake (13.2.1)
|
25
|
+
rdoc (6.7.0)
|
26
|
+
psych (>= 4.0.0)
|
27
|
+
regexp_parser (2.9.2)
|
28
|
+
rexml (3.3.2)
|
29
|
+
strscan
|
30
|
+
rubocop (1.65.0)
|
31
|
+
json (~> 2.3)
|
32
|
+
language_server-protocol (>= 3.17.0)
|
33
|
+
parallel (~> 1.10)
|
34
|
+
parser (>= 3.3.0.2)
|
35
|
+
rainbow (>= 2.2.2, < 4.0)
|
36
|
+
regexp_parser (>= 2.4, < 3.0)
|
37
|
+
rexml (>= 3.2.5, < 4.0)
|
38
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
39
|
+
ruby-progressbar (~> 1.7)
|
40
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
41
|
+
rubocop-ast (1.31.3)
|
42
|
+
parser (>= 3.3.1.0)
|
43
|
+
rubocop-rspec (3.0.3)
|
44
|
+
rubocop (~> 1.61)
|
45
|
+
ruby-progressbar (1.13.0)
|
46
|
+
simplecov (0.22.0)
|
47
|
+
docile (~> 1.1)
|
48
|
+
simplecov-html (~> 0.11)
|
49
|
+
simplecov_json_formatter (~> 0.1)
|
50
|
+
simplecov-html (0.12.3)
|
51
|
+
simplecov_json_formatter (0.1.4)
|
52
|
+
stringio (3.1.1)
|
53
|
+
strscan (3.1.0)
|
54
|
+
threads (0.4.0)
|
55
|
+
backtrace (~> 0)
|
56
|
+
concurrent-ruby (~> 1.0)
|
57
|
+
unicode-display_width (2.5.0)
|
58
|
+
|
59
|
+
PLATFORMS
|
60
|
+
arm64-darwin-22
|
61
|
+
x86_64-darwin-20
|
62
|
+
x86_64-darwin-21
|
63
|
+
x86_64-linux
|
64
|
+
|
65
|
+
DEPENDENCIES
|
66
|
+
concurrent-ruby (= 1.3.3)
|
67
|
+
minitest (= 5.24.1)
|
68
|
+
rake (= 13.2.1)
|
69
|
+
rdoc (= 6.7.0)
|
70
|
+
rubocop (= 1.65.0)
|
71
|
+
rubocop-rspec (= 3.0.3)
|
72
|
+
simplecov (= 0.22.0)
|
73
|
+
threads (= 0.4.0)
|
74
|
+
zache!
|
75
|
+
|
76
|
+
BUNDLED WITH
|
77
|
+
2.5.6
|
data/LICENSE.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2018-
|
3
|
+
Copyright (c) 2018-2024 Yegor Bugayenko
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
# In Memory Cache for Ruby
|
2
2
|
|
3
3
|
[](https://www.elegantobjects.org)
|
4
4
|
[](http://www.rultor.com/p/yegor256/zache)
|
@@ -19,7 +19,7 @@ to understand what Zache is for.
|
|
19
19
|
First, install it:
|
20
20
|
|
21
21
|
```bash
|
22
|
-
|
22
|
+
gem install zache
|
23
23
|
```
|
24
24
|
|
25
25
|
Then, use it like this
|
@@ -46,21 +46,24 @@ while another one calls `get` again. That second thread won't wait, but will
|
|
46
46
|
receive what's left in the cache. This is a very convenient mode for situations
|
47
47
|
when you don't really care about data accuracy, but performance is an issue.
|
48
48
|
|
49
|
-
The entire API is documented
|
49
|
+
The entire API is documented
|
50
|
+
[here](https://www.rubydoc.info/github/yegor256/zache/master/Zache)
|
50
51
|
(there are many other convenient methods).
|
51
52
|
|
52
53
|
That's it.
|
53
54
|
|
54
55
|
## How to contribute
|
55
56
|
|
56
|
-
Read
|
57
|
+
Read
|
58
|
+
[these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
|
57
59
|
Make sure you build is green before you contribute
|
58
|
-
your pull request. You will need to have
|
60
|
+
your pull request. You will need to have
|
61
|
+
[Ruby](https://www.ruby-lang.org/en/) 2.3+ and
|
59
62
|
[Bundler](https://bundler.io/) installed. Then:
|
60
63
|
|
61
|
-
```
|
62
|
-
|
63
|
-
|
64
|
+
```bash
|
65
|
+
bundle update
|
66
|
+
bundle exec rake
|
64
67
|
```
|
65
68
|
|
66
69
|
If it's clean and you don't see any error messages, submit your pull request.
|
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018-
|
3
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/lib/zache.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# (The MIT License)
|
4
4
|
#
|
5
|
-
# Copyright (c) 2018-
|
5
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -34,7 +34,7 @@
|
|
34
34
|
# {README}[https://github.com/yegor256/zache/blob/master/README.md] file.
|
35
35
|
#
|
36
36
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
37
|
-
# Copyright:: Copyright (c) 2018-
|
37
|
+
# Copyright:: Copyright (c) 2018-2024 Yegor Bugayenko
|
38
38
|
# License:: MIT
|
39
39
|
class Zache
|
40
40
|
# Fake implementation that doesn't cache anything, but behaves like it
|
@@ -155,7 +155,7 @@ class Zache
|
|
155
155
|
end
|
156
156
|
end
|
157
157
|
|
158
|
-
# Removes the value from the
|
158
|
+
# Removes the value from the cache, by the provided key. If the key is absent
|
159
159
|
# and the block is provided, the block will be called.
|
160
160
|
def remove(key)
|
161
161
|
synchronized { @hash.delete(key) { yield if block_given? } }
|
@@ -177,7 +177,11 @@ class Zache
|
|
177
177
|
|
178
178
|
# Remove keys that are expired.
|
179
179
|
def clean
|
180
|
-
synchronized { @hash.delete_if { |
|
180
|
+
synchronized { @hash.delete_if { |key, _value| expired?(key) } }
|
181
|
+
end
|
182
|
+
|
183
|
+
def empty?
|
184
|
+
@hash.empty?
|
181
185
|
end
|
182
186
|
|
183
187
|
private
|
data/test/test__helper.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2018-
|
3
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
4
4
|
#
|
5
5
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
# of this software and associated documentation files (the 'Software'), to deal
|
data/test/test_zache.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# (The MIT License)
|
4
4
|
#
|
5
|
-
# Copyright (c) 2018-
|
5
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -32,7 +32,7 @@ Thread.report_on_exception = true
|
|
32
32
|
|
33
33
|
# Cache test.
|
34
34
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
35
|
-
# Copyright:: Copyright (c) 2018-
|
35
|
+
# Copyright:: Copyright (c) 2018-2024 Yegor Bugayenko
|
36
36
|
# License:: MIT
|
37
37
|
class ZacheTest < Minitest::Test
|
38
38
|
def test_caches
|
@@ -134,6 +134,14 @@ class ZacheTest < Minitest::Test
|
|
134
134
|
assert(cache.exists?(:bye) == false)
|
135
135
|
end
|
136
136
|
|
137
|
+
def test_clean_size
|
138
|
+
cache = Zache.new
|
139
|
+
cache.get(:hey, lifetime: 0.01) { Random.rand }
|
140
|
+
sleep 0.1
|
141
|
+
cache.clean
|
142
|
+
assert(cache.empty?)
|
143
|
+
end
|
144
|
+
|
137
145
|
def test_clean_with_sync_false
|
138
146
|
cache = Zache.new(sync: false)
|
139
147
|
cache.get(:hey) { Random.rand }
|
@@ -158,12 +166,12 @@ class ZacheTest < Minitest::Test
|
|
158
166
|
def test_remove_all_with_threads
|
159
167
|
cache = Zache.new
|
160
168
|
Threads.new(10).assert(100) do |i|
|
161
|
-
cache.get("hey#{i}"
|
162
|
-
assert(cache.exists?("hey#{i}"
|
169
|
+
cache.get(:"hey#{i}") { Random.rand }
|
170
|
+
assert(cache.exists?(:"hey#{i}") == true)
|
163
171
|
cache.remove_all
|
164
172
|
end
|
165
173
|
10.times do |i|
|
166
|
-
assert(cache.exists?("hey#{i}"
|
174
|
+
assert(cache.exists?(:"hey#{i}") == false)
|
167
175
|
end
|
168
176
|
end
|
169
177
|
|
data/zache.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# (The MIT License)
|
4
4
|
#
|
5
|
-
# Copyright (c) 2018-
|
5
|
+
# Copyright (c) 2018-2024 Yegor Bugayenko
|
6
6
|
#
|
7
7
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
8
|
# of this software and associated documentation files (the 'Software'), to deal
|
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
|
|
27
27
|
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
28
28
|
s.required_ruby_version = '>=2.5'
|
29
29
|
s.name = 'zache'
|
30
|
-
s.version = '0.13.
|
30
|
+
s.version = '0.13.2'
|
31
31
|
s.license = 'MIT'
|
32
32
|
s.summary = 'In-memory Cache'
|
33
33
|
s.description = 'Zero-footprint in-memory thread-safe cache'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Zero-footprint in-memory thread-safe cache
|
14
14
|
email: yegor256@gmail.com
|
@@ -18,15 +18,21 @@ extra_rdoc_files:
|
|
18
18
|
- README.md
|
19
19
|
files:
|
20
20
|
- ".0pdd.yml"
|
21
|
+
- ".github/workflows/actionlint.yml"
|
21
22
|
- ".github/workflows/codecov.yml"
|
23
|
+
- ".github/workflows/copyrights.yml"
|
24
|
+
- ".github/workflows/license.yml"
|
25
|
+
- ".github/workflows/markdown-lint.yml"
|
22
26
|
- ".github/workflows/pdd.yml"
|
23
27
|
- ".github/workflows/rake.yml"
|
24
28
|
- ".github/workflows/xcop.yml"
|
29
|
+
- ".github/workflows/yamllint.yml"
|
25
30
|
- ".gitignore"
|
26
31
|
- ".pdd"
|
27
32
|
- ".rubocop.yml"
|
28
33
|
- ".rultor.yml"
|
29
34
|
- Gemfile
|
35
|
+
- Gemfile.lock
|
30
36
|
- LICENSE.txt
|
31
37
|
- README.md
|
32
38
|
- Rakefile
|
@@ -57,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
63
|
- !ruby/object:Gem::Version
|
58
64
|
version: '0'
|
59
65
|
requirements: []
|
60
|
-
rubygems_version: 3.
|
66
|
+
rubygems_version: 3.4.10
|
61
67
|
signing_key:
|
62
68
|
specification_version: 4
|
63
69
|
summary: In-memory Cache
|