Permalink
Browse files

ruby-prof only makes sense in an MRI context

  • Loading branch information...
goncalossilva committed Mar 25, 2011
1 parent a6e2222 commit 6e99bb6acaf30f2b8cfacb82143dc1d1c761d47f
Showing with 7 additions and 5 deletions.
  1. +7 −5 activesupport/lib/active_support/testing/performance.rb
@@ -3,11 +3,13 @@
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

0 comments on commit 6e99bb6

Please sign in to comment.