<commit_before>if defined? ActionDispatch::Routing

  module ActionDispatch::Routing
    class Mapper

      def faye_server(mount_path, options={}, &block)

        defaults = {
          :mount => mount_path||'/faye',
          :timeout => 25,
          :engine => nil
        }

        unknown_options = options.keys - defaults.keys
        if unknown_options.one?
          raise ArgumentError, "Unknown option: #{unknown_options.first}."
        elsif unknown_options.any?
          raise ArgumentError, "Unknown options: #{unknown_options * ", "}."
        end

        options = defaults.merge(options)

        adapter = FayeRails::RackAdapter.new(options)
        adapter.instance_eval(&block) if block.respond_to? :call

        match options[:mount] => adapter

        ::Faye.ensure_reactor_running!

      end

    end
  end

end

if defined? Rails::Application::RoutesReloader

  class Rails::Application::RoutesReloader

    def clear_with_faye_servers!
      FayeRails.servers.clear!
      clear_without_faye_servers!
    end

    alias clear_without_faye_servers! clear!
    alias clear! clear_with_faye_servers!

  end

end
<commit_msg>Don't start the EM reactor as suggested by jcoglan<commit_after>if defined? ActionDispatch::Routing

  module ActionDispatch::Routing
    class Mapper

      def faye_server(mount_path, options={}, &block)

        defaults = {
          :mount => mount_path||'/faye',
          :timeout => 25,
          :engine => nil
        }

        unknown_options = options.keys - defaults.keys
        if unknown_options.one?
          raise ArgumentError, "Unknown option: #{unknown_options.first}."
        elsif unknown_options.any?
          raise ArgumentError, "Unknown options: #{unknown_options * ", "}."
        end

        options = defaults.merge(options)

        adapter = FayeRails::RackAdapter.new(options)
        adapter.instance_eval(&block) if block.respond_to? :call

        match options[:mount] => adapter

      end

    end
  end

end

if defined? Rails::Application::RoutesReloader

  class Rails::Application::RoutesReloader

    def clear_with_faye_servers!
      FayeRails.servers.clear!
      clear_without_faye_servers!
    end

    alias clear_without_faye_servers! clear!
    alias clear! clear_with_faye_servers!

  end

end

{'fraction_non_alphanumeric': 0.09232769830949285, 'fraction_numerical': 0.0017338534893801473, 'mean_word_length': 2.7225806451612904, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4016936', 'n_tokens_mistral': 697, 'n_tokens_neox': 671, 'n_words': 147}