Sha256: e23e476d748b267242fb808ec2e4010451359798dfe303c2bd3e925115fe7056
Contents?: true
Size: 1.21 KB
Versions: 7
Compression:
Stored size: 1.21 KB
Contents
#!/usr/bin/env ruby # == Synopsis # # epub: run the event publisher # # == Usage # # epub [OPTION] # # -h, --help: # show help # # -d, --debug: # turn on debug logging # # -c, --config filename # specify a configuration file # # -p, --publishers directory # specify the directory for finding publishers # # -v, --verbose # print info to the standard output require 'getoptlong' require 'rdoc/usage' require File.dirname(__FILE__) + '/../lib/refinery' pidfile = 'epub.pid' options = {} opts = GetoptLong.new( [ '--help', '-h', GetoptLong::NO_ARGUMENT ], [ '--debug', '-d', GetoptLong::NO_ARGUMENT ], [ '--config', '-c', GetoptLong::REQUIRED_ARGUMENT], [ '--publishers', '-p', GetoptLong::REQUIRED_ARGUMENT], [ '--verbose', '-v', GetoptLong::NO_ARGUMENT], [ '--pidfile', GetoptLong::REQUIRED_ARGUMENT] ) opts.each do |opt, arg| case opt when '--help' RDoc::usage when '--debug' options[:debug] = true when '--config' options[:config] = arg when '--publishers' options[:publishers] = arg when '--verbose' options[:verbose] = true when '--pidfile' pidfile = arg end end open(pidfile, 'w') do |f| f << $$ end Refinery::EventPublisher.new(options).run File.delete(pidfile)
Version data entries
7 entries across 7 versions & 2 rubygems