Impressive work. On Wed, May 21, 2008 at 12:26 PM, Magnus Holm <[EMAIL PROTECTED]> wrote:
> === > 1. Camping on Rack > === > > I've just finished rewriting Camping to use Rack in the "core". I got rid > of > (a little less) than 1kB in camping.rb and removed lots of un-necessary > files > (lib/server/*.rb, fastcgi.rb & mongrel.rb). > > bin/camping does now only provide WEBrick, Mongrel and console-support and > should only be used in development. It uses Rack::ShowExceptions to catch > error outside the app and I've also written a middleware for faking > X-Sendfile. For production you should create a rackup-file or setup Rack in > some other way: > > #!/usr/bin/env rackup > # Auto-detects CGI & FastCGI > # Start mongrel with: ./blog.ru -s mongrel -p 3301 > require 'blog' > Blog.create > run Blog > > Some notes: > * Branch: http://github.com/judofyr/camping/commits/rack > * You have to rename camping-unabridged.rb to camping.rb in order to run > apps. > * You're app is also a Rack-app (aka respond_to?(:call)) > * I'm using Rack::Request (@request) and Rack::Response (@response) > * Status, headers and body must be set using @status, @headers and @body, > not @response.status, @response.headers or @response.body > * @headers is a Rack::Utils::HeaderHash > * @root, @input and @cookies behaves equally; @env is gone > * You can delete cookies with @response.delete_cookie("key") > * Set cookies with @cookies.key = ":)" or @response.set_cookie("key", ":)") > * You can also pass a Hash when you're setting cookies: > @cookes.key = {:value => ":)", :expires => Time.now + 3600, :path => > '/app'} > * I've removed #qsp, #un and #escape. Use Rack::Utils instead > * This should close #104, #130 and #153 > These API changes sound reasonable to me. > > === > 2. ORM-agnostic? > === > > What about making Camping ORM-agnostic? If it's only AR which requires > glue, > we can just rename camping/db.rb to camping/ar.rb - if not we have to add > camping/og.rb, camping/dm.rb, camping/sequel.rb etc too. > Fine w/ me. > > === > 3. Cookie Sessions as default > === > > What do you think about using Cookie Sessions instead of database-based by > default (in camping/sessions.rb)? It's much lighter and makes it simpler to > create apps without database. It also helps making Camping ORM-agnostic. > > I've fixed this in the cookie_session-branch (requires Rack) available at > http://github.com/judofyr/camping/commits/cookie_session (highly based on > Jenna's work) > As long as you organize the code such that it's easy to switch between session storage schemes, I think this is fine. === > 4. Renaming camping-unabridged.rb to camping.rb? > === > > I haven't touched camping.rb at all, do we really need to prove that it's a > micro-framework? It just makes development/releasing harder. Let's just > forget > about the abridged version and rename camping-unabridged.rb to camping.rb! > Perlvert that I am, I respected the 4KB obfuscation. (Maybe that's just me. ;-)
_______________________________________________ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list