Sha256: e1511e41de181e836f7d929d92f73477fdf83e7f31f3dda7649e1b67f89ed7ce

Contents?: true

Size: 915 Bytes

Versions: 1

Compression:

Stored size: 915 Bytes

Contents

#!/usr/bin/env ruby

require 'rack/amqp'
require 'optparse'

options = {
  rabbitmq: 'localhost',
  queue_name: 'default.queue',
  debug: false,
}

OptionParser.new do |opts|
  cmd = File.basename($0)
  opts.banner = "Usage: #{cmd} [options] <rackup file>"

  opts.on("-rHOST", "--rabbitmq HOST", "hostname of the rabbitmq server") do |host|
    options[:rabbitmq] = host
  end

  opts.on("-qQUEUE", "--queue QUEUE", "queue name that this app subscribes to") do |queue|
    options[:queue_name] = queue
  end

  opts.on("-d", "--debug", "turn on some debugging messages") do
    options[:debug] = true
  end

  opts.on_tail("-h", "--help", "Show this message") do
    puts opts.to_s
    exit
  end

  opts.on_tail("-v", "--version", "Show version") do
    puts "#{cmd} v#{Rack::AMQP::VERSION}"
    exit
  end

  opts.parse! ARGV
end

Rack::AMQP::Server.start options.merge(rackup_file: File.absolute_path(ARGV[0]))

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jackalope-0.0.1 bin/jackalope