Sha256: 07bfed4e8e3b339595d4805d3f240b41bf6e6804dd02bbddd1b231c9734bf763
Contents?: true
Size: 1.12 KB
Versions: 5
Compression:
Stored size: 1.12 KB
Contents
namespace :mack do namespace :server do desc "Starts the webserver." task :start do |t| require 'rubygems' require 'optparse' require 'optparse/time' require 'ostruct' require 'fileutils' d_handler = "WEBrick" begin require 'mongrel' d_handler = "mongrel" rescue Exception => e end begin require 'thin' d_handler = "thin" rescue Exception => e end MACK_ROOT = FileUtils.pwd unless Object.const_defined?("MACK_ROOT") options = OpenStruct.new options.port = (ENV["PORT"] ||= "3000") # Does NOT work with Thin!! You must edit the thin.yml file! options.handler = (ENV["HANDLER"] ||= d_handler) require File.join(MACK_ROOT, "config", "boot.rb") if options.handler == "thin" # thin_opts = ["start", "-r", "config/thin.ru"] thin_opts = ["start", "-C", "config/thin.yml"] Thin::Runner.new(thin_opts.flatten).run! else Mack::SimpleServer.run(options) end end # start end # server end # mack alias_task :server, "log:clear", "mack:server:start"
Version data entries
5 entries across 5 versions & 1 rubygems