Camping 2.1: Rackification
ruby at monnet-usa.com
Mon Apr 12 20:18:11 EDT 2010
#1 seems to make sense. I personally tend to use rackup anyway.
#2 seems ok.
#3 agreed with the dangerous override - how about http_method_missing
On 4/12/2010 8:32 AM, Magnus Holm wrote:
> Rackification - http://github.com/camping/camping/issues#issue/3
> I want to make Camping even more Rack-ish. Some ideas:
> 1. Make Camping::Server use Rack::Server
> 2. The dispatcher shouldn't care about the method
> Previously the dispatcher (Controllers.D) has taken a path and a
> method, and returns an array with the controller and the method:
> D("/", "get") # => [Index, 'get']
> D("/", "post") # => [I, 'r501'] # no post-method in Index
> D("/not_found", "get") # => [I, 'r404']
> I want to make it such that the dispatcher only cares about the path,
> and then the controllers are responsible for calling the right method.
> I feel that is more HTTP-ish: First look up the resource, then try to
> call the method.
> 3. When the method isn't found, call #method_missing
> Okay, this one is kinda dangerous, but it would be cool if Camping
> would call #method_missing if the method doesn't exist. That way,
> Camping almost becomes the Ruby-version of HTTP. Too dangerous (aka.
> it would swallow regular NoMethorError) or possible?
> // Magnus Holm
> Camping-list mailing list
> Camping-list at rubyforge.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Camping-list