Permalink
Browse files

Don't try to undef object_id.

  • Loading branch information...
1 parent 71ac6de commit fc4c349f0ca232e9cff79cd665785d6ff9a9593e @miloops committed Sep 28, 2010
Showing with 9 additions and 9 deletions.
  1. +9 −9 lib/rbench/group.rb
View
@@ -1,26 +1,26 @@
module RBench
class Group
self.instance_methods.each do |m|
- send(:undef_method, m) unless m =~ /^(__|is_a?|kind_of?|respond_to?|hash|eql?|inspect|instance_eval)/
+ send(:undef_method, m) unless m =~ /^(__|is_a?|kind_of?|respond_to?|hash|eql?|inspect|object_id|instance_eval)/
end
-
+
attr_reader :name, :items, :block, :times
-
+
def initialize(runner, name, times=nil, &block)
@runner = runner
@name = name
@items = []
@block = block
@times = times || @runner.times
end
-
+
def prepare
# This just loops through and spawns the reports, and the summary (if exists)
self.instance_eval(&@block) if @block
- # Now we want to make sure that the summary is
+ # Now we want to make sure that the summary is
@items << @items.shift if @items.first.is_a?(Summary)
end
-
+
def run
# Put a separator with the group-name at the top. puts?
puts @runner.separator(@name)
@@ -31,13 +31,13 @@ def run
def report(name,times=@times,&block)
@items << Report.new(@runner,self,name,times,&block)
end
-
+
def summary(name)
@items.unshift(Summary.new(@runner,self,name)) unless @items.detect{|i| i.is_a?(Summary)}
end
-
+
def to_s
@runner.separator(@name) << @items.map { |item| item.to_s }.join
end
end
-end
+end

0 comments on commit fc4c349

Please sign in to comment.