Sha256: 7e8df798ebb4327eb008393324b24d0bef0035df54aa2302f148d28e2a41b218

Contents?: true

Size: 1.57 KB

Versions: 10

Compression:

Stored size: 1.57 KB

Contents

#!/usr/bin/env ruby

lib = File.expand_path("../../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

require 'fake_sqs'
require 'optparse'

options = {
  :port => 4568,
  :host => "0.0.0.0",
  :verbose => false,
  :daemonize => false,
  :database => ":memory:"
}

parser = OptionParser.new do |o|

  o.on "--database DATABASE", "Where to store the database (default: #{options[:database]})" do |database|
    options[:database] = database
  end

  o.on "-p", "--port PORT", Integer, "Port to use (default: #{options[:port]})" do |port|
    options[:port] = port
  end

  o.on "-o", "--bind HOST", "Host to bind to (default: #{options[:host]})" do |host|
    options[:host] = host
  end

  o.on "-s", "--server SERVER", ['thin', 'mongrel', 'webrick'], "Server to use: thin, mongrel or webrick (by default Sinatra chooses the best available)" do |server|
    options[:server] = server
  end

  o.on "-P", "--pid PIDFILE", "Where to write the pid" do |pid|
    options[:pid] = pid
  end

  o.on "-d", "--[no-]daemonize", "Detaches the process" do |daemonize|
    options[:daemonize] = daemonize
  end

  o.on "-v", "--[no-]verbose", "Shows input parameters and output XML" do |verbose|
    options[:verbose] = verbose
  end

  o.on "--log FILE", "Redirect output to this logfile (default: console)" do |logfile|
    options[:log] = logfile
  end

  o.on_tail "--version", "Shows the version" do
    puts "fake_sqs version #{FakeSQS::VERSION}"
    exit
  end

  o.on_tail "-h", "--help", "Shows this help page" do
    puts o
    exit
  end

end

parser.parse!

FakeSQS.to_rack(options).run!

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
fake_sqs-0.4.3 bin/fake_sqs
fake_sqs-0.4.2 bin/fake_sqs
fake_sqs-0.4.1 bin/fake_sqs
fake_sqs-0.4.0 bin/fake_sqs
fake_sqs-0.3.1 bin/fake_sqs
fake_sqs-0.3.0 bin/fake_sqs
fake_sqs-0.2.0 bin/fake_sqs
fake_sqs-0.1.0 bin/fake_sqs
fake_sqs-0.0.11 bin/fake_sqs
fake_sqs-0.0.10 bin/fake_sqs