From 8d24a029df47fa9ad36f0e027d3cd447f92af344 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Fri, 20 Jun 2008 10:39:44 -0700 Subject: Don't assume RubyProf constants are defined --- activesupport/lib/active_support/testing/performance.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/testing/performance.rb b/activesupport/lib/active_support/testing/performance.rb index 1f8a5eec8f..5f2027eb3b 100644 --- a/activesupport/lib/active_support/testing/performance.rb +++ b/activesupport/lib/active_support/testing/performance.rb @@ -288,7 +288,7 @@ module ActiveSupport end class CpuTime < Time - Mode = RubyProf::CPU_TIME + Mode = RubyProf::CPU_TIME if RubyProf.const_defined?(:CPU_TIME) def initialize(*args) # FIXME: yeah my CPU is 2.33 GHz @@ -302,7 +302,7 @@ module ActiveSupport end class Memory < Base - Mode = RubyProf::MEMORY + Mode = RubyProf::MEMORY if RubyProf.const_defined?(:MEMORY) # ruby-prof wrapper if RubyProf.respond_to?(:measure_memory) @@ -335,7 +335,7 @@ module ActiveSupport end class Objects < Base - Mode = RubyProf::ALLOCATIONS + Mode = RubyProf::ALLOCATIONS if RubyProf.const_defined?(:ALLOCATIONS) if RubyProf.respond_to?(:measure_allocations) def measure @@ -353,7 +353,7 @@ module ActiveSupport end class GcRuns < Base - Mode = RubyProf::GC_RUNS + Mode = RubyProf::GC_RUNS if RubyProf.const_defined?(:GC_RUNS) if RubyProf.respond_to?(:measure_gc_runs) def measure @@ -375,7 +375,7 @@ module ActiveSupport end class GcTime < Base - Mode = RubyProf::GC_TIME + Mode = RubyProf::GC_TIME if RubyProf.const_defined?(:GC_TIME) if RubyProf.respond_to?(:measure_gc_time) def measure -- cgit v1.2.3