Sha256: b44f59221f3faa80af6f62bea0a7e2751796f7f6bb71da7e9e26585dfd4de026

Contents?: true

Size: 1.29 KB

Versions: 4

Compression:

Stored size: 1.29 KB

Contents

#!/usr/bin/env ruby
$:.unshift File.expand_path(File.join(File.dirname(__FILE__), %w[.. lib]))
require "eye/loader"
require "optparse"
require "eye/patch"

options = {:debug => true}

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::Local.ensure_eye_dir

socket_path = options[:socket_path] || Eye::Local.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?

if config
  res = server.command('load', config)
  exit if res.values.any? { |r| r[:error] }
end

Eye::Control.set_proc_line

server.async.run

trap("INT"){ exit }
trap("USR1"){ Eye::Logger.reopen }
trap("USR2"){ GC.start }

sleep

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
eye-patch-0.0.5 bin/eye-patch-loader
eye-patch-0.0.4 bin/eye-patch-loader
eye-patch-0.0.3 bin/eye-patch-loader
eye-patch-0.0.2 bin/eye-patch-loader