Sha256: 71f1d47fe35236e0fb4ecf09fe0c6aa537735b412d0948b4ce2b414c4dd546df

Contents?: true

Size: 1.02 KB

Versions: 5

Compression:

Stored size: 1.02 KB

Contents

#!/usr/bin/env ruby

require 'optparse'
require 'profit'

options = {}
OptionParser.new { |opts|
  opts.banner = "Usage: profit_server [options]"

  opts.on("-r", "--redis-address [STRING]", String,
          "Redis Address (default: 127.0.0.1:6379)") do |ra|
    options[:redis_address] = ra.split(":").first
    options[:redis_port]    = ra.split(":").last.to_i
  end

  opts.on("-z", "--zmq-address [STRING]", String,
          "ZMQ Address (default: tcp://*:5556)") do |za|
    options[:zmq_address] = za
  end

  opts.on("-n", "--pool-size [DECIMAL]", OptionParser::DecimalInteger,
          "Redis client pool size (default: 10)") do |n|
    options[:pool_size] = n
  end

  opts.on("-l", "--log-file-path [STRING]", String,
          "Log file (default: STDOUT)") do |log|
    options[:log_path] = log
  end

  opts.on("-v", "--log-level [LOGLEVEL]", [:error, :warn, :info, :debug],
    "Log level (default: error), error|warn|info|debug") do |log_level|
    options[:log_level] = log_level
  end
}.parse!

Profit::Server.new(options).run

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
profit-0.1.7 bin/profit_server
profit-0.1.6 bin/profit_server
profit-0.1.5 bin/profit_server
profit-0.1.4 bin/profit_server
profit-0.1.3 bin/profit_server