class Backdat::Application::Server

The backdat server command line parser.

Public Class Methods

new() click to toggle source

Grabs all of the cli parameters and generates the mixlib config object.

Calls superclass method Backdat::Application::new
# File lib/backdat/application/backdat-server.rb, line 95
def initialize
  super
  Backdat::Config.merge!(config)
end

Public Instance Methods

run_application() click to toggle source

Runs the backdat server.

# File lib/backdat/application/backdat-server.rb, line 112
def run_application
  if Backdat::Config[:daemonize]
    Backdat::Config[:server] = true
    Backdat::Daemon.daemonize("backdat")
  end
  @app.run
end
setup_application() click to toggle source

Configures the backdat server based on the cli parameters.

# File lib/backdat/application/backdat-server.rb, line 101
def setup_application
  Backdat::Daemon.change_privilege
  Backdat::Config[:server] = true if Backdat::Config[:daemonize]
  if Backdat::Config[:server]
    @app = Backdat::Server.new
  else
    @app = Backdat::Client.new(*ARGV)
  end
end