tacky 0.4.0 → 0.5.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/copyrights.yml +19 -0
- data/.github/workflows/pdd.yml +12 -4
- data/.github/workflows/rake.yml +10 -5
- data/.github/workflows/reuse.yml +19 -0
- data/.github/workflows/xcop.yml +7 -3
- data/.github/workflows/yamllint.yml +19 -0
- data/.gitignore +7 -3
- data/.rubocop.yml +9 -1
- data/.rultor.yml +7 -2
- data/Gemfile +10 -24
- data/Gemfile.lock +82 -0
- data/LICENSE.txt +1 -1
- data/LICENSES/MIT.txt +21 -0
- data/README.md +10 -8
- data/REUSE.toml +35 -0
- data/Rakefile +4 -21
- data/lib/tacky.rb +3 -22
- data/logo.svg +1 -1
- data/tacky.gemspec +8 -26
- data/test/test_tacky.rb +7 -26
- metadata +13 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66e070784bf3eab59a930f0d63a5f910fb33f0bd6642c8d2148ea96adef88c9c
|
4
|
+
data.tar.gz: 94e8f05a030e86e042f839bb3f14c9bd10f193af4187ed83a7c54f4e94ac59c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4ca0db0df2352b30efa323b54ec6145a99cba13a57fa3d84c44d56ab6a949b97a664b100031b102d56bc935129275bccbe3e7c225074d609e7148da0ded2f8a
|
7
|
+
data.tar.gz: acb6474481c989d587516c2fd6a10220f2143e4c5eccd2d5eb3bec9b6442fc5b76e5628a3afa07e4e495feb57776fa0935bd3cdd37e8b618acacc34a4d644326
|
data/.0pdd.yml
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2020-2025 Yegor Bugayenko
|
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,19 @@
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2020-2025 Yegor Bugayenko
|
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.8
|
data/.github/workflows/pdd.yml
CHANGED
@@ -1,11 +1,19 @@
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2020-2025 Yegor Bugayenko
|
2
|
+
# SPDX-License-Identifier: MIT
|
1
3
|
---
|
4
|
+
# yamllint disable rule:line-length
|
2
5
|
name: pdd
|
3
|
-
on:
|
6
|
+
'on':
|
4
7
|
push:
|
8
|
+
branches:
|
9
|
+
- master
|
5
10
|
pull_request:
|
11
|
+
branches:
|
12
|
+
- master
|
6
13
|
jobs:
|
7
14
|
pdd:
|
8
|
-
|
15
|
+
timeout-minutes: 15
|
16
|
+
runs-on: ubuntu-24.04
|
9
17
|
steps:
|
10
|
-
- uses: actions/checkout@
|
11
|
-
- uses:
|
18
|
+
- uses: actions/checkout@v4
|
19
|
+
- uses: volodya-lombrozo/pdd-action@master
|
data/.github/workflows/rake.yml
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2020-2025 Yegor Bugayenko
|
2
|
+
# SPDX-License-Identifier: MIT
|
1
3
|
---
|
4
|
+
# yamllint disable rule:line-length
|
2
5
|
name: rake
|
3
|
-
on:
|
6
|
+
'on':
|
4
7
|
push:
|
5
8
|
branches:
|
6
9
|
- master
|
@@ -11,13 +14,15 @@ jobs:
|
|
11
14
|
test:
|
12
15
|
strategy:
|
13
16
|
matrix:
|
14
|
-
os: [ubuntu-
|
15
|
-
ruby: [
|
17
|
+
os: [ubuntu-24.04]
|
18
|
+
ruby: [3.3]
|
16
19
|
runs-on: ${{ matrix.os }}
|
17
20
|
steps:
|
18
|
-
- uses: actions/checkout@
|
21
|
+
- uses: actions/checkout@v4
|
19
22
|
- uses: ruby/setup-ruby@v1
|
20
23
|
with:
|
21
24
|
ruby-version: ${{ matrix.ruby }}
|
22
|
-
|
25
|
+
bundler-cache: true
|
26
|
+
- run: bundle config set --global path "$(pwd)/vendor/bundle"
|
27
|
+
- run: bundle install --no-color
|
23
28
|
- run: bundle exec rake
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2020-2025 Yegor Bugayenko
|
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
|
data/.github/workflows/xcop.yml
CHANGED
@@ -1,11 +1,15 @@
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2020-2025 Yegor Bugayenko
|
2
|
+
# SPDX-License-Identifier: MIT
|
1
3
|
---
|
4
|
+
# yamllint disable rule:line-length
|
2
5
|
name: xcop
|
3
|
-
on:
|
6
|
+
'on':
|
4
7
|
push:
|
5
8
|
pull_request:
|
6
9
|
jobs:
|
7
10
|
xcop:
|
8
|
-
|
11
|
+
timeout-minutes: 15
|
12
|
+
runs-on: ubuntu-24.04
|
9
13
|
steps:
|
10
|
-
- uses: actions/checkout@
|
14
|
+
- uses: actions/checkout@v4
|
11
15
|
- uses: g4s8/xcop-action@master
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2020-2025 Yegor Bugayenko
|
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,9 +1,17 @@
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2020-2025 Yegor Bugayenko
|
2
|
+
# SPDX-License-Identifier: MIT
|
3
|
+
---
|
1
4
|
AllCops:
|
2
5
|
DisplayCopNames: true
|
3
6
|
TargetRubyVersion: 2.3
|
4
7
|
NewCops: enable
|
5
8
|
SuggestExtensions: false
|
6
|
-
|
9
|
+
plugins:
|
10
|
+
- rubocop-rake
|
11
|
+
- rubocop-minitest
|
12
|
+
- rubocop-performance
|
13
|
+
Minitest/EmptyLineBeforeAssertionMethods:
|
14
|
+
Enabled: false
|
7
15
|
Layout/EndOfLine:
|
8
16
|
EnforcedStyle: lf
|
9
17
|
Lint/MissingSuper:
|
data/.rultor.yml
CHANGED
@@ -1,12 +1,17 @@
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2020-2025 Yegor Bugayenko
|
2
|
+
# SPDX-License-Identifier: MIT
|
3
|
+
---
|
4
|
+
# yamllint disable rule:line-length
|
1
5
|
docker:
|
2
|
-
image: yegor256/
|
6
|
+
image: yegor256/ruby
|
3
7
|
assets:
|
4
8
|
rubygems.yml: yegor256/home#assets/rubygems.yml
|
5
9
|
install: |-
|
6
|
-
sudo gem install
|
10
|
+
sudo gem install pdd
|
7
11
|
pdd -f /dev/null
|
8
12
|
sudo bundle install --no-color "--gemfile=$(pwd)/Gemfile"
|
9
13
|
release:
|
14
|
+
pre: false
|
10
15
|
script: |-
|
11
16
|
bundle exec rake
|
12
17
|
rm -rf *.gem
|
data/Gemfile
CHANGED
@@ -1,30 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2020-
|
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) 2020-2025 Yegor Bugayenko
|
4
|
+
# SPDX-License-Identifier: MIT
|
22
5
|
|
23
6
|
source 'https://rubygems.org'
|
24
7
|
gemspec
|
25
8
|
|
26
|
-
gem 'minitest', '5.
|
27
|
-
gem 'rake', '13.
|
28
|
-
gem 'rdoc', '6.
|
29
|
-
gem 'rubocop', '1.
|
30
|
-
gem 'rubocop-
|
9
|
+
gem 'minitest', '~>5.25', require: false
|
10
|
+
gem 'rake', '~>13.2', require: false
|
11
|
+
gem 'rdoc', '~>6.11', require: false
|
12
|
+
gem 'rubocop', '~>1.71', require: false
|
13
|
+
gem 'rubocop-minitest', '>0', require: false
|
14
|
+
gem 'rubocop-performance', '>0', require: false
|
15
|
+
gem 'rubocop-rake', '>0', require: false
|
16
|
+
gem 'rubocop-rspec', '>0', require: false
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
tacky (0.0.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
ast (2.4.3)
|
10
|
+
date (3.4.1)
|
11
|
+
json (2.10.2)
|
12
|
+
language_server-protocol (3.17.0.4)
|
13
|
+
lint_roller (1.1.0)
|
14
|
+
minitest (5.25.5)
|
15
|
+
parallel (1.26.3)
|
16
|
+
parser (3.3.7.3)
|
17
|
+
ast (~> 2.4.1)
|
18
|
+
racc
|
19
|
+
prism (1.4.0)
|
20
|
+
psych (5.2.3)
|
21
|
+
date
|
22
|
+
stringio
|
23
|
+
racc (1.8.1)
|
24
|
+
rainbow (3.1.1)
|
25
|
+
rake (13.2.1)
|
26
|
+
rdoc (6.13.0)
|
27
|
+
psych (>= 4.0.0)
|
28
|
+
regexp_parser (2.10.0)
|
29
|
+
rubocop (1.75.1)
|
30
|
+
json (~> 2.3)
|
31
|
+
language_server-protocol (~> 3.17.0.2)
|
32
|
+
lint_roller (~> 1.1.0)
|
33
|
+
parallel (~> 1.10)
|
34
|
+
parser (>= 3.3.0.2)
|
35
|
+
rainbow (>= 2.2.2, < 4.0)
|
36
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
37
|
+
rubocop-ast (>= 1.43.0, < 2.0)
|
38
|
+
ruby-progressbar (~> 1.7)
|
39
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
40
|
+
rubocop-ast (1.43.0)
|
41
|
+
parser (>= 3.3.7.2)
|
42
|
+
prism (~> 1.4)
|
43
|
+
rubocop-minitest (0.37.1)
|
44
|
+
lint_roller (~> 1.1)
|
45
|
+
rubocop (>= 1.72.1, < 2.0)
|
46
|
+
rubocop-ast (>= 1.38.0, < 2.0)
|
47
|
+
rubocop-performance (1.24.0)
|
48
|
+
lint_roller (~> 1.1)
|
49
|
+
rubocop (>= 1.72.1, < 2.0)
|
50
|
+
rubocop-ast (>= 1.38.0, < 2.0)
|
51
|
+
rubocop-rake (0.7.1)
|
52
|
+
lint_roller (~> 1.1)
|
53
|
+
rubocop (>= 1.72.1)
|
54
|
+
rubocop-rspec (3.5.0)
|
55
|
+
lint_roller (~> 1.1)
|
56
|
+
rubocop (~> 1.72, >= 1.72.1)
|
57
|
+
ruby-progressbar (1.13.0)
|
58
|
+
stringio (3.1.6)
|
59
|
+
unicode-display_width (3.1.4)
|
60
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
61
|
+
unicode-emoji (4.0.4)
|
62
|
+
|
63
|
+
PLATFORMS
|
64
|
+
arm64-darwin-22
|
65
|
+
arm64-darwin-23
|
66
|
+
arm64-darwin-24
|
67
|
+
x64-mingw-ucrt
|
68
|
+
x86_64-linux
|
69
|
+
|
70
|
+
DEPENDENCIES
|
71
|
+
minitest (~> 5.25)
|
72
|
+
rake (~> 13.2)
|
73
|
+
rdoc (~> 6.11)
|
74
|
+
rubocop (~> 1.71)
|
75
|
+
rubocop-minitest (> 0)
|
76
|
+
rubocop-performance (> 0)
|
77
|
+
rubocop-rake (> 0)
|
78
|
+
rubocop-rspec (> 0)
|
79
|
+
tacky!
|
80
|
+
|
81
|
+
BUNDLED WITH
|
82
|
+
2.5.16
|
data/LICENSE.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2020-
|
3
|
+
Copyright (c) 2020-2025 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/LICENSES/MIT.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020-2025 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
|
13
|
+
in all 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 NON-INFRINGEMENT. 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,13 +1,13 @@
|
|
1
|
-
|
1
|
+
# Caching Decorator for Ruby Objects
|
2
2
|
|
3
3
|
[](https://www.elegantobjects.org)
|
4
|
-
[](https://www.rultor.com/p/yegor256/tacky)
|
5
5
|
[](https://www.jetbrains.com/ruby/)
|
6
6
|
|
7
7
|
[](https://github.com/yegor256/tacky/actions/workflows/rake.yml)
|
8
|
-
[](
|
8
|
+
[](https://badge.fury.io/rb/tacky)
|
9
9
|
[](https://codeclimate.com/github/yegor256/tacky/maintainability)
|
10
|
-
[](https://rubydoc.info/github/yegor256/tacky/master/frames)
|
11
11
|
[](https://hitsofcode.com/view/github/yegor256/tacky)
|
12
12
|
[](https://github.com/yegor256/tacky/blob/master/LICENSE.txt)
|
13
13
|
|
@@ -21,7 +21,7 @@ Then, use it like this:
|
|
21
21
|
|
22
22
|
```ruby
|
23
23
|
require 'tacky'
|
24
|
-
|
24
|
+
tackified = Tacky.new(obj)
|
25
25
|
```
|
26
26
|
|
27
27
|
That's it, all method calls will be cached. This means that only the first
|
@@ -41,9 +41,11 @@ Keep in mind that `Tacky` is thread-safe.
|
|
41
41
|
|
42
42
|
## How to contribute
|
43
43
|
|
44
|
-
Read
|
45
|
-
|
46
|
-
|
44
|
+
Read
|
45
|
+
[these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
|
46
|
+
Make sure your build is green before you contribute
|
47
|
+
your pull request. You will need to have
|
48
|
+
[Ruby](https://www.ruby-lang.org/en/) 2.3+ and
|
47
49
|
[Bundler](https://bundler.io/) installed. Then:
|
48
50
|
|
49
51
|
```
|
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
|
+
"**.json",
|
8
|
+
"**.md",
|
9
|
+
"**.svg",
|
10
|
+
"**.txt",
|
11
|
+
"**/*.csv",
|
12
|
+
"**/*.jpg",
|
13
|
+
"**/*.json",
|
14
|
+
"**/*.md",
|
15
|
+
"**/*.pdf",
|
16
|
+
"**/*.png",
|
17
|
+
"**/*.svg",
|
18
|
+
"**/*.txt",
|
19
|
+
"**/*.vm",
|
20
|
+
"**/.DS_Store",
|
21
|
+
"**/.gitignore",
|
22
|
+
"**/.pdd",
|
23
|
+
"**/CNAME",
|
24
|
+
"**/Gemfile.lock",
|
25
|
+
".DS_Store",
|
26
|
+
".gitattributes",
|
27
|
+
".gitignore",
|
28
|
+
".pdd",
|
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,30 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (c) 2020-
|
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) 2020-2025 Yegor Bugayenko
|
4
|
+
# SPDX-License-Identifier: MIT
|
22
5
|
|
23
6
|
require 'rubygems'
|
24
7
|
require 'rake'
|
25
8
|
require 'rake/clean'
|
26
9
|
|
27
|
-
CLEAN
|
10
|
+
CLEAN.include('coverage')
|
28
11
|
|
29
12
|
def name
|
30
13
|
@name ||= File.basename(Dir['*.gemspec'].first, '.*')
|
@@ -55,5 +38,5 @@ require 'rubocop/rake_task'
|
|
55
38
|
desc 'Run RuboCop on all directories'
|
56
39
|
RuboCop::RakeTask.new(:rubocop) do |task|
|
57
40
|
task.fail_on_error = true
|
58
|
-
task.
|
41
|
+
task.options = ['--plugin', 'rubocop-rspec']
|
59
42
|
end
|
data/lib/tacky.rb
CHANGED
@@ -1,26 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# (
|
4
|
-
#
|
5
|
-
# Copyright (c) 2020-2023 Yegor Bugayenko
|
6
|
-
#
|
7
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
9
|
-
# in the Software without restriction, including without limitation the rights
|
10
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
-
# copies of the Software, and to permit persons to whom the Software is
|
12
|
-
# furnished to do so, subject to the following conditions:
|
13
|
-
#
|
14
|
-
# The above copyright notice and this permission notice shall be included in all
|
15
|
-
# copies or substantial portions of the Software.
|
16
|
-
#
|
17
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
23
|
-
# SOFTWARE.
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2020-2025 Yegor Bugayenko
|
4
|
+
# SPDX-License-Identifier: MIT
|
24
5
|
|
25
6
|
# Tacky is a simple decorator of an existing object that makes all of
|
26
7
|
# its methods cache all values and calculate them only once.
|
@@ -29,7 +10,7 @@
|
|
29
10
|
# {README}[https://github.com/yegor256/tacky/blob/master/README.md] file.
|
30
11
|
#
|
31
12
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
32
|
-
# Copyright:: Copyright (c) 2020-
|
13
|
+
# Copyright:: Copyright (c) 2020-2025 Yegor Bugayenko
|
33
14
|
# License:: MIT
|
34
15
|
class Tacky
|
35
16
|
undef_method :send
|
data/logo.svg
CHANGED
data/tacky.gemspec
CHANGED
@@ -1,40 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# (
|
4
|
-
#
|
5
|
-
# Copyright (c) 2020-2023 Yegor Bugayenko
|
6
|
-
#
|
7
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
9
|
-
# in the Software without restriction, including without limitation the rights
|
10
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
-
# copies of the Software, and to permit persons to whom the Software is
|
12
|
-
# furnished to do so, subject to the following conditions:
|
13
|
-
#
|
14
|
-
# The above copyright notice and this permission notice shall be included in all
|
15
|
-
# copies or substantial portions of the Software.
|
16
|
-
#
|
17
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
23
|
-
# SOFTWARE.
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2020-2025 Yegor Bugayenko
|
4
|
+
# SPDX-License-Identifier: MIT
|
24
5
|
|
25
6
|
require 'English'
|
26
7
|
Gem::Specification.new do |s|
|
27
8
|
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
|
28
|
-
s.required_ruby_version = '>=2.3'
|
9
|
+
s.required_ruby_version = '>= 2.3'
|
29
10
|
s.name = 'tacky'
|
30
|
-
s.version = '0.
|
11
|
+
s.version = '0.5.0'
|
31
12
|
s.license = 'MIT'
|
32
13
|
s.summary = 'Primitive Object Memoization for Ruby'
|
33
|
-
s.description =
|
34
|
-
|
14
|
+
s.description =
|
15
|
+
'Decorate your existing Ruby object with Tacky ' \
|
16
|
+
'and all its methods will be cached.'
|
35
17
|
s.authors = ['Yegor Bugayenko']
|
36
18
|
s.email = 'yegor256@gmail.com'
|
37
|
-
s.homepage = '
|
19
|
+
s.homepage = 'https://github.com/yegor256/tacky'
|
38
20
|
s.files = `git ls-files`.split($RS)
|
39
21
|
s.rdoc_options = ['--charset=UTF-8']
|
40
22
|
s.extra_rdoc_files = ['README.md']
|
data/test/test_tacky.rb
CHANGED
@@ -1,33 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# (
|
4
|
-
#
|
5
|
-
# Copyright (c) 2020-2023 Yegor Bugayenko
|
6
|
-
#
|
7
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
9
|
-
# in the Software without restriction, including without limitation the rights
|
10
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
-
# copies of the Software, and to permit persons to whom the Software is
|
12
|
-
# furnished to do so, subject to the following conditions:
|
13
|
-
#
|
14
|
-
# The above copyright notice and this permission notice shall be included in all
|
15
|
-
# copies or substantial portions of the Software.
|
16
|
-
#
|
17
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
23
|
-
# SOFTWARE.
|
3
|
+
# SPDX-FileCopyrightText: Copyright (c) 2020-2025 Yegor Bugayenko
|
4
|
+
# SPDX-License-Identifier: MIT
|
24
5
|
|
25
6
|
require 'minitest/autorun'
|
26
7
|
require_relative '../lib/tacky'
|
27
8
|
|
28
9
|
# Tacky test.
|
29
10
|
# Author:: Yegor Bugayenko (yegor256@gmail.com)
|
30
|
-
# Copyright:: Copyright (c) 2020-
|
11
|
+
# Copyright:: Copyright (c) 2020-2025 Yegor Bugayenko
|
31
12
|
# License:: MIT
|
32
13
|
class TackyTest < Minitest::Test
|
33
14
|
def test_wraps_simple_object
|
@@ -37,7 +18,7 @@ class TackyTest < Minitest::Test
|
|
37
18
|
end
|
38
19
|
bar = Tacky.new(foo)
|
39
20
|
first = bar.value
|
40
|
-
|
21
|
+
assert_equal(bar.value, first)
|
41
22
|
end
|
42
23
|
|
43
24
|
def test_deep_caching
|
@@ -51,8 +32,8 @@ class TackyTest < Minitest::Test
|
|
51
32
|
end
|
52
33
|
bar = Tacky.new(foo, deep: true)
|
53
34
|
first = bar.child.value
|
54
|
-
|
55
|
-
|
35
|
+
assert_kind_of(Numeric, first)
|
36
|
+
assert_equal(bar.child.value, first)
|
56
37
|
end
|
57
38
|
|
58
39
|
def test_stops_on_string
|
@@ -61,7 +42,7 @@ class TackyTest < Minitest::Test
|
|
61
42
|
'hello'
|
62
43
|
end
|
63
44
|
bar = Tacky.new(foo)
|
64
|
-
|
45
|
+
assert_kind_of(String, bar.value)
|
65
46
|
end
|
66
47
|
|
67
48
|
def test_wraps_void_returning_methods
|
metadata
CHANGED
@@ -1,18 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tacky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-03-27 00:00:00.000000000 Z
|
12
11
|
dependencies: []
|
13
|
-
description:
|
14
|
-
|
15
|
-
and all its methods will be cached.
|
12
|
+
description: Decorate your existing Ruby object with Tacky and all its methods will
|
13
|
+
be cached.
|
16
14
|
email: yegor256@gmail.com
|
17
15
|
executables: []
|
18
16
|
extensions: []
|
@@ -20,28 +18,34 @@ extra_rdoc_files:
|
|
20
18
|
- README.md
|
21
19
|
files:
|
22
20
|
- ".0pdd.yml"
|
21
|
+
- ".github/workflows/actionlint.yml"
|
22
|
+
- ".github/workflows/copyrights.yml"
|
23
23
|
- ".github/workflows/pdd.yml"
|
24
24
|
- ".github/workflows/rake.yml"
|
25
|
+
- ".github/workflows/reuse.yml"
|
25
26
|
- ".github/workflows/xcop.yml"
|
27
|
+
- ".github/workflows/yamllint.yml"
|
26
28
|
- ".gitignore"
|
27
29
|
- ".pdd"
|
28
30
|
- ".rubocop.yml"
|
29
31
|
- ".rultor.yml"
|
30
32
|
- Gemfile
|
33
|
+
- Gemfile.lock
|
31
34
|
- LICENSE.txt
|
35
|
+
- LICENSES/MIT.txt
|
32
36
|
- README.md
|
37
|
+
- REUSE.toml
|
33
38
|
- Rakefile
|
34
39
|
- lib/tacky.rb
|
35
40
|
- logo.svg
|
36
41
|
- renovate.json
|
37
42
|
- tacky.gemspec
|
38
43
|
- test/test_tacky.rb
|
39
|
-
homepage:
|
44
|
+
homepage: https://github.com/yegor256/tacky
|
40
45
|
licenses:
|
41
46
|
- MIT
|
42
47
|
metadata:
|
43
48
|
rubygems_mfa_required: 'true'
|
44
|
-
post_install_message:
|
45
49
|
rdoc_options:
|
46
50
|
- "--charset=UTF-8"
|
47
51
|
require_paths:
|
@@ -57,8 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
61
|
- !ruby/object:Gem::Version
|
58
62
|
version: '0'
|
59
63
|
requirements: []
|
60
|
-
rubygems_version: 3.2
|
61
|
-
signing_key:
|
64
|
+
rubygems_version: 3.6.2
|
62
65
|
specification_version: 4
|
63
66
|
summary: Primitive Object Memoization for Ruby
|
64
67
|
test_files: []
|