omega 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omega/memoize.rb +3 -2
- metadata +47 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0d13e58fbfff1bd5ca3eced224dd32a3b0709d0
|
4
|
+
data.tar.gz: b143d701d856f9c09e8b2cbce1712f1b086ef023
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7938eefc16a7802f614ce32eec2c1fead09fc98f6c27da2600907757d082b1bf542a8f3bcacde5a818f8f6e43126da66b6c683aab93c18a5f8a77baba42c78bf
|
7
|
+
data.tar.gz: 5b822fa1936c34359fbb677e21fb8272d5cddf5c5f21424e5e5d63ee7e39629378d49c7e34ef3a2245b0ea720b06c3412a134029d1569a5b206b2691507c8ac3
|
data/lib/omega/memoize.rb
CHANGED
@@ -2,13 +2,14 @@ class Module
|
|
2
2
|
def memoize n, *arr
|
3
3
|
meta = (class << self; self; end)
|
4
4
|
([n] + arr).each do |m|
|
5
|
-
|
5
|
+
meth = instance_method(m)
|
6
6
|
hash = Hash.new
|
7
7
|
define_method m do |*args|
|
8
8
|
if hash.include? args
|
9
9
|
hash[args]
|
10
10
|
else
|
11
|
-
|
11
|
+
meth = meth.bind(self) if meth.is_a? UnboundMethod
|
12
|
+
v = hash[args] = meth.call(*args)
|
12
13
|
v.freeze
|
13
14
|
v
|
14
15
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omega
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nax
|
@@ -9,9 +9,52 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2014-08-07 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
13
|
-
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '10.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '10.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: minitest
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '5.4'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '5.4'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest-reporters
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.0'
|
55
|
+
description: |-
|
14
56
|
Omega is a powerful set of extensions to the basic ruby standard.
|
57
|
+
Things like efficient memoization, meta-helpers, easy class tree traversal andadvanced math are included.
|
15
58
|
email: max.bacoux@gmail.com
|
16
59
|
executables: []
|
17
60
|
extensions: []
|
@@ -42,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
42
85
|
version: '0'
|
43
86
|
requirements: []
|
44
87
|
rubyforge_project:
|
45
|
-
rubygems_version: 2.
|
88
|
+
rubygems_version: 2.4.1
|
46
89
|
signing_key:
|
47
90
|
specification_version: 4
|
48
91
|
summary: A collection of libraries and extensions to the standard.
|