Skip to content

Commit

Permalink
Pakiderm is in the house 🎸
Browse files Browse the repository at this point in the history
  • Loading branch information
ElMassimo committed Apr 14, 2014
1 parent 499a610 commit 8fecbfd
Show file tree
Hide file tree
Showing 30 changed files with 2,416 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .ruby-gemset
Original file line number Diff line number Diff line change
@@ -1 +1 @@
simple_memoizer
pakiderm
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: ruby
rvm:
- 2.1.1
- 2.0.0
1 change: 1 addition & 0 deletions .yardoc/checksums
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib/pakiderm.rb f8e7aaa94b40435ec49a949fb942b562378678a1
Binary file added .yardoc/object_types
Binary file not shown.
Binary file added .yardoc/objects/root.dat
Binary file not shown.
Binary file added .yardoc/proxy_types
Binary file not shown.
13 changes: 12 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
source 'https://rubygems.org'

gemspec
gem 'activesupport', '4.0.2'
gem 'coveralls', require: false
gem 'rake'
gem 'bundler'

group :test do
gem 'rspec-given'
end

group :doc do
gem 'yard'
gem 'yard-tomdoc'
end
61 changes: 61 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
PATH
remote: .
specs:
pakiderm (1.0.0)

GEM
remote: https://rubygems.org/
specs:
coveralls (0.7.0)
multi_json (~> 1.3)
rest-client
simplecov (>= 0.7)
term-ansicolor
thor
diff-lcs (1.2.5)
docile (1.1.3)
given_core (3.5.4)
sorcerer (>= 0.3.7)
mime-types (2.2)
multi_json (1.9.2)
rake (10.2.2)
rest-client (1.6.7)
mime-types (>= 1.16)
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (2.14.8)
rspec-expectations (2.14.5)
diff-lcs (>= 1.1.3, < 2.0)
rspec-given (3.5.4)
given_core (= 3.5.4)
rspec (>= 2.12)
rspec-mocks (2.14.6)
simplecov (0.8.2)
docile (~> 1.1.0)
multi_json
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
sorcerer (1.0.2)
term-ansicolor (1.3.0)
tins (~> 1.0)
thor (0.19.1)
tins (1.1.0)
tomparse (0.4.2)
yard (0.8.7.4)
yard-tomdoc (0.7.1)
tomparse (>= 0.4.0)
yard

PLATFORMS
ruby

DEPENDENCIES
bundler
coveralls
pakiderm!
rake
rspec-given
yard
yard-tomdoc
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
Simple Memoizer
Pakiderm
=====================

Allows you to memoize simple methods and works only on ruby 2.0.

## Usage
```ruby
class Counter
extend Pakiderm

def increment
@sum = 1 + @sum.to_i
end
Expand Down Expand Up @@ -33,7 +35,7 @@ counter.increment
As you can see, it also provides an assignment operator, so you can override the memoized value :smiley:.

## Background
SimpleMemoizer uses Module#prepend to add the memoized method before yours in the method lookup path of your class. Your method is called by using 'super', because the class is an ancestor to the prepended module.
Pakiderm uses Module#prepend to add the memoized method before yours in the method lookup path of your class. Your method is called by using 'super', because the class is an ancestor to the prepended module.

### Corolary
If you override a memoized method in a derived class, you alter the method chain, so the derived method won't be memoized unless you invoke memoize in the derived class as well.
Loading

0 comments on commit 8fecbfd

Please sign in to comment.