Sha256: 793f55718d73db2cc4913299df4a1f9da2d718e6027d77896d36dabb05164cbd
Contents?: true
Size: 1.21 KB
Versions: 3
Compression:
Stored size: 1.21 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 '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
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
refinery-0.12.2 | bin/pubnow |
refinery-0.12.1 | bin/pubnow |
refinery-0.12.0 | bin/pubnow |