aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorGonçalo Silva <goncalossilva@gmail.com>2010-06-12 11:37:05 +0100
committerwycats <wycats@gmail.com>2010-06-17 19:18:52 -0700
commitcb74cfc9c1c95805fac4f0ff6b9f1465a8bf9d64 (patch)
treee05855069bb221ef666526be46e00358924b6ec3 /activesupport
parent901452d06ac39f9870bba27a8bc4c6e4f100f90f (diff)
downloadrails-cb74cfc9c1c95805fac4f0ff6b9f1465a8bf9d64.tar.gz
rails-cb74cfc9c1c95805fac4f0ff6b9f1465a8bf9d64.tar.bz2
rails-cb74cfc9c1c95805fac4f0ff6b9f1465a8bf9d64.zip
check if the data method is defined (meaning it's correctly patched)
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/testing/performance.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/testing/performance.rb b/activesupport/lib/active_support/testing/performance.rb
index 2617763175..cd5f4fc62a 100644
--- a/activesupport/lib/active_support/testing/performance.rb
+++ b/activesupport/lib/active_support/testing/performance.rb
@@ -331,8 +331,8 @@ begin
class Memory < Base
Mode = RubyProf::MEMORY if RubyProf.const_defined?(:MEMORY)
- # Ruby 1.9 + GC profiler patch
- if defined?(GC::Profiler)
+ # Ruby 1.9 + extented GC profiler patch
+ if defined?(GC::Profiler) and GC::Profiler.respond_to?(:data)
def measure
GC.enable
GC.start
@@ -380,8 +380,8 @@ begin
class Objects < Base
Mode = RubyProf::ALLOCATIONS if RubyProf.const_defined?(:ALLOCATIONS)
- # Ruby 1.9 + GC profiler patch
- if defined?(GC::Profiler)
+ # Ruby 1.9 + extented GC profiler patch
+ if defined?(GC::Profiler) and GC::Profiler.respond_to?(:data)
def measure
GC.enable
GC.start