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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa73eb81311be05525651697942d76ae7b171ffe70d0f1b5851e5f41bf74cebd
4
- data.tar.gz: d5993503224c4c1e60e84c97343d373c0e59eebfe4f735302423b6f88a1d2d33
3
+ metadata.gz: 97a9a87378334fd120a2d5cff1090a77c77c07fd7ade8f7826b7f224fb38a19c
4
+ data.tar.gz: 06b10e5f165da54db22aa802d78e3af7146ff63b3eeb08c9192f17d8a713d9c0
5
5
  SHA512:
6
- metadata.gz: bb9610aeab7ea46e94e411d5200f295910f01687f240b7ea21c0867c33a6e57a111649104199d0808dda3e0db2b36f944a3fd40c808eda26e78c3bb7ab5c3c6d
7
- data.tar.gz: 3ced0dec017d683e82b698866a79072f97ad723b6df0a3e6029ac41037ff634343abbaec3f2fc5740799308108c3a1cc3ff7e36c15f4796121b287aaaf120858
6
+ metadata.gz: 301a7a83ea1b19acba82fecbd4cba2372f881514717ee42f10b909a8806bb457f5ec82d1209f23cdaf3ea9d6c3ef1b6a32d520280dbd9385674a03a12147da5f
7
+ data.tar.gz: 045412175d2776f97f7ff231556de4d7fef00147a7b8e92b7021c603afacf65b8d73d20b8b9eb2ad2b3f97affe979a0b591087c35c05ca83ffea28c8b8b0af80
@@ -12,7 +12,7 @@ jobs:
12
12
  strategy:
13
13
  fail-fast: false
14
14
  matrix:
15
- ruby: ["2.5", "2.6", "2.7", "3.0"]
15
+ ruby: ["2.5", "2.6", "2.7", "3.0", "3.1"]
16
16
 
17
17
  name: ${{ matrix.ruby }}
18
18
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- memery (1.4.0)
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.4)
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.2.17
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) [![Build Status](https://travis-ci.org/tycooon/memery.svg?branch=master)](https://travis-ci.org/tycooon/memery) [![Coverage Status](https://coveralls.io/repos/github/tycooon/memery/badge.svg?branch=master)](https://coveralls.io/github/tycooon/memery?branch=master)
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Memery
4
- VERSION = "1.4.1"
4
+ VERSION = "1.5.0"
5
5
  end
data/lib/memery.rb CHANGED
@@ -35,10 +35,12 @@ module Memery
35
35
  extend ModuleMethods
36
36
 
37
37
  module ClassMethods
38
- def memoize(method_name, condition: nil, ttl: nil)
38
+ def memoize(*method_names, condition: nil, ttl: nil)
39
39
  prepend_memery_module!
40
- define_memoized_method!(method_name, condition: condition, ttl: ttl)
41
- method_name
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 = ["tycooon@yandex.ru"]
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.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: 2021-06-16 00:00:00.000000000 Z
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
- - tycooon@yandex.ru
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.2.17
208
+ rubygems_version: 3.4.13
209
209
  signing_key:
210
210
  specification_version: 4
211
211
  summary: A gem for memoization.