Sha256: 986a778b3a64489f3526162145b928fc2209ea1925bc461cec4c97bfb98c52ee
Contents?: true
Size: 1.15 KB
Versions: 3
Compression:
Stored size: 1.15 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") require 'mack' 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
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
mack-0.4.5 | lib/tasks/mack_server_tasks.rake |
mack-0.4.6 | lib/tasks/mack_server_tasks.rake |
mack-0.4.7 | lib/tasks/mack_server_tasks.rake |