memery 1.4.1 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +1 -1
- data/Gemfile.lock +3 -3
- data/README.md +1 -1
- data/lib/memery/version.rb +1 -1
- data/lib/memery.rb +5 -3
- data/memery.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97a9a87378334fd120a2d5cff1090a77c77c07fd7ade8f7826b7f224fb38a19c
|
4
|
+
data.tar.gz: 06b10e5f165da54db22aa802d78e3af7146ff63b3eeb08c9192f17d8a713d9c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 301a7a83ea1b19acba82fecbd4cba2372f881514717ee42f10b909a8806bb457f5ec82d1209f23cdaf3ea9d6c3ef1b6a32d520280dbd9385674a03a12147da5f
|
7
|
+
data.tar.gz: 045412175d2776f97f7ff231556de4d7fef00147a7b8e92b7021c603afacf65b8d73d20b8b9eb2ad2b3f97affe979a0b591087c35c05ca83ffea28c8b8b0af80
|
data/.github/workflows/ci.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
memery (1.
|
4
|
+
memery (1.5.0)
|
5
5
|
ruby2_keywords (~> 0.0.2)
|
6
6
|
|
7
7
|
GEM
|
@@ -83,7 +83,7 @@ GEM
|
|
83
83
|
rubocop-sequel (0.2.0)
|
84
84
|
rubocop (~> 1.0)
|
85
85
|
ruby-progressbar (1.11.0)
|
86
|
-
ruby2_keywords (0.0.
|
86
|
+
ruby2_keywords (0.0.5)
|
87
87
|
simplecov (0.21.2)
|
88
88
|
docile (~> 1.1)
|
89
89
|
simplecov-html (~> 0.11)
|
@@ -113,4 +113,4 @@ DEPENDENCIES
|
|
113
113
|
simplecov-lcov
|
114
114
|
|
115
115
|
BUNDLED WITH
|
116
|
-
2.
|
116
|
+
2.4.14
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Memery [![Gem Version](https://badge.fury.io/rb/memery.svg)](https://badge.fury.io/rb/memery)
|
1
|
+
# Memery [![Gem Version](https://badge.fury.io/rb/memery.svg)](https://badge.fury.io/rb/memery) ![Build Status](https://github.com/tycooon/memery/actions/workflows/ci.yml/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/tycooon/memery/badge.svg?branch=master)](https://coveralls.io/github/tycooon/memery?branch=master)
|
2
2
|
|
3
3
|
Memery is a Ruby gem for memoization of method return values. The normal memoization in Ruby doesn't require any gems and looks like this:
|
4
4
|
|
data/lib/memery/version.rb
CHANGED
data/lib/memery.rb
CHANGED
@@ -35,10 +35,12 @@ module Memery
|
|
35
35
|
extend ModuleMethods
|
36
36
|
|
37
37
|
module ClassMethods
|
38
|
-
def memoize(
|
38
|
+
def memoize(*method_names, condition: nil, ttl: nil)
|
39
39
|
prepend_memery_module!
|
40
|
-
|
41
|
-
|
40
|
+
method_names.each do |method_name|
|
41
|
+
define_memoized_method!(method_name, condition: condition, ttl: ttl)
|
42
|
+
end
|
43
|
+
method_names.length > 1 ? method_names : method_names.first
|
42
44
|
end
|
43
45
|
|
44
46
|
def memoized?(method_name)
|
data/memery.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.name = "memery"
|
11
11
|
spec.version = Memery::VERSION
|
12
12
|
spec.authors = ["Yuri Smirnov"]
|
13
|
-
spec.email = ["
|
13
|
+
spec.email = ["tycoooon@gmail.com"]
|
14
14
|
|
15
15
|
spec.summary = "A gem for memoization."
|
16
16
|
spec.description = "Memery is a gem for memoization."
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: memery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuri Smirnov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby2_keywords
|
@@ -166,7 +166,7 @@ dependencies:
|
|
166
166
|
version: '0'
|
167
167
|
description: Memery is a gem for memoization.
|
168
168
|
email:
|
169
|
-
-
|
169
|
+
- tycoooon@gmail.com
|
170
170
|
executables: []
|
171
171
|
extensions: []
|
172
172
|
extra_rdoc_files: []
|
@@ -205,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
205
|
- !ruby/object:Gem::Version
|
206
206
|
version: '0'
|
207
207
|
requirements: []
|
208
|
-
rubygems_version: 3.
|
208
|
+
rubygems_version: 3.4.13
|
209
209
|
signing_key:
|
210
210
|
specification_version: 4
|
211
211
|
summary: A gem for memoization.
|