Permalink
Browse files

Make sure that Rails frameworks are silenced when running in gem mode…

… too
  • Loading branch information...
1 parent 713b9c6 commit de540416e9a1ead164c9c80352565de2dc5955ce @dhh dhh committed Mar 5, 2009
Showing with 3 additions and 0 deletions.
  1. +3 −0 railties/lib/rails/backtrace_cleaner.rb
@@ -2,6 +2,8 @@ module Rails
class BacktraceCleaner < ActiveSupport::BacktraceCleaner
ERB_METHOD_SIG = /:in `_run_erb_.*/
+ RAILS_GEMS = %w( actionpack activerecord actionmailer activesupport activeresource rails )
+
VENDOR_DIRS = %w( vendor/gems vendor/rails )
SERVER_DIRS = %w( lib/mongrel bin/mongrel
lib/passenger bin/passenger-spawn-server
@@ -20,6 +22,7 @@ def initialize
add_filter { |line| line.sub('./', '/') } # for tests
add_filter { |line| line.sub(/(#{GEMS_DIR})\/gems\/([a-z]+)-([0-9.]+)\/(.*)/, '\2 (\3) \4')} # http://gist.github.com/30430
add_silencer { |line| ALL_NOISE.any? { |dir| line.include?(dir) } }
+ add_silencer { |line| RAILS_GEMS.any? { |gem| line =~ /^#{gem} / } }
add_silencer { |line| line =~ %r(vendor/plugins/[^\/]+/lib) }
end
end

0 comments on commit de54041

Please sign in to comment.