Skip to content

Commit

Permalink
Make sure that Rails frameworks are silenced when running in gem mode…
Browse files Browse the repository at this point in the history
… too
  • Loading branch information
dhh committed Mar 5, 2009
1 parent 713b9c6 commit de54041
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions railties/lib/rails/backtrace_cleaner.rb
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit de54041

Please sign in to comment.