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

===<br>
4. Renaming camping-unabridged.rb to camping.rb?<br>
===<br>
<br>
I haven&#39;t touched camping.rb at all, do we really need to prove that it&#39;s a<br>
micro-framework? It just makes development/releasing harder. Let&#39;s just forget<br>
about the abridged version and rename camping-unabridged.rb to camping.rb!<br>
</blockquote><div><br>Perlvert that I am, I respected the 4KB obfuscation.&nbsp; (Maybe that&#39;s just me.&nbsp; ;-)<br>&nbsp;</div><br></div>