File tree Expand file tree Collapse file tree 2 files changed +2
-9
lines changed
lib/active_support/inflector Expand file tree Collapse file tree 2 files changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -25,5 +25,5 @@ Gem::Specification.new do |s|
2525 s . add_dependency 'tzinfo' , '~> 0.3.37'
2626 s . add_dependency 'minitest' , '~> 4.2'
2727 s . add_dependency 'thread_safe' , '~> 0.1'
28- s . add_dependency 'lru_redux'
28+ s . add_dependency 'lru_redux' , '~> 0.0.6'
2929end
Original file line number Diff line number Diff line change 22
33require 'lru_redux'
44
5- LruRedux ::Cache . class_eval do
6- def fetch ( key )
7- self [ key ] = yield unless @data . key? ( key )
8- self [ key ]
9- end
10- end
11-
125module ActiveSupport
136 module Inflector
147 LRU_CACHE_SIZE = 200
@@ -26,7 +19,7 @@ def self.memoize(method_name)
2619
2720 # Note that so far no method in the inflector gets a block.
2821 define_method ( method_name ) do |*args |
29- cache . fetch ( args ) do
22+ cache . getset ( args ) do
3023 send ( "#{ method_name } _without_lru_cache" , *args )
3124 end
3225 end
You can’t perform that action at this time.
0 commit comments