From 019d8813d9939aedafce2e44881aa82d7dacf062 Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Fri, 28 Mar 2014 15:29:57 +0000 Subject: [PATCH] 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. --- lib/mutant/matcher/method/instance.rb | 4 ++-- mutant.gemspec | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/mutant/matcher/method/instance.rb b/lib/mutant/matcher/method/instance.rb index 1b965fa0..cae40be9 100644 --- a/lib/mutant/matcher/method/instance.rb +++ b/lib/mutant/matcher/method/instance.rb @@ -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 diff --git a/mutant.gemspec b/mutant.gemspec index d3bb06dc..bcf382cd 100644 --- a/mutant.gemspec +++ b/mutant.gemspec @@ -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')