Sha256: 3bbcf9fd7851fc9402dcc1e9c21491dfee6066cf94fd3d2eff62647ef5267e95
Contents?: true
Size: 1.24 KB
Versions: 47
Compression:
Stored size: 1.24 KB
Contents
#!/usr/bin/env ruby # == Synopsis # # pubnow: run the event publisher # # == Usage # # pubnow [OPTION] KEY # # -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 # # KEY: the name of the publisher to run. For example # to run the sample publisher use 'sample' require 'getoptlong' require 'rdoc/usage' require File.dirname(__FILE__) + '/../lib/refinery' 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 ] ) 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 end end if ARGV.length != 1 puts "Missing key argument (try --help)" exit 0 end Refinery::EventPublisher.new(options).run_once(ARGV.shift)
Version data entries
47 entries across 47 versions & 2 rubygems