Detect memoizable instead of adamantium

* At the time the detector was wrote adamantium shipped memoization. But
  that feature was moved to the memoizable gem.

* Because mutant now uses memoizable API an explicit dependency was
  added to gemspec.
This commit is contained in:
Markus Schirp 2014-03-28 15:29:57 +00:00
parent 87ba520cd7
commit 019d8813d9
2 changed files with 3 additions and 2 deletions

View file

@ -7,7 +7,7 @@ module Mutant
class Instance < self
SUBJECT_CLASS = Subject::Method::Instance
# Dispatching builder, detects adamantium case
# Dispatching builder, detects memoizable case
#
# @param [Cache] cache
# @param [Class, Module] scope
@ -19,7 +19,7 @@ module Mutant
#
def self.build(cache, scope, method)
name = method.name
if scope.ancestors.include?(::Adamantium) and scope.memoized?(name)
if scope.ancestors.include?(::Memoizable) and scope.memoized?(name)
return Memoized.new(cache, scope, method)
end
super

View file

@ -31,6 +31,7 @@ Gem::Specification.new do |gem|
gem.add_runtime_dependency('ice_nine', '~> 0.11.0')
gem.add_runtime_dependency('descendants_tracker', '~> 0.0.1')
gem.add_runtime_dependency('adamantium', '~> 0.2.0')
gem.add_runtime_dependency('memoizable', '~> 0.4.2')
gem.add_runtime_dependency('equalizer', '~> 0.0.7')
gem.add_runtime_dependency('inflecto', '~> 0.0.2')
gem.add_runtime_dependency('anima', '~> 0.2.0')