#!/usr/bin/env ruby $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib') begin require 'vegas' rescue LoadError require 'rubygems' require 'vegas' end require 'resque_admin/server' Vegas::Runner.new(ResqueAdmin::Server, 'resque-admin-web', { :before_run => lambda {|v| path = (ENV['RESQUECONFIG'] || v.args.first) load path.to_s.strip if path } }) do |runner, opts, app| opts.on('-N NAMESPACE', "--namespace NAMESPACE", "set the Redis namespace") {|namespace| runner.logger.info "Using Redis namespace '#{namespace}'" ResqueAdmin.redis.namespace = namespace } opts.on('-r redis-connection', "--redis redis-connection", "set the Redis connection string") {|redis_conf| runner.logger.info "Using Redis connection '#{redis_conf}'" ResqueAdmin.redis = redis_conf } opts.on('-a url-prefix', "--append url-prefix", "set reverse_proxy friendly prefix to links") {|url_prefix| runner.logger.info "Using URL Prefix '#{url_prefix}'" ResqueAdmin::Server.url_prefix = url_prefix } end