Sha256: 5d0107faa98b3c58477e6e5409e3b277b07ae7059e99eac0a014c9d1d3e56dd5

Contents?: true

Size: 792 Bytes

Versions: 6

Compression:

Stored size: 792 Bytes

Contents

#!/usr/bin/env ruby

require 'baton/<%= config[:name] %>'
require 'optparse'

cfg = File.expand_path("../../config/<%= config[:name] %>.cfg", __FILE__)
daemonize = false

OptionParser.new do |opt|
  opt.banner = "Usage: <%= config[:name] %> [OPTIONS]"
  opt.separator ""
  opt.separator "Specific options:"
  opt.on("-c","--config-file [PATH]", "Path to a baton config file") do |o|
    cfg = o
  end
  opt.on("-d","--daemonize", "Should baton daemonize") do |o|
    daemonize = o
  end
  opt.on_tail("-h", "--help", "Show this message") do
    puts opt
    exit
  end
end.parse!

Baton.configure do |c|
  c.config_path  = cfg
  c.exchange     = "<%= config[:name] %>_in"
  c.exchange_out = "<%= config[:name] %>_out"
end

Baton::<%= config[:constant_array].last %>Service.new(daemonize).run

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
baton-0.7.0 lib/baton/templates/gem/bin/gem.tt
baton-0.6.0 lib/baton/templates/gem/bin/gem.tt
baton-0.5.6 lib/baton/templates/gem/bin/gem.tt
baton-0.5.5 lib/baton/templates/gem/bin/gem.tt
baton-0.5.4 lib/baton/templates/gem/bin/gem.tt
baton-0.5.2 lib/baton/templates/gem/bin/gem.tt