Sha256: e331b208829697cec8222dd888b27d283e351691a333cb106d8bac1c7a7dff61

Contents?: true

Size: 836 Bytes

Versions: 1

Compression:

Stored size: 836 Bytes

Contents

# frozen_string_literal: true

require "rack/handler/puma"

module ActionDispatch
  module SystemTesting
    class Server # :nodoc:
      class << self
        attr_accessor :silence_puma
      end

      self.silence_puma = false

      def run
        register
        setup
      end

      private
        def register
          Capybara.register_server :quails_puma do |app, port, host|
            Rack::Handler::Puma.run(
              app,
              Port: port,
              Threads: "0:1",
              Silent: self.class.silence_puma
            )
          end
        end

        def setup
          set_server
          set_port
        end

        def set_server
          Capybara.server = :quails_puma
        end

        def set_port
          Capybara.always_include_port = true
        end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby-on-quails-0.1.0 actionpack/lib/action_dispatch/system_testing/server.rb