<commit_before>require 'active_support/version'
require 'active_support/rescuable'

module Pushing #:nodoc:
  module Rescuable
    extend ActiveSupport::Concern
    include ActiveSupport::Rescuable

    class_methods do
      def handle_exception(exception) #:nodoc:
        rescue_with_handler(exception) || raise(exception)
      end
    end

    if ActiveSupport::VERSION::MAJOR > 4
      def handle_exceptions #:nodoc:
        yield
      rescue => exception
        rescue_with_handler(exception) || raise
      end
    else
      def handle_exceptions #:nodoc:
        yield
      end
    end

    private

    def process(*)
      handle_exceptions do
        super
      end
    end
  end
end
<commit_msg>Notifier can rescue errors in Rails 4.2<commit_after>require 'active_support/version'
require 'active_support/rescuable'

module Pushing #:nodoc:
  module Rescuable
    extend ActiveSupport::Concern
    include ActiveSupport::Rescuable

    class_methods do
      def handle_exception(exception) #:nodoc:
        rescue_with_handler(exception) || raise(exception)
      end
    end

    def handle_exceptions #:nodoc:
      yield
    rescue => exception
      rescue_with_handler(exception) || raise
    end

    private

    def process(*)
      handle_exceptions do
        super
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.06575963718820861, 'fraction_numerical': 0.0022675736961451248, 'mean_word_length': 2.7295774647887323, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '3066859', 'n_tokens_mistral': 394, 'n_tokens_neox': 386, 'n_words': 98}