omega 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/omega/memoize.rb +3 -2
  3. metadata +47 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f1d688b94555b2803900676c622479138859691
4
- data.tar.gz: 9a626a96365b8732700a791f70afb39c6a19f2e7
3
+ metadata.gz: a0d13e58fbfff1bd5ca3eced224dd32a3b0709d0
4
+ data.tar.gz: b143d701d856f9c09e8b2cbce1712f1b086ef023
5
5
  SHA512:
6
- metadata.gz: 8d9b9cd568ff4392068eb4268e864dc8b540b22e878b5fc9b79b934d0c4f69c580fd8488d0fbe3c5477874c939dca6b922f79d63d5afcc32803a2cad37309ae4
7
- data.tar.gz: a6bf605708ee998f654019f9d7343d6088c4e7eebb45e690e62e4ebd33a4bf1f50565f7b56bbe0c3f8248dc8e749fdf66b42e322ea2ee6186113881308168fd3
6
+ metadata.gz: 7938eefc16a7802f614ce32eec2c1fead09fc98f6c27da2600907757d082b1bf542a8f3bcacde5a818f8f6e43126da66b6c683aab93c18a5f8a77baba42c78bf
7
+ data.tar.gz: 5b822fa1936c34359fbb677e21fb8272d5cddf5c5f21424e5e5d63ee7e39629378d49c7e34ef3a2245b0ea720b06c3412a134029d1569a5b206b2691507c8ac3
@@ -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
- alias_method "memoized_#{m}", m
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
- v = hash[args] = method("memoized_#{m}".to_sym).call(*args)
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.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
- description: |
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.2.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.