Sha256: 0d904e4353dda912d5e4c06c8b163178eb34920a6fb04295aeb2e2175062ce8f

Contents?: true

Size: 955 Bytes

Versions: 2

Compression:

Stored size: 955 Bytes

Contents

#!/usr/local/bin/ruby
# require File.join(File.dirname(__FILE__), "options_handler")

require File.join(File.dirname(__FILE__), "env_handler")

require File.join(File.dirname(__FILE__), "gem_load_path")

require 'rubygems'

require 'fileutils'
require 'thin'

require 'mack'

handler = "thin"

if ARGV.include?("-h")
  handler = ARGV[ARGV.index("-h") + 1]
  ARGV.delete("-h")
  ARGV.delete(handler)
end

if handler == "thin"
  # thin_opts = ["start", ARGV]
  thin_opts = []
  if ARGV[0] == "start" || ARGV[0] == "stop" || ARGV[0] == "restart"
    thin_opts << ARGV[0]
    ARGV.shift
  else
    thin_opts << "start"
  end
  thin_opts << ARGV
  # puts "thin_opts: #{thin_opts.flatten.inspect}"
  Thin::Runner.new(thin_opts.flatten.reject{|a| a.match(/^_[\d\.]+_$/)}).run!
else
  port = 3000
  if ARGV.include?("-p")
    port = ARGV[ARGV.index("-p") + 1]
  end
  Mack::SimpleServer.run(:handler => handler, :port => port, :environment => ENV["MACK_ENV"])
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mack-0.7.1.1 bin/mackery-server
mack-0.7.1 bin/mackery-server