Sha256: 964397c6f6da8aaf0d0031b27254d82b19eed8ad85be8903dcacf9d7b451270a

Contents?: true

Size: 868 Bytes

Versions: 76

Compression:

Stored size: 868 Bytes

Contents

class Exception # :nodoc:
  def clean_message
    Pathname.clean_within message
  end
  
  TraceSubstitutions = []
  FrameworkRegexp = /generated|vendor|dispatch|ruby|script\/\w+/
  
  def clean_backtrace
    backtrace.collect do |line|
      Pathname.clean_within(TraceSubstitutions.inject(line) do |line, (regexp, sub)|
        line.gsub regexp, sub
      end)
    end
  end
  
  def application_backtrace
    before_application_frame = true
    
    trace = clean_backtrace.reject do |line|
      non_app_frame = (line =~ FrameworkRegexp)
      before_application_frame = false unless non_app_frame
      non_app_frame && ! before_application_frame
    end
    
    # If we didn't find any application frames, return an empty app trace.
    before_application_frame ? [] : trace
  end
  
  def framework_backtrace
    clean_backtrace.grep FrameworkRegexp
  end
end

Version data entries

76 entries across 76 versions & 5 rubygems

Version Path
jstorimer-deep-test-2.0.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/exception.rb
jstorimer-deep-test-1.4.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/exception.rb
jstorimer-deep-test-1.3.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/exception.rb
jstorimer-deep-test-1.2.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/exception.rb
jstorimer-deep-test-1.1.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/exception.rb
jstorimer-deep-test-1.0.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/exception.rb
jstorimer-deep-test-0.2.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/exception.rb
jstorimer-deep-test-0.1.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/core_ext/exception.rb
activesupport-1.4.3 lib/active_support/core_ext/exception.rb
activesupport-1.4.1 lib/active_support/core_ext/exception.rb
activesupport-1.4.4 lib/active_support/core_ext/exception.rb
activesupport-1.4.2 lib/active_support/core_ext/exception.rb
activesupport-1.4.0 lib/active_support/core_ext/exception.rb
backlog-0.0.0 vendor/rails/activesupport/lib/active_support/core_ext/exception.rb
backlog-0.0.1 vendor/rails/activesupport/lib/active_support/core_ext/exception.rb
backlog-0.0.2 vendor/rails/activesupport/lib/active_support/core_ext/exception.rb
backlog-0.0.5 vendor/rails/activesupport/lib/active_support/core_ext/exception.rb
backlog-0.0.4 vendor/rails/activesupport/lib/active_support/core_ext/exception.rb
backlog-0.1.0 vendor/rails/activesupport/lib/active_support/core_ext/exception.rb
backlog-0.1.1 vendor/rails/activesupport/lib/active_support/core_ext/exception.rb