1 #!/usr/bin/env ruby -wKU
11 r.match('/').to(:action => 'foo', :random => 'arbitrary')
12 r.match('/hello/:name').to(:action => 'greeter')
17 @route = env['merb.route'].dup
18 send(@route.delete(:action).to_sym, @route)
22 [200, {'Content-Type'=>'text/plain'}, @route.inspect]
26 [200, {'Content-Type'=>'text/plain'}, "Hello #{params[:name]}"]
30 [404, {'Content-Type'=>'text/plain'}, 'Not Found']
35 Rack::Handler::Mongrel.run Rack::MRouter.new(Rap.new), :Port => 4400 if $0 == __FILE__