<commit_before>require "webrick"
require 'middleman-core/meta_pages'

module Middleman
  module PreviewServer

    DEFAULT_PORT = 4567

    class << self
      attr_reader :app, :host, :port
      delegate :logger, :to => :app

      # Start an instance of Middleman::Application
      # @return [void]
      def start(opts={})
        @options = opts
        @host = @options[:host] || Socket.gethostname
        @port = @options[:port] || DEFAULT_PORT

        mount_instance
        logger.info "== The Middleman is standing watch at http://#{host}:#{port}"

        @initialized ||= false
        unless @initialized
          @initialized = true

          register_signal_handlers

          # Save the last-used @options so it may be re-used when
          # reloading later on.
          ::Middleman::Profiling.report("server_start")

          @webrick.start

          # $mm_shutdown is set by the signal handler
          if $mm_shutdown
            shutdown
            exit
          end
        end
      end<commit_msg>Advertise meta pages on startup<commit_after>require "webrick"
require 'middleman-core/meta_pages'

module Middleman
  module PreviewServer

    DEFAULT_PORT = 4567

    class << self
      attr_reader :app, :host, :port
      delegate :logger, :to => :app

      # Start an instance of Middleman::Application
      # @return [void]
      def start(opts={})
        @options = opts
        @host = @options[:host] || Socket.gethostname
        @port = @options[:port] || DEFAULT_PORT

        mount_instance
        logger.info "== The Middleman is standing watch at http://#{host}:#{port}"
        logger.info "== Inspect your site configuration at http://#{host}:#{port}/__middleman/"

        @initialized ||= false
        unless @initialized
          @initialized = true

          register_signal_handlers

          # Save the last-used @options so it may be re-used when
          # reloading later on.
          ::Middleman::Profiling.report("server_start")

          @webrick.start

          # $mm_shutdown is set by the signal handler
          if $mm_shutdown
            shutdown
            exit
          end
        end
      end
{'fraction_non_alphanumeric': 0.09578368469294225, 'fraction_numerical': 0.0036663611365719525, 'mean_word_length': 2.074647887323944, 'pattern_counts': {'":': 0, '<': 7, '<?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': '929947', 'n_tokens_mistral': 614, 'n_tokens_neox': 597, 'n_words': 174}