memery 1.7.0 → 1.8.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56c60aff8199aebc5f2b15e9b777937eea73a7246c61b265c2f6ee980b6dbcd1
4
- data.tar.gz: f16d9b904ded0d29ca13a7a3690f07e4ecec2cb681e56fce6c390db75a20e4cc
3
+ metadata.gz: 47e227e027370bf461105392a87a9b241419c634c3cb2f179698a3d7791b85d8
4
+ data.tar.gz: 9600d9e22380f28b46ca445d235f8bd7e0d788ab26ac6daf9836b3f5de2d8908
5
5
  SHA512:
6
- metadata.gz: 55a891049c8df688bad894e69ece34b11e4319ce1e00c63a081b01df728918661ff1bc7148f0278c20f1c5fa150eca036fcb3b3f7a35b13c859a7552e5f2d39f
7
- data.tar.gz: 491214a08cf1286d6dc908f8972c02c9273b5b8e571cc894e377ab425a965fe0997a5053cd6ab3faae240af0a78159e2cc3418d08b74d8639e2f133d6f54dc27
6
+ metadata.gz: 1bcb999f11bf7bcdc1c6f670725b1800314ab73fca49e42dd27b4764998a211576a5ca0326f1e0b0576e563152dc515d8d91ff7e76d193af14867ecd9af2584e
7
+ data.tar.gz: 3921a52eaa2709ec13872c0c3eb12e0b3d38d9511605a52f34b3bce78de318b1ac2015c56d08c157f2f5b3d157d0802ab52605bb1ccdba9e1ab399b9d64bfd87
@@ -12,7 +12,7 @@ jobs:
12
12
  strategy:
13
13
  fail-fast: false
14
14
  matrix:
15
- ruby: ["3.0", "3.1", "3.2", "3.3", "3.4"]
15
+ ruby: ["3.2", "3.3", "3.4"]
16
16
 
17
17
  name: ${{ matrix.ruby }}
18
18
 
data/.rubocop.yml CHANGED
@@ -3,7 +3,7 @@ inherit_gem:
3
3
 
4
4
  AllCops:
5
5
  DisplayCopNames: true
6
- TargetRubyVersion: 3.0
6
+ TargetRubyVersion: 3.2
7
7
 
8
8
  Naming/MethodParameterName:
9
9
  AllowedNames: ["x", "y", "z"]
data/Gemfile.lock CHANGED
@@ -1,121 +1,131 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- memery (1.7.0)
4
+ memery (1.8.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- activesupport (7.1.5.1)
9
+ activesupport (8.0.2.1)
10
10
  base64
11
11
  benchmark (>= 0.3)
12
12
  bigdecimal
13
- concurrent-ruby (~> 1.0, >= 1.0.2)
13
+ concurrent-ruby (~> 1.0, >= 1.3.1)
14
14
  connection_pool (>= 2.2.5)
15
15
  drb
16
16
  i18n (>= 1.6, < 2)
17
17
  logger (>= 1.4.2)
18
18
  minitest (>= 5.1)
19
- mutex_m
20
19
  securerandom (>= 0.3)
21
- tzinfo (~> 2.0)
22
- ast (2.4.2)
23
- base64 (0.2.0)
24
- benchmark (0.4.0)
20
+ tzinfo (~> 2.0, >= 2.0.5)
21
+ uri (>= 0.13.1)
22
+ ast (2.4.3)
23
+ base64 (0.3.0)
24
+ benchmark (0.4.1)
25
25
  benchmark-ips (2.14.0)
26
26
  benchmark-memory (0.2.0)
27
27
  memory_profiler (~> 1)
28
- bigdecimal (3.1.9)
28
+ bigdecimal (3.2.3)
29
29
  coderay (1.1.3)
30
- concurrent-ruby (1.3.4)
31
- connection_pool (2.4.1)
32
- diff-lcs (1.5.1)
30
+ concurrent-ruby (1.3.5)
31
+ connection_pool (2.5.4)
32
+ diff-lcs (1.6.2)
33
33
  docile (1.4.1)
34
- drb (2.2.1)
35
- i18n (1.14.6)
34
+ drb (2.2.3)
35
+ i18n (1.14.7)
36
36
  concurrent-ruby (~> 1.0)
37
- json (2.9.1)
38
- language_server-protocol (3.17.0.3)
39
- logger (1.6.4)
40
- memory_profiler (1.0.2)
37
+ json (2.13.2)
38
+ language_server-protocol (3.17.0.5)
39
+ lint_roller (1.1.0)
40
+ logger (1.7.0)
41
+ memory_profiler (1.1.0)
41
42
  method_source (1.1.0)
42
- minitest (5.25.4)
43
- mutex_m (0.3.0)
44
- parallel (1.26.3)
45
- parser (3.3.6.0)
43
+ minitest (5.25.5)
44
+ parallel (1.27.0)
45
+ parser (3.3.9.0)
46
46
  ast (~> 2.4.1)
47
47
  racc
48
+ prism (1.4.0)
48
49
  pry (0.15.2)
49
50
  coderay (~> 1.1)
50
51
  method_source (~> 1.0)
51
52
  racc (1.8.1)
52
- rack (3.1.8)
53
+ rack (3.2.1)
53
54
  rainbow (3.1.1)
54
- rake (13.2.1)
55
- regexp_parser (2.10.0)
56
- rspec (3.13.0)
55
+ rake (13.3.0)
56
+ regexp_parser (2.11.2)
57
+ rspec (3.13.1)
57
58
  rspec-core (~> 3.13.0)
58
59
  rspec-expectations (~> 3.13.0)
59
60
  rspec-mocks (~> 3.13.0)
60
- rspec-core (3.13.2)
61
+ rspec-core (3.13.5)
61
62
  rspec-support (~> 3.13.0)
62
- rspec-expectations (3.13.3)
63
+ rspec-expectations (3.13.5)
63
64
  diff-lcs (>= 1.2.0, < 2.0)
64
65
  rspec-support (~> 3.13.0)
65
- rspec-mocks (3.13.2)
66
+ rspec-mocks (3.13.5)
66
67
  diff-lcs (>= 1.2.0, < 2.0)
67
68
  rspec-support (~> 3.13.0)
68
- rspec-support (3.13.2)
69
- rubocop (1.69.2)
69
+ rspec-support (3.13.5)
70
+ rubocop (1.75.8)
70
71
  json (~> 2.3)
71
- language_server-protocol (>= 3.17.0)
72
+ language_server-protocol (~> 3.17.0.2)
73
+ lint_roller (~> 1.1.0)
72
74
  parallel (~> 1.10)
73
75
  parser (>= 3.3.0.2)
74
76
  rainbow (>= 2.2.2, < 4.0)
75
77
  regexp_parser (>= 2.9.3, < 3.0)
76
- rubocop-ast (>= 1.36.2, < 2.0)
78
+ rubocop-ast (>= 1.44.0, < 2.0)
77
79
  ruby-progressbar (~> 1.7)
78
80
  unicode-display_width (>= 2.4.0, < 4.0)
79
- rubocop-ast (1.37.0)
80
- parser (>= 3.3.1.0)
81
- rubocop-config-umbrellio (1.69.0.101)
82
- rubocop (~> 1.69.0)
83
- rubocop-factory_bot (~> 2.26.0)
84
- rubocop-performance (~> 1.23.0)
85
- rubocop-rails (~> 2.28.0)
86
- rubocop-rake (~> 0.6.0)
87
- rubocop-rspec (~> 3.3.0)
88
- rubocop-sequel (~> 0.3.0)
89
- rubocop-factory_bot (2.26.1)
90
- rubocop (~> 1.61)
91
- rubocop-performance (1.23.1)
92
- rubocop (>= 1.48.1, < 2.0)
93
- rubocop-ast (>= 1.31.1, < 2.0)
94
- rubocop-rails (2.28.0)
81
+ rubocop-ast (1.46.0)
82
+ parser (>= 3.3.7.2)
83
+ prism (~> 1.4)
84
+ rubocop-config-umbrellio (1.75.0.104)
85
+ rubocop (~> 1.75.0)
86
+ rubocop-factory_bot (~> 2.27.0)
87
+ rubocop-performance (~> 1.25.0)
88
+ rubocop-rails (~> 2.32.0)
89
+ rubocop-rake (~> 0.7.0)
90
+ rubocop-rspec (~> 3.6.0)
91
+ rubocop-sequel (~> 0.4.0)
92
+ rubocop-factory_bot (2.27.1)
93
+ lint_roller (~> 1.1)
94
+ rubocop (~> 1.72, >= 1.72.1)
95
+ rubocop-performance (1.25.0)
96
+ lint_roller (~> 1.1)
97
+ rubocop (>= 1.75.0, < 2.0)
98
+ rubocop-ast (>= 1.38.0, < 2.0)
99
+ rubocop-rails (2.32.0)
95
100
  activesupport (>= 4.2.0)
101
+ lint_roller (~> 1.1)
96
102
  rack (>= 1.1)
97
- rubocop (>= 1.52.0, < 2.0)
98
- rubocop-ast (>= 1.31.1, < 2.0)
99
- rubocop-rake (0.6.0)
100
- rubocop (~> 1.0)
101
- rubocop-rspec (3.3.0)
102
- rubocop (~> 1.61)
103
- rubocop-sequel (0.3.8)
104
- rubocop (~> 1.0)
103
+ rubocop (>= 1.75.0, < 2.0)
104
+ rubocop-ast (>= 1.44.0, < 2.0)
105
+ rubocop-rake (0.7.1)
106
+ lint_roller (~> 1.1)
107
+ rubocop (>= 1.72.1)
108
+ rubocop-rspec (3.6.0)
109
+ lint_roller (~> 1.1)
110
+ rubocop (~> 1.72, >= 1.72.1)
111
+ rubocop-sequel (0.4.1)
112
+ lint_roller (~> 1.1)
113
+ rubocop (>= 1.72.1, < 2)
105
114
  ruby-progressbar (1.13.0)
106
- securerandom (0.3.2)
115
+ securerandom (0.4.1)
107
116
  simplecov (0.22.0)
108
117
  docile (~> 1.1)
109
118
  simplecov-html (~> 0.11)
110
119
  simplecov_json_formatter (~> 0.1)
111
- simplecov-html (0.13.1)
112
- simplecov-lcov (0.8.0)
120
+ simplecov-html (0.13.2)
121
+ simplecov-lcov (0.9.0)
113
122
  simplecov_json_formatter (0.1.4)
114
123
  tzinfo (2.0.6)
115
124
  concurrent-ruby (~> 1.0)
116
- unicode-display_width (3.1.3)
125
+ unicode-display_width (3.1.5)
117
126
  unicode-emoji (~> 4.0, >= 4.0.4)
118
127
  unicode-emoji (4.0.4)
128
+ uri (1.0.3)
119
129
 
120
130
  PLATFORMS
121
131
  ruby
@@ -134,4 +144,4 @@ DEPENDENCIES
134
144
  simplecov-lcov
135
145
 
136
146
  BUNDLED WITH
137
- 2.5.23
147
+ 2.7.1
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Memery
4
- VERSION = "1.7.0"
4
+ VERSION = "1.8.0"
5
5
  end
data/lib/memery.rb CHANGED
@@ -38,6 +38,10 @@ module Memery
38
38
 
39
39
  module ClassMethods
40
40
  def memoize(*method_names, condition: nil, ttl: nil)
41
+ if method_names.empty?
42
+ @_memery_memoize_next_method = { condition: condition, ttl: ttl }
43
+ return
44
+ end
41
45
  prepend_memery_module!
42
46
  method_names.each do |method_name|
43
47
  define_memoized_method!(method_name, condition: condition, ttl: ttl)
@@ -52,6 +56,15 @@ module Memery
52
56
  @_memery_module.private_method_defined?(method_name)
53
57
  end
54
58
 
59
+ def method_added(name)
60
+ super
61
+
62
+ return unless @_memery_memoize_next_method
63
+
64
+ memoize(name, **@_memery_memoize_next_method)
65
+ @_memery_memoize_next_method = nil
66
+ end
67
+
55
68
  private
56
69
 
57
70
  def prepend_memery_module!
@@ -60,8 +73,8 @@ module Memery
60
73
  prepend(@_memery_module)
61
74
  end
62
75
 
63
- def define_memoized_method!(method_name, **options)
64
- @_memery_module.define_memoized_method!(self, method_name, **options)
76
+ def define_memoized_method!(method_name, **)
77
+ @_memery_module.define_memoized_method!(self, method_name, **)
65
78
  end
66
79
 
67
80
  module MemoizationModule
data/memery.gemspec CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  require "memery/version"
6
6
 
7
7
  Gem::Specification.new do |spec|
8
- spec.required_ruby_version = ">= 3.0.0"
8
+ spec.required_ruby_version = ">= 3.2.0"
9
9
 
10
10
  spec.name = "memery"
11
11
  spec.version = Memery::VERSION
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memery
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuri Smirnov
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-03-04 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
12
  description: Memery is a gem for memoization.
14
13
  email:
@@ -35,7 +34,6 @@ homepage: https://github.com/tycooon/memery
35
34
  licenses:
36
35
  - MIT
37
36
  metadata: {}
38
- post_install_message:
39
37
  rdoc_options: []
40
38
  require_paths:
41
39
  - lib
@@ -43,15 +41,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
43
41
  requirements:
44
42
  - - ">="
45
43
  - !ruby/object:Gem::Version
46
- version: 3.0.0
44
+ version: 3.2.0
47
45
  required_rubygems_version: !ruby/object:Gem::Requirement
48
46
  requirements:
49
47
  - - ">="
50
48
  - !ruby/object:Gem::Version
51
49
  version: '0'
52
50
  requirements: []
53
- rubygems_version: 3.5.23
54
- signing_key:
51
+ rubygems_version: 3.7.1
55
52
  specification_version: 4
56
53
  summary: A gem for memoization.
57
54
  test_files: []