Class: ServerCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/commands/server_command.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ ServerCommand

Returns a new instance of ServerCommand.



2
3
4
# File 'lib/commands/server_command.rb', line 2

def initialize(options)
  @options = options
end

Instance Method Details

#runObject



6
7
8
9
10
11
12
13
# File 'lib/commands/server_command.rb', line 6

def run
  ENV["RACK_ENV"] = "production"
  require "server/server_app"
  Rack::Handler::WEBrick.run(
    Sinatra::Application,
    :Port => @options[:server_port],
  )
end