ruby_memoized 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +6 -6
- data/bin/console +1 -1
- data/lib/{memoized → ruby_memoized}/memoizer.rb +1 -1
- data/lib/ruby_memoized/version.rb +3 -0
- data/lib/{memoized.rb → ruby_memoized.rb} +3 -3
- data/{memoized.gemspec → ruby_memoized.gemspec} +3 -3
- metadata +6 -6
- data/lib/memoized/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ad5ac89255f88f10564e9bfe3a6b4e604069122
|
4
|
+
data.tar.gz: 8b750ffaf782f03c0c2e8fec544c7281a0441840
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0446a7a4a6522176a01cb37e9f52c6c29918c657e73dbcf5d9ac2397a094a8eb4eab8d9a8ea35571631e9f3fead914f2deab4fd5f1e7661ae7cdea61daf22593
|
7
|
+
data.tar.gz: e8acaedff6c25d4752dd9eb60236f12dc62272d5db6230ac1c114fdb9c40b9054a063db682a23d2dda655b2280faf2ded5d9a3b75cb2264f0751b6c8f1a6e685
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# RubyMemoized
|
2
2
|
|
3
|
-
|
3
|
+
RubyMemoized makes it easy to memoize methods, even if they have arguments or blocks,
|
4
4
|
by making memoization as easy as declaring a method private.
|
5
5
|
To experiment with that code, run `bin/console` for an interactive prompt.
|
6
6
|
|
@@ -21,7 +21,7 @@ And then execute:
|
|
21
21
|
|
22
22
|
Or install it yourself as:
|
23
23
|
|
24
|
-
$ gem install
|
24
|
+
$ gem install ruby_memoized
|
25
25
|
|
26
26
|
## Usage
|
27
27
|
|
@@ -74,7 +74,7 @@ We could unmemoize it by doing the following:
|
|
74
74
|
|
75
75
|
```ruby
|
76
76
|
class FibonacciCalculator
|
77
|
-
include
|
77
|
+
include RubyMemoized
|
78
78
|
|
79
79
|
memoized
|
80
80
|
|
@@ -92,14 +92,14 @@ class FibonacciCalculator
|
|
92
92
|
end
|
93
93
|
```
|
94
94
|
|
95
|
-
Alright, that sounds all well and good. But what if we really didn't wanna call `include
|
95
|
+
Alright, that sounds all well and good. But what if we really didn't wanna call `include RubyMemoized` everywhere but
|
96
96
|
still wanted to use memoization?
|
97
97
|
|
98
98
|
We could just add it to `Object`!
|
99
99
|
|
100
100
|
```ruby
|
101
101
|
class Object
|
102
|
-
include
|
102
|
+
include RubyMemoized
|
103
103
|
end
|
104
104
|
```
|
105
105
|
|
data/bin/console
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require '
|
4
|
+
require 'ruby_memoized/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'ruby_memoized'
|
8
|
-
spec.version =
|
8
|
+
spec.version = RubyMemoized::VERSION
|
9
9
|
spec.authors = ['Kirill Klimuk']
|
10
10
|
spec.email = ['kklimuk@gmail.com']
|
11
11
|
|
12
12
|
spec.summary = %q{Memoize method return values even with different arguments.}
|
13
13
|
spec.description = <<-DESC.gsub(/\s\s+/, ' ')
|
14
|
-
|
14
|
+
RubyMemoized makes it easy to memoize methods, even if they have arguments or blocks, by making memoization as easy
|
15
15
|
as declaring a method private.
|
16
16
|
DESC
|
17
17
|
spec.homepage = 'https://github.com/kklimuk/memoized'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_memoized
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kirill Klimuk
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
-
description: '
|
55
|
+
description: 'RubyMemoized makes it easy to memoize methods, even if they have arguments
|
56
56
|
or blocks, by making memoization as easy as declaring a method private.
|
57
57
|
|
58
58
|
'
|
@@ -73,10 +73,10 @@ files:
|
|
73
73
|
- Rakefile
|
74
74
|
- bin/console
|
75
75
|
- bin/setup
|
76
|
-
- lib/
|
77
|
-
- lib/
|
78
|
-
- lib/
|
79
|
-
-
|
76
|
+
- lib/ruby_memoized.rb
|
77
|
+
- lib/ruby_memoized/memoizer.rb
|
78
|
+
- lib/ruby_memoized/version.rb
|
79
|
+
- ruby_memoized.gemspec
|
80
80
|
homepage: https://github.com/kklimuk/memoized
|
81
81
|
licenses:
|
82
82
|
- MIT
|
data/lib/memoized/version.rb
DELETED