Class: Gitrob::CLI::Commands::Server

Inherits:
Gitrob::CLI::Command show all
Defined in:
lib/gitrob/cli/commands/server.rb

Instance Attribute Summary

Attributes inherited from Gitrob::CLI::Command

#options

Instance Method Summary collapse

Methods inherited from Gitrob::CLI::Command

#debug, #debugging_enabled?, #error, #fatal, #info, #output, #progress_bar, start, #task, #thread_pool, #warn

Constructor Details

#initialize(options) ⇒ Server

Returns a new instance of Server.



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/gitrob/cli/commands/server.rb', line 5

def initialize(options)
  @options = options
  info "Starting web application on port #{options[:port]}..."

  if debugging_enabled?
    Sequel::Model.db.logger = QueryLogger.new(STDOUT)
  end

  Gitrob::WebApp.run!(
    :port => options[:port].to_i,
    :bind => options[:bind_address]
  )
end