module Pakyow
  module Commands
    class Server
      attr_reader :environment, :port

      def initialize(environment: :development, port:)
        @environment = environment
        @port = port
      end

      def run
        load_app
        Pakyow::Config.server.port = port
        Pakyow::App.run(environment)
      end

      private

      def load_app
        $LOAD_PATH.unshift(Dir.pwd)
        require 'app/setup'
      end
    end
  end
end

module Pakyow
  module Commands
    class Server
      attr_reader :environment, :port

      def initialize(environment: :development, port: 3000)
        @environment = environment
        @port = port
      end

      def run
        load_app
        Pakyow::Config.server.port = port
        Pakyow::App.run(environment)
      end

      private

      def load_app
        $LOAD_PATH.unshift(Dir.pwd)
        require 'app/setup'
      end
    end
  end
end

Fix sneaky ruby 2.0 incompatibility
Fix sneaky ruby 2.0 incompatibility

* Ruby 2.0 doesn't support required kwargs. This wasn't caught
  previously because the file was not being loaded. This reinforces the
  need for #130.
