Sha256: 269e10014d024de0423d05ea67e9a808de453c0131e0c2c0c954e088a942db34

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

module Middleman
  class PreviewServer
    # This class wraps server information to be used in call back
    #
    # * listeners
    # * port
    # * server name
    # * site_addresses
    #
    # All information is "dupped" and the callback is not meant to be used to
    # modify these information.
    class ServerInformationCallbackProxy
      attr_reader :server_name, :port, :site_addresses, :listeners

      def initialize(server_information)
        @listeners   = ServerUrl.new(
          hosts: server_information.listeners,
          port: server_information.port, 
          https: server_information.https?,
          format_output: false
        ).to_bind_addresses

        @port           = server_information.port
        @server_name    = server_information.server_name.dup unless server_information.server_name == nil

        @site_addresses = ServerUrl.new(
          hosts: server_information.site_addresses,
          port: server_information.port,
          https: server_information.https?,
          format_output: false
        ).to_urls
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
middleman-core-3.4.1 lib/middleman-core/preview_server/server_information_callback_proxy.rb