Sha256: 9b979f92135a10564c4b63d96099a4abae4fe13a707fc426a8dbafd8e0a48c01

Contents?: true

Size: 918 Bytes

Versions: 1

Compression:

Stored size: 918 Bytes

Contents

require "rubygems"
require 'gorgon/originator'
require 'gorgon/listener'
require 'gorgon/worker_manager'
require 'gorgon/version'

WELCOME_MSG = "Welcome to Gorgon #{Gorgon::VERSION}"

def start
  o = Originator.new
  o.originate
end

def listen
  l = Listener.new
  l.listen
end

def manage_workers
  config_path = ENV["GORGON_CONFIG_PATH"]

  manager = WorkerManager.build config_path
  manager.manage

  # For some reason I have to 'exit' here, otherwise WorkerManager process crashes
  exit
end

def usage
  #print instructions on how to use gorgon
  puts "\tstart - remotely runs all tests specified in gorgon.json"
  puts "\tlisten - starts a listener process using the settings in gorgon_listener.json"
end

puts WELCOME_MSG

case ARGV[0]
when nil
  start
when "start"
  start
when "listen"
  listen
when "manage_workers"
  manage_workers
when "help"
  usage
else
  puts "Unknown command!"
  usage
  exit 1
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gorgon-0.1.1 bin/gorgon