The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Day Camp at Mongrel National Park

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Red Handed

Posts: 1158
Nickname: redhanded
Registered: Dec, 2004

Red Handed is a Ruby-focused group blog.
Day Camp at Mongrel National Park Posted: Jan 30, 2006 2:17 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Red Handed.
Original Post: Day Camp at Mongrel National Park
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Red Handed
Latest Posts From RedHanded

Advertisement

Zed and I worked over the weekend on smoothing out the divide between Camping (the 4k web framework) and Mongrel (the slim new Ruby web server mentioned last week.) In just a few days, Mongrel has caught the scent and is totally Campnivorous. Development gems await you.

 gem install mongrel camping --source code.whytheluckystiff.net

The Mongrel gem requires a build environment, there are no OSX or Windows binaries yet. You will find two examples in Mongrel’s examples/camping directory. Tepee is a dead-simple versioning wiki which requires the acts_as_versioned gem.

Here’s the relevant handler which is executed with CampingHandler.new(Tepee), if the app is contained in the module Tepee.

 class CampingHandler < Mongrel::HttpHandler
   def initialize(klass)
     @klass = klass
   end
   def process(request, response)
     body = StringIO.new(request.body)
     controller = @klass.run(body, request.params)
     response.start(controller.status) do |head, out|
       controller.headers.each do |k, v|
         [*v].each do |vi|
           head[k] = vi
         end
       end
       out << controller.body
     end
   end
 end

You can then mount these handlers quite readily. Zed’s moving along with handsome stride, so if you’ve got a machine to build this on, do not delay.

Read: Day Camp at Mongrel National Park

Topic: Injecting a Hash Backwards and the Merge Block Previous Topic   Next Topic Topic: Off

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use