Sha256: f8e642ed225018686f9237004ca6fa2b0d763d6f0feaed7c48511347860a36cb

Contents?: true

Size: 1.24 KB

Versions: 3

Compression:

Stored size: 1.24 KB

Contents

#!/usr/bin/env ruby

# == Synopsis
#
# epub: 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

3 entries across 3 versions & 2 rubygems

Version Path
aeden-refinery-0.9.0 bin/pubnow
aeden-refinery-0.9.1 bin/pubnow
refinery-0.9.0 bin/pubnow