<commit_before>class RailsExceptionHandler

  def initialize(app)
    @app = app
  end

  def call(env)
    @app.call(env)
  rescue Exception => e
    Handler.new(env, e).handle_exception
  end

  def self.configuration
    @configuration ||= Configuration.new
  end

  def self.configure
    yield configuration
    return unless configuration.environments.include?(Rails.env.to_sym)

    Rails.configuration.middleware.use(RailsExceptionHandler)

    Rails.configuration.action_dispatch.show_exceptions = true
    require File.expand_path(File.dirname(__FILE__)) + '/patch/show_exceptions.rb'
  end
end

require 'rails_exception_handler/configuration.rb'
require 'rails_exception_handler/handler.rb'
require 'rails_exception_handler/parser.rb'
require 'rails_exception_handler/engine.rb'
require 'net/http'<commit_msg>consider_all_requests_local needs to be false for errors to be caught in dev mode<commit_after>class RailsExceptionHandler

  def initialize(app)
    @app = app
  end

  def call(env)
    @app.call(env)
  rescue Exception => e
    Handler.new(env, e).handle_exception
  end

  def self.configuration
    @configuration ||= Configuration.new
  end

  def self.configure
    yield configuration
    return unless configuration.environments.include?(Rails.env.to_sym)

    Rails.configuration.middleware.use(RailsExceptionHandler)

    Rails.configuration.action_dispatch.show_exceptions = true
    Rails.configuration.consider_all_requests_local = false
    require File.expand_path(File.dirname(__FILE__)) + '/patch/show_exceptions.rb'
  end
end

require 'rails_exception_handler/configuration.rb'
require 'rails_exception_handler/handler.rb'
require 'rails_exception_handler/parser.rb'
require 'rails_exception_handler/engine.rb'
require 'net/http'
{'fraction_non_alphanumeric': 0.08540723981900453, 'fraction_numerical': 0.0, 'mean_word_length': 4.819078947368421, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1338577', 'n_tokens_mistral': 541, 'n_tokens_neox': 518, 'n_words': 105}