aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorGonçalo Silva <goncalossilva@gmail.com>2011-03-25 00:02:25 +0000
committerGonçalo Silva <goncalossilva@gmail.com>2011-03-25 00:02:25 +0000
commit6e99bb6acaf30f2b8cfacb82143dc1d1c761d47f (patch)
tree9ef24bd50de290481968378440aa78d67d418229 /activesupport/lib
parenta6e22229b9501f846185306c49009404b4f8466e (diff)
downloadrails-6e99bb6acaf30f2b8cfacb82143dc1d1c761d47f.tar.gz
rails-6e99bb6acaf30f2b8cfacb82143dc1d1c761d47f.tar.bz2
rails-6e99bb6acaf30f2b8cfacb82143dc1d1c761d47f.zip
ruby-prof only makes sense in an MRI context
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/testing/performance.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/testing/performance.rb b/activesupport/lib/active_support/testing/performance.rb
index 9e46e5963e..fe68428a8a 100644
--- a/activesupport/lib/active_support/testing/performance.rb
+++ b/activesupport/lib/active_support/testing/performance.rb
@@ -3,11 +3,13 @@ require 'rails/version'
require 'active_support/core_ext/class/delegating_attributes'
require 'active_support/core_ext/string/inflections'
-begin
- require 'ruby-prof'
-rescue LoadError
- $stderr.puts "Specify ruby-prof as application's dependency in Gemfile to run benchmarks."
- exit
+if !defined?(RUBY_ENGINE) or RUBY_ENGINE == "ruby" # MRI 1.8 or 1.9
+ begin
+ require 'ruby-prof'
+ rescue LoadError
+ $stderr.puts "Specify ruby-prof as application's dependency in Gemfile to run benchmarks."
+ exit
+ end
end
module ActiveSupport