Sha256: 4199ac2f0c1561125e5b7ea9cc21afd652398417e907226bc89af1e449abec21
Contents?: true
Size: 1.26 KB
Versions: 10
Compression:
Stored size: 1.26 KB
Contents
#!/usr/bin/env ruby $:.unshift File.expand_path(File.join(File.dirname(__FILE__), %w[.. lib])) require 'eye/loader' require 'optparse' require 'eye' options = {:debug => false} OptionParser.new do |opts| opts.on( '-h', '--help', 'Display this screen' ) do puts opts exit end opts.on( '-c', '--config CONFIG', 'load with config' ) do |config_path| options[:config] = config_path end opts.on( '-s', '--socket SOCKET', 'start listen on socket' ) do |socket_path| options[:socket_path] = socket_path end opts.on( '-l', '--logger LOGGER', 'custom logger' ) do |logger| options[:logger] = logger end opts.on( '-d', '--debug', 'debug info to logger' ) do options[:debug] = true end end.parse! Eye::Settings.ensure_eye_dir socket_path = options[:socket_path] || Eye::Settings.socket_path server = Eye::Server.new(socket_path) Eye::Logger.log_level = options[:debug] ? Logger::DEBUG : Logger::INFO Eye::Logger.link_logger(options[:logger]) if options[:logger] config = options[:config] config = File.expand_path(config) if config && !config.empty? Eye::Control # preload if config res = server.command('load', config) exit if res[:error] end Eye::Control.set_proc_line server.async.run trap("INT"){ exit } trap("USR2"){ GC.start } sleep
Version data entries
10 entries across 10 versions & 2 rubygems