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

Version Path
aeden-refinery-0.10.0 bin/pubnow
aeden-refinery-0.10.1 bin/pubnow
aeden-refinery-0.10.10 bin/pubnow
aeden-refinery-0.10.2 bin/pubnow
aeden-refinery-0.10.3 bin/pubnow
aeden-refinery-0.10.5 bin/pubnow
aeden-refinery-0.10.6 bin/pubnow
aeden-refinery-0.10.8 bin/pubnow
aeden-refinery-0.9.10 bin/pubnow
aeden-refinery-0.9.11 bin/pubnow
aeden-refinery-0.9.12 bin/pubnow
aeden-refinery-0.9.13 bin/pubnow
aeden-refinery-0.9.14 bin/pubnow
aeden-refinery-0.9.15 bin/pubnow
aeden-refinery-0.9.2 bin/pubnow
aeden-refinery-0.9.4 bin/pubnow
aeden-refinery-0.9.5 bin/pubnow
aeden-refinery-0.9.6 bin/pubnow
aeden-refinery-0.9.7 bin/pubnow
aeden-refinery-0.9.8 bin/pubnow