memoized 1.1.1 → 1.1.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/.github/workflows/test.yml +4 -2
- data/.ruby-version +1 -1
- data/CHANGELOG.md +8 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +20 -20
- data/README.md +20 -9
- data/bin/matrix +65 -0
- data/lib/memoized/version.rb +1 -1
- data/memoized.gemspec +0 -6
- metadata +7 -79
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 926d7d513652375d0d0978b5eaff47a4ffacdd0a5f545ea6d3defc9c4a998fef
|
|
4
|
+
data.tar.gz: bccf0beaf3128e6ef3a4ac81b0cbebfe0622ebb0371fffe23e5eac92c39a3e05
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 718c91571de072ec727b30994ea61731a53b9ddaa7bc28cc2ca3cdb44bf7f7de7a1c7421953e859f6a785587831fda4575292e7c87f26cec9fcf3361d8b180e8
|
|
7
|
+
data.tar.gz: e9fa3a012d0ccf3a4df5d65e93198bea4f09de92873a3389c8573bda46779ee2cd78cd6b3410c6a424cd552b7f1eb1575aff0d9323caba1f435b3fbc6b923348
|
data/.github/workflows/test.yml
CHANGED
|
@@ -20,7 +20,9 @@ jobs:
|
|
|
20
20
|
gemfile: Gemfile
|
|
21
21
|
- ruby: 2.7.3
|
|
22
22
|
gemfile: Gemfile
|
|
23
|
-
- ruby: 3.0
|
|
23
|
+
- ruby: 3.2.0
|
|
24
|
+
gemfile: Gemfile
|
|
25
|
+
- ruby: 3.4.1
|
|
24
26
|
gemfile: Gemfile
|
|
25
27
|
env:
|
|
26
28
|
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
|
|
@@ -32,7 +34,7 @@ jobs:
|
|
|
32
34
|
ruby-version: "${{ matrix.ruby }}"
|
|
33
35
|
- name: Bundle
|
|
34
36
|
run: |
|
|
35
|
-
gem install bundler:2.
|
|
37
|
+
gem install bundler:2.3.1
|
|
36
38
|
bundle install --no-deployment
|
|
37
39
|
- name: Run tests
|
|
38
40
|
run: bundle exec rspec
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
3.4.1
|
data/CHANGELOG.md
CHANGED
|
@@ -13,6 +13,14 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
|
|
|
13
13
|
|
|
14
14
|
-
|
|
15
15
|
|
|
16
|
+
## 1.1.2 - 2025-01-22
|
|
17
|
+
|
|
18
|
+
### Compatible changes
|
|
19
|
+
|
|
20
|
+
- Add Ruby 3.4 support
|
|
21
|
+
- Provide dev script `bin/matrix` and adjust REAMDE
|
|
22
|
+
- Move development dependencies out of the gemspec
|
|
23
|
+
|
|
16
24
|
## 1.1.1 - 2022-06-22
|
|
17
25
|
|
|
18
26
|
### Breaking changes
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
memoized (1.1.
|
|
4
|
+
memoized (1.1.2)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
9
|
amazing_print (1.4.0)
|
|
10
|
-
diff-lcs (1.
|
|
11
|
-
gemika (0.
|
|
12
|
-
prop_check (0.
|
|
10
|
+
diff-lcs (1.5.0)
|
|
11
|
+
gemika (0.8.2)
|
|
12
|
+
prop_check (0.18.1)
|
|
13
13
|
amazing_print (~> 1.2)
|
|
14
|
-
rake (
|
|
15
|
-
rspec (3.
|
|
16
|
-
rspec-core (~> 3.
|
|
17
|
-
rspec-expectations (~> 3.
|
|
18
|
-
rspec-mocks (~> 3.
|
|
19
|
-
rspec-core (3.
|
|
20
|
-
rspec-support (~> 3.
|
|
21
|
-
rspec-expectations (3.
|
|
14
|
+
rake (13.0.6)
|
|
15
|
+
rspec (3.12.0)
|
|
16
|
+
rspec-core (~> 3.12.0)
|
|
17
|
+
rspec-expectations (~> 3.12.0)
|
|
18
|
+
rspec-mocks (~> 3.12.0)
|
|
19
|
+
rspec-core (3.12.0)
|
|
20
|
+
rspec-support (~> 3.12.0)
|
|
21
|
+
rspec-expectations (3.12.2)
|
|
22
22
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
23
|
-
rspec-support (~> 3.
|
|
24
|
-
rspec-mocks (3.
|
|
23
|
+
rspec-support (~> 3.12.0)
|
|
24
|
+
rspec-mocks (3.12.3)
|
|
25
25
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
26
|
-
rspec-support (~> 3.
|
|
27
|
-
rspec-support (3.
|
|
26
|
+
rspec-support (~> 3.12.0)
|
|
27
|
+
rspec-support (3.12.0)
|
|
28
28
|
timecop (0.8.1)
|
|
29
29
|
|
|
30
30
|
PLATFORMS
|
|
@@ -33,10 +33,10 @@ PLATFORMS
|
|
|
33
33
|
DEPENDENCIES
|
|
34
34
|
gemika
|
|
35
35
|
memoized!
|
|
36
|
-
prop_check (~> 0.
|
|
37
|
-
rake (~>
|
|
38
|
-
rspec (~> 3.
|
|
36
|
+
prop_check (~> 0.18.1)
|
|
37
|
+
rake (~> 13.0.6)
|
|
38
|
+
rspec (~> 3.12.0)
|
|
39
39
|
timecop (~> 0.8.0)
|
|
40
40
|
|
|
41
41
|
BUNDLED WITH
|
|
42
|
-
2.
|
|
42
|
+
2.3.1
|
data/README.md
CHANGED
|
@@ -120,20 +120,31 @@ calculate value ...
|
|
|
120
120
|
|
|
121
121
|
## Development
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
Development
|
|
124
|
+
-----------
|
|
124
125
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
- Run tests using `bundle exec rake current_rspec`
|
|
126
|
+
I'm very eager to keep this gem leightweight and on topic. If you're unsure whether a change would make
|
|
127
|
+
it into the gem, [talk to me beforehand](mailto:henning.koch@makandra.de).
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
There are tests in `spec`. We only accept PRs with tests. If you create a PR, the tests will automatically run on
|
|
130
|
+
GitHub actions on each push. We will only merge pull requests after a green GitHub actions run.
|
|
130
131
|
|
|
131
|
-
|
|
132
|
-
- Run tests using `bundle exec rake matrix:spec`
|
|
132
|
+
To run tests locally for development you have multiple options:
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
1. Run tests against a specific Ruby version:
|
|
135
|
+
- Install and switch to the Ruby version
|
|
136
|
+
- Install development dependencies using `bundle install`
|
|
137
|
+
- Run tests using `bundle exec rspec`
|
|
135
138
|
|
|
136
|
-
|
|
139
|
+
2. Run tests against all Ruby versions:
|
|
140
|
+
- Install all Ruby versions mentioned in `.github/workflows/test.yml`
|
|
141
|
+
- run `bin/matrix` (only supports `rbenv` for switching Ruby versions currently)
|
|
142
|
+
|
|
143
|
+
Hints:
|
|
144
|
+
- At the time of writing this, we only have a single Gemfile. If that isn't the case any longer,
|
|
145
|
+
check the gemika README for more detailed development instructions.
|
|
146
|
+
- We recommend to have sufficiently new versions of bundler (> 2.3.0) and rubygems (> 3.3.0) installed for each Ruby version.
|
|
147
|
+
- The script `bin/matrix` will warn you, if that is not the case. For all other methods you need to ensure that yourself.
|
|
137
148
|
|
|
138
149
|
## License
|
|
139
150
|
|
data/bin/matrix
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# utility for comparing version strings
|
|
5
|
+
# https://stackoverflow.com/questions/4023830/how-to-compare-two-strings-in-dot-separated-version-format-in-bash
|
|
6
|
+
function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
|
|
7
|
+
|
|
8
|
+
# store current Ruby version and restore it on exit
|
|
9
|
+
original_ruby_version=$(cat .ruby-version)
|
|
10
|
+
trap "rbenv local $original_ruby_version" EXIT
|
|
11
|
+
|
|
12
|
+
# determine employed Ruby versions (awk command == "strip whitespace", sed command == "delete_prefix")
|
|
13
|
+
readarray -t versions < <(grep ruby: .github/workflows/test.yml | awk '{$1=$1};1' | sed 's/- ruby: //' | sort | uniq)
|
|
14
|
+
echo "Detected Ruby versions:"
|
|
15
|
+
for version in "${versions[@]}"
|
|
16
|
+
do
|
|
17
|
+
echo "- $version"
|
|
18
|
+
done
|
|
19
|
+
echo ""
|
|
20
|
+
|
|
21
|
+
for version in "${versions[@]}"
|
|
22
|
+
do
|
|
23
|
+
# switch Ruby version
|
|
24
|
+
rbenv local "$version"
|
|
25
|
+
|
|
26
|
+
# determine actual versions
|
|
27
|
+
ruby_version=$(ruby -v)
|
|
28
|
+
rubygems_version=$(gem -v)
|
|
29
|
+
bundler_version=$(bundler -v | sed 's/Bundler version //')
|
|
30
|
+
|
|
31
|
+
# debug output
|
|
32
|
+
echo "====================="
|
|
33
|
+
echo "Target Ruby version: $version"
|
|
34
|
+
echo ""
|
|
35
|
+
echo "Ruby: $ruby_version"
|
|
36
|
+
echo "rubygems: $rubygems_version"
|
|
37
|
+
echo "Bundler: $bundler_version"
|
|
38
|
+
echo "====================="
|
|
39
|
+
echo ""
|
|
40
|
+
|
|
41
|
+
# version checks (minimum versions to make 'BUNDLED WITH' in Gemfile.lock work correctly)
|
|
42
|
+
if [ $(version $rubygems_version) -lt $(version "3.3.0") ]; then
|
|
43
|
+
echo "Please ensure that your rubygems version is > 3.3.0 for Ruby $ruby_version!"
|
|
44
|
+
echo "Install newest version:"
|
|
45
|
+
echo "gem update --system"
|
|
46
|
+
echo "Install specific version:"
|
|
47
|
+
echo "gem update --system <version>"
|
|
48
|
+
exit 1
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
if [ $(version $bundler_version) -lt $(version "2.3.0") ]; then
|
|
52
|
+
echo "Please ensure that your Bundler version is > 2.3.0 for Ruby $ruby_version!"
|
|
53
|
+
echo "Install newest version:"
|
|
54
|
+
echo "gem install bundler"
|
|
55
|
+
echo "Install specific version:"
|
|
56
|
+
echo "gem install bundler:<version>"
|
|
57
|
+
exit 1
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
# bundle and run specs
|
|
61
|
+
rake matrix:install
|
|
62
|
+
rake matrix:spec
|
|
63
|
+
done
|
|
64
|
+
|
|
65
|
+
exit 0
|
data/lib/memoized/version.rb
CHANGED
data/memoized.gemspec
CHANGED
|
@@ -21,10 +21,4 @@ Gem::Specification.new do |s|
|
|
|
21
21
|
s.require_paths = ["lib"]
|
|
22
22
|
|
|
23
23
|
s.license = 'MIT'
|
|
24
|
-
|
|
25
|
-
s.add_development_dependency('rake', '~> 10.4.2')
|
|
26
|
-
s.add_development_dependency('rspec', '~> 3.5.0')
|
|
27
|
-
s.add_development_dependency('timecop', '~> 0.8.0')
|
|
28
|
-
s.add_development_dependency('prop_check', '~> 0.14.1')
|
|
29
|
-
s.add_development_dependency('gemika')
|
|
30
24
|
end
|
metadata
CHANGED
|
@@ -1,89 +1,18 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: memoized
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Barun Singh
|
|
8
8
|
- Henning Koch
|
|
9
|
-
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
13
|
-
dependencies:
|
|
14
|
-
- !ruby/object:Gem::Dependency
|
|
15
|
-
name: rake
|
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
|
17
|
-
requirements:
|
|
18
|
-
- - "~>"
|
|
19
|
-
- !ruby/object:Gem::Version
|
|
20
|
-
version: 10.4.2
|
|
21
|
-
type: :development
|
|
22
|
-
prerelease: false
|
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
24
|
-
requirements:
|
|
25
|
-
- - "~>"
|
|
26
|
-
- !ruby/object:Gem::Version
|
|
27
|
-
version: 10.4.2
|
|
28
|
-
- !ruby/object:Gem::Dependency
|
|
29
|
-
name: rspec
|
|
30
|
-
requirement: !ruby/object:Gem::Requirement
|
|
31
|
-
requirements:
|
|
32
|
-
- - "~>"
|
|
33
|
-
- !ruby/object:Gem::Version
|
|
34
|
-
version: 3.5.0
|
|
35
|
-
type: :development
|
|
36
|
-
prerelease: false
|
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
38
|
-
requirements:
|
|
39
|
-
- - "~>"
|
|
40
|
-
- !ruby/object:Gem::Version
|
|
41
|
-
version: 3.5.0
|
|
42
|
-
- !ruby/object:Gem::Dependency
|
|
43
|
-
name: timecop
|
|
44
|
-
requirement: !ruby/object:Gem::Requirement
|
|
45
|
-
requirements:
|
|
46
|
-
- - "~>"
|
|
47
|
-
- !ruby/object:Gem::Version
|
|
48
|
-
version: 0.8.0
|
|
49
|
-
type: :development
|
|
50
|
-
prerelease: false
|
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
52
|
-
requirements:
|
|
53
|
-
- - "~>"
|
|
54
|
-
- !ruby/object:Gem::Version
|
|
55
|
-
version: 0.8.0
|
|
56
|
-
- !ruby/object:Gem::Dependency
|
|
57
|
-
name: prop_check
|
|
58
|
-
requirement: !ruby/object:Gem::Requirement
|
|
59
|
-
requirements:
|
|
60
|
-
- - "~>"
|
|
61
|
-
- !ruby/object:Gem::Version
|
|
62
|
-
version: 0.14.1
|
|
63
|
-
type: :development
|
|
64
|
-
prerelease: false
|
|
65
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
66
|
-
requirements:
|
|
67
|
-
- - "~>"
|
|
68
|
-
- !ruby/object:Gem::Version
|
|
69
|
-
version: 0.14.1
|
|
70
|
-
- !ruby/object:Gem::Dependency
|
|
71
|
-
name: gemika
|
|
72
|
-
requirement: !ruby/object:Gem::Requirement
|
|
73
|
-
requirements:
|
|
74
|
-
- - ">="
|
|
75
|
-
- !ruby/object:Gem::Version
|
|
76
|
-
version: '0'
|
|
77
|
-
type: :development
|
|
78
|
-
prerelease: false
|
|
79
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
80
|
-
requirements:
|
|
81
|
-
- - ">="
|
|
82
|
-
- !ruby/object:Gem::Version
|
|
83
|
-
version: '0'
|
|
11
|
+
date: 2025-01-22 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
84
13
|
description: Memoized caches the results of your method calls
|
|
85
|
-
|
|
86
|
-
|
|
14
|
+
executables:
|
|
15
|
+
- matrix
|
|
87
16
|
extensions: []
|
|
88
17
|
extra_rdoc_files: []
|
|
89
18
|
files:
|
|
@@ -97,6 +26,7 @@ files:
|
|
|
97
26
|
- LICENSE.txt
|
|
98
27
|
- README.md
|
|
99
28
|
- Rakefile
|
|
29
|
+
- bin/matrix
|
|
100
30
|
- lib/memoized.rb
|
|
101
31
|
- lib/memoized/parameters.rb
|
|
102
32
|
- lib/memoized/version.rb
|
|
@@ -112,7 +42,6 @@ metadata:
|
|
|
112
42
|
bug_tracker_uri: https://github.com/makandra/memoized/issues
|
|
113
43
|
changelog_uri: https://github.com/makandra/memoized/blob/master/CHANGELOG.md
|
|
114
44
|
rubygems_mfa_required: 'true'
|
|
115
|
-
post_install_message:
|
|
116
45
|
rdoc_options: []
|
|
117
46
|
require_paths:
|
|
118
47
|
- lib
|
|
@@ -127,8 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
127
56
|
- !ruby/object:Gem::Version
|
|
128
57
|
version: '0'
|
|
129
58
|
requirements: []
|
|
130
|
-
rubygems_version: 3.
|
|
131
|
-
signing_key:
|
|
59
|
+
rubygems_version: 3.6.2
|
|
132
60
|
specification_version: 4
|
|
133
61
|
summary: Memoized caches the results of your method calls
|
|
134
62
|
test_files: []
|