aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-06-20 10:39:44 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2008-06-20 10:42:36 -0700
commit8d24a029df47fa9ad36f0e027d3cd447f92af344 (patch)
tree8778829f3f0100f33423fbf6a746370b955b2d0f /activesupport/lib/active_support
parent161ab28b7c0bd28828b6d18613a9de09d47023c6 (diff)
downloadrails-8d24a029df47fa9ad36f0e027d3cd447f92af344.tar.gz
rails-8d24a029df47fa9ad36f0e027d3cd447f92af344.tar.bz2
rails-8d24a029df47fa9ad36f0e027d3cd447f92af344.zip
Don't assume RubyProf constants are defined
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/testing/performance.rb10
1 files changed, 5 insertions, 5 deletions
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