lib/gestalt.rb in gestalt-0.0.8 vs lib/gestalt.rb in gestalt-0.0.9

- old
+ new

@@ -3,11 +3,11 @@ require 'rubygems' require 'formatador' class Gestalt - VERSION = '0.0.8' + VERSION = '0.0.9' attr_accessor :calls def initialize(options = {}) options = { @@ -93,12 +93,15 @@ end end end end ) - yield + begin + value = yield rescue StandardError, Interrupt + # noop + end Kernel.set_trace_func(nil) @stack.pop # pop Kernel#set_trace_func(nil) unless @stack.empty? @stack.last.children.pop # pop Kernel#set_trace_func(nil) end @@ -106,9 +109,10 @@ call.finish if @stack.empty? @calls << call end end + value end def self.profile(options = {}, &block) gestalt = new(options) gestalt.run(&block)