1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
puma--puma/examples/builder.rb
zedshaw f4a5c938d4 First crack at some advanced debugging features for mongrel and the console.
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@121 19e92222-5c0b-0410-8929-a290d50e31e9
2006-03-25 21:15:30 +00:00

29 lines
750 B
Ruby

require 'mongrel'
class TestPlugin < GemPlugin::Plugin "/handlers"
include Mongrel::HttpHandlerPlugin
def process(request, response)
STDERR.puts "My options are: #{options.inspect}"
STDERR.puts "Request Was:"
STDERR.puts request.params.to_yaml
end
end
config = Mongrel::Configurator.new :host => "127.0.0.1" do
load_plugins :includes => ["mongrel"], :excludes => ["rails"]
daemonize :cwd => Dir.pwd, :log_file => "mongrel.log", :pid_file => "mongrel.pid"
listener :port => 3000 do
uri "/app", :handler => plugin("/handlers/testplugin", :test => "that")
uri "/app", :handler => Mongrel::DirHandler.new(".")
load_plugins :includes => ["mongrel", "rails"]
end
trap("INT") { stop }
run
end
config.join