method

add_gem_filter

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: ActiveSupport::BacktraceCleaner
add_gem_filter() private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activesupport/lib/active_support/backtrace_cleaner.rb, line 110
      def add_gem_filter
        gems_paths = (Gem.path | [Gem.default_dir]).map { |p| Regexp.escape(p) }
        return if gems_paths.empty?

        gems_regexp = %{\A(#{gems_paths.join('|')})/(bundler/)?gems/([^/]+)-([\w.]+)/(.*)}
        gems_result = '\3 (\4) \5'
        add_filter { |line| line.sub(gems_regexp, gems_result) }
      end
Register or log in to add new notes.