lib/hotch/memory.rb in hotch-0.5.1 vs lib/hotch/memory.rb in hotch-0.6.0

- old
+ new

@@ -26,10 +26,14 @@ @reports = [] @started = nil @disable_gc = disable_gc end + def self.report(name, **args, &block) + new(name, **args).run(&block).report + end + def start return if @started GC.disable if @disable_gc ObjectSpace::AllocationTracer.setup [:path, :line, :type] ObjectSpace::AllocationTracer.start @@ -45,9 +49,10 @@ end def run start yield + self ensure stop end def report