lib/fozzie/sniff.rb in fozzie-0.0.21 vs lib/fozzie/sniff.rb in fozzie-0.0.22

- old
+ new

@@ -29,25 +29,29 @@ blk.call(with, without, feature, bin) end def method_added(target) _monitor_meth(target) do |with, without, feature, bin| - define_method(with) do |*args| - S.time_for(bin) { args.empty? ? self.send(without) : self.send(without, *args) } + define_method(with) do |*args, &blk| + S.time_for(bin) do + args.empty? ? self.send(without, &blk) : self.send(without, *args, &blk) + end end self.alias_method_chain(target, feature) end end def singleton_method_added(target) _monitor_meth(target) do |with, without, feature, bin| - define_singleton_method(with) do |*args| - S.time_for(bin) { args.empty? ? send(without) : send(without, *args) } + define_singleton_method(with) do |*args, &blk| + S.time_for(bin) do + args.empty? ? send(without, &blk) : send(without, *args, &blk) + end end self.singleton_class.class_eval { alias_method_chain target, feature } end end end end -end \ No newline at end of file +end