<commit_before>require 'shipit/webhooks/handlers'

module Shipit
  module Webhooks
    def self.default_handlers
      {
        'push' => [Handlers::PushHandler],
        'status' => [Handlers::StatusHandler],
        'membership' => [Handlers::MembershipHandler],
        'check_suite' => [Handlers::CheckSuiteHandler],
      }
    end

    def self.handlers
      @handlers ||= reset_handler_registry
    end

    def self.reset_handler_registry
      @handlers = default_handlers
    end

    def self.register_handler(event, callable = nil, &block)
      handlers[event] ||= []
      handlers[event] << callable if callable
      handlers[event] << block if block_given?
    end

    def self.for_event(event)
      handlers.fetch(event) { [] }
    end
  end
end<commit_msg>Define webhook class methods by opening the singleton class<commit_after>require 'shipit/webhooks/handlers'

module Shipit
  module Webhooks
    class << self
      def default_handlers
        {
          'push' => [Handlers::PushHandler],
          'status' => [Handlers::StatusHandler],
          'membership' => [Handlers::MembershipHandler],
          'check_suite' => [Handlers::CheckSuiteHandler],
        }
      end

      def handlers
        @handlers ||= reset_handler_registry
      end

      def reset_handler_registry
        @handlers = default_handlers
      end

      def register_handler(event, callable = nil, &block)
        handlers[event] ||= []
        handlers[event] << callable if callable
        handlers[event] << block if block_given?
      end

      def for_event(event)
        handlers.fetch(event) { [] }
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.10369921164342026, 'fraction_numerical': 0.0, 'mean_word_length': 2.5869565217391304, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, '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': '7354083', 'n_tokens_mistral': 498, 'n_tokens_neox': 492, 'n_words': 106}