lib/duck_puncher.rb in duck_puncher-4.2.1 vs lib/duck_puncher.rb in duck_puncher-4.2.2
- old
+ new
@@ -38,10 +38,10 @@
options = args.last.is_a?(Hash) ? args.pop : {}
classes = args.any? ? args : Ducks.list.keys
classes.each do |klass|
klass = lookup_constant(klass)
Ducks[klass].sort.each do |duck|
- punches = Array(options[:only] || Ducks::Module.instance_method(:local_methods).bind(duck.mod).call)
+ punches = Array(options[:only] || duck.options[:only] || Ducks::Module.instance_method(:local_methods).bind(duck.mod).call)
options[:target] = klass
logger.info %Q(#{klass}#{" <-- #{duck.mod.name}#{punches}" if punches.any?})
unless duck.punch(options)
logger.error %Q(Failed to punch #{name})
end