<commit_before>module Polonium
  module ServerRunners
    class WebrickServerRunner < ServerRunner
    attr_accessor :server

    def initialize(configuration)
      require 'webrick_server'
      super
    end

    protected
    def start_server
      @server = create_webrick_server
      mount_parameters = {
        :port            => configuration.internal_app_server_port,
        :ip              => configuration.internal_app_server_host,
        :environment     => configuration.rails_env.dup,
        :server_root     => configuration.server_root,
        :server_type     => WEBrick::SimpleServer,
        :charset         => "UTF-8",
        :mime_types      => WEBrick::HTTPUtils::DefaultMimeTypes,
        :working_directory => File.expand_path(configuration.rails_root.to_s)
      }
      server.mount('/', DispatchServlet, mount_parameters)

      trap("INT") { stop_server }

      require File.expand_path("#{configuration.rails_root}/config/environment")
      require "dispatcher"
      server.start
    end

    def stop_server
      server.shutdown if server
    end

    def create_webrick_server #:nodoc:
      WEBrick::HTTPServer.new({
        :Port => configuration.internal_app_server_port,
        :BindAddress => configuration.internal_app_server_host,
        :ServerType  => WEBrick::SimpleServer,
        :MimeTypes => WEBrick::HTTPUtils::DefaultMimeTypes,
        :Logger => configuration.new_logger,
        :AccessLog => []
      })
    end
  end
  end
end<commit_msg>Reformatting.<commit_after>module Polonium
  module ServerRunners
    class WebrickServerRunner < ServerRunner
      attr_accessor :server

      def initialize(configuration)
        require 'webrick_server'
        super
      end

      protected
      def start_server
        @server = create_webrick_server
        mount_parameters = {
          :port            => configuration.internal_app_server_port,
          :ip              => configuration.internal_app_server_host,
          :environment     => configuration.rails_env.dup,
          :server_root     => configuration.server_root,
          :server_type     => WEBrick::SimpleServer,
          :charset         => "UTF-8",
          :mime_types      => WEBrick::HTTPUtils::DefaultMimeTypes,
          :working_directory => File.expand_path(configuration.rails_root.to_s)
        }
        server.mount('/', DispatchServlet, mount_parameters)

        trap("INT") { stop_server }

        require File.expand_path("#{configuration.rails_root}/config/environment")
        require "dispatcher"
        server.start
      end

      def stop_server
        server.shutdown if server
      end

      def create_webrick_server #:nodoc:
        WEBrick::HTTPServer.new({
          :Port => configuration.internal_app_server_port,
          :BindAddress => configuration.internal_app_server_host,
          :ServerType  => WEBrick::SimpleServer,
          :MimeTypes => WEBrick::HTTPUtils::DefaultMimeTypes,
          :Logger => configuration.new_logger,
          :AccessLog => []
        })
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.08911211924821776, 'fraction_numerical': 0.0006480881399870382, 'mean_word_length': 2.4223946784922394, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, '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': '7553243', 'n_tokens_mistral': 865, 'n_tokens_neox': 848, 'n_words': 145}