class ActiveHook::Server::Launcher

Handles the start of the ActiveHook server via command line

Public Class Methods

new(argv) click to toggle source
# File lib/activehook/server/launcher.rb, line 6
def initialize(argv)
  @argv = argv
end

Public Instance Methods

start() click to toggle source

Parses commmand line options and starts the Manager object

# File lib/activehook/server/launcher.rb, line 12
def start
  start_message
  setup_options
  boot_manager
end

Private Instance Methods

boot_manager() click to toggle source
# File lib/activehook/server/launcher.rb, line 41
def boot_manager
  manager = ActiveHook::Server::Manager.new(ActiveHook.config.manager_options)
  manager.start
end
setup_options() click to toggle source

Parses the arguments passed through the command line.

# File lib/activehook/server/launcher.rb, line 27
def setup_options
  parser = OptionParser.new do |o|
    o.banner = 'Usage: bundle exec bin/activehook [options]'

    o.on('-c', '--config PATH', 'Load PATH for config file') do |arg|
      load(arg)
      ActiveHook.log.info("* Server config:  #{arg}")
    end

    o.on('-h', '--help', 'Prints this help') { puts o && exit }
  end
  parser.parse!(@argv)
end
start_message() click to toggle source
# File lib/activehook/server/launcher.rb, line 20
def start_message
  ActiveHook.log.info('ActiveHook Server starting!')
  ActiveHook.log.info("* Version #{VERSION}, codename: #{CODENAME}")
end