Manfred Stienstra | 21 Jan 14:45 2009
Picon

EAST FORK GROUP CAMP USE AGREEMENT

Hi,

I've been noticing some disturbance in #camping lately, and I would  
like to remind everyone about the Group Camp Agreement.

   http://dnr.wi.gov/forestry/stateforests/SF-BlackRiver/pdf/BlackRiver-GroupCampAgreement.pdf

Please study it carefully. Also, point 2 about threaded applications  
begs for some extra consideration:

   “When multiple requests are simultaneously received on the same day  
for the same period, a lottery drawing will be used to select an  
application.”

Thanks for you time and happy camping. Oh, and I hope you win  
something nice at the lottery!

   Manfred
Magnus Holm | 23 Jan 23:09 2009
Picon

I CAN HAZ 3K FRAIMWURK?

Hey, campers! I've been messin' with camping.rb again :-)


I've ported the flipbook template to RDoc 2 (RDoc 1 has always had problems with building the docs at my computer)

Since we save all the applications in Camping::Apps we can easily figure out which apps are defined when a file is loaded. I've refactored Camping::Server and Camping::Reloader (truly a refactoring - mostly just moved the bytes around) and now we no longer need to name our file the same as the app. You can also define multiple apps in one file and Camping::Reloader will work just as expected.

The <at> response object was never really used, so now we're creating it on-demand in #to_a. Save quite a few bytes.

It has always annoyed me that if you overwrite r404, r500 or r501 you also need to set the <at> status. Now we're doing a <at> status = <at> method =~ /r(\d+)/ ? $1.to_i : 200, so the default status will be set to 404, 500 or 501 in those methods. We also had a sexy r500 even though we sent all the errors to Rack::ShowExceptions (again, many bytes saved by removing that).

I've also replaced Camping.method_missing to use Rack::MockRequest which is shorter and more solid.

Camping now supports nested params (post[title]=Hello&post[body]=World). See http://judofyr.net/posts/when-in-doubt.html for more information.

Before, class PostX would route to /post/(\w+), just to be sure to catch everything I replaced it with /post/([^/]+) (everything until next slash) which makes more sense IMO

After synchronizing camping.rb and camping-unabridged.rb, camping.rb ended up at 2947 and we have now passed the 3k limit :D

Any thoughts? There's still missing a lot of documentation and I guess we should add some tests too.

//Magnus Holm
_______________________________________________
Camping-list mailing list
Camping-list@...
http://rubyforge.org/mailman/listinfo/camping-list
Magnus Holm | 24 Jan 15:01 2009
Picon

H with indifferent access

Camping::H hasn't longer indiffenrent access:


  h = Camping::H.new
  h.title = "Sweet!"
  h[:title] != h["title"]

Should we (1) don't make it indifferent at all, but rather say you should always use method_missing (2) add indifferent access?

Here is one such implementation in 86 bytes, in case we want it:

  class H < Hash
    i='def []!(k,v)Symbol===k ?self[k.to_s]!v:super end;'
    eval i.tr('!','=')+i.tr('!,v','')
  end

//Magnus Holm
_______________________________________________
Camping-list mailing list
Camping-list@...
http://rubyforge.org/mailman/listinfo/camping-list
zimbatm | 24 Jan 15:25 2009
Picon

Re: I CAN HAZ 3K FRAIMWURK?

Looks all sane to me. Good job
zimbatm | 24 Jan 15:24 2009
Picon

Re: H with indifferent access

Hi Magnus,

I prefer using method_missing, with string access for fallback when
key names are not compatible with ruby method names.
Aria Stewart | 24 Jan 15:50 2009

Re: H with indifferent access

On Jan 24, 2009, at 7:24, zimbatm <zimbatm@...> wrote:

> Hi Magnus,
>
> I prefer using method_missing, with string access for fallback when
> key names are not compatible with ruby method names.

And I prefer symbols, but it's a total edge case to me. Strings are  
great too, and it'd bug me less than indifference.

Aria
Eric Mill | 24 Jan 19:12 2009
Picon

Re: I CAN HAZ 3K FRAIMWURK?

You are the Duke of Camping.  That is awesome work, Magnus.

On Fri, Jan 23, 2009 at 2:09 PM, Magnus Holm <judofyr@...> wrote:
> Hey, campers! I've been messin' with camping.rb again :-)
> * http://github.com/judofyr/camping/commit/cbbfe41
> I've ported the flipbook template to RDoc 2 (RDoc 1 has always had problems
> with building the docs at my computer)
> * http://github.com/judofyr/camping/commit/9dc2233
> Since we save all the applications in Camping::Apps we can easily figure out
> which apps are defined when a file is loaded. I've refactored
> Camping::Server and Camping::Reloader (truly a refactoring - mostly just
> moved the bytes around) and now we no longer need to name our file the same
> as the app. You can also define multiple apps in one file and
> Camping::Reloader will work just as expected.
> * http://github.com/judofyr/camping/commit/c8da0f7
> The  <at> response object was never really used, so now we're creating it
> on-demand in #to_a. Save quite a few bytes.
> * http://github.com/judofyr/camping/commit/c04a6c7
> It has always annoyed me that if you overwrite r404, r500 or r501 you also
> need to set the  <at> status. Now we're doing a  <at> status =  <at> method =~ /r(\d+)/ ?
> $1.to_i : 200, so the default status will be set to 404, 500 or 501 in those
> methods. We also had a sexy r500 even though we sent all the errors to
> Rack::ShowExceptions (again, many bytes saved by removing that).
> I've also replaced Camping.method_missing to use Rack::MockRequest which is
> shorter and more solid.
> * http://github.com/judofyr/camping/commit/5739bb0
> Camping now supports nested params (post[title]=Hello&post[body]=World).
> See http://judofyr.net/posts/when-in-doubt.html for more information.
> * http://github.com/judofyr/camping/commit/582d94b
> Before, class PostX would route to /post/(\w+), just to be sure to catch
> everything I replaced it with /post/([^/]+) (everything until next slash)
> which makes more sense IMO
> * http://github.com/judofyr/camping/commit/c55001f
> After synchronizing camping.rb and camping-unabridged.rb, camping.rb ended
> up at 2947 and we have now passed the 3k limit :D
> Any thoughts? There's still missing a lot of documentation and I guess we
> should add some tests too.
> //Magnus Holm
>
> _______________________________________________
> Camping-list mailing list
> Camping-list@...
> http://rubyforge.org/mailman/listinfo/camping-list
>
Magnus Holm | 24 Jan 19:09 2009
Picon

Do we still need to be alert when on SQLite3?

Anyone knows if we still need to follow the instructions at http://web.archive.org/web/20080113055731/code.whytheluckystiff.net/camping/wiki/BeAlertWhenOnSqlite3, or if the stable release is good enough?

//Magnus Holm

_______________________________________________
Camping-list mailing list
Camping-list@...
http://rubyforge.org/mailman/listinfo/camping-list
Jenna Fox | 24 Jan 21:12 2009

Re: H with indifferent access

Yes, I want my method access too!..

Perhaps it'd be extra worthy of the '2.0' if you also did something  
akin to:

def [](k);super(k.to_s);end
def []=(k,v);super(k.to_s,v);end

it's some bytes, but I think it's worth it!

What ever happened to Mash?

On 25/01/2009, at 1:50 AM, Aria Stewart wrote:

> On Jan 24, 2009, at 7:24, zimbatm <zimbatm@...> wrote:
>
>> Hi Magnus,
>>
>> I prefer using method_missing, with string access for fallback when
>> key names are not compatible with ruby method names.
>
> And I prefer symbols, but it's a total edge case to me. Strings are  
> great too, and it'd bug me less than indifference.
>
> Aria
> _______________________________________________
> Camping-list mailing list
> Camping-list@...
> http://rubyforge.org/mailman/listinfo/camping-list
Magnus Holm | 24 Jan 21:35 2009
Picon

Re: H with indifferent access

Doh, the snippet I wrote was actually really stupid. Forgot we can safely call super without thinking of recursive calls. What do you guys think? Is it worth it?


Method access won't go away, and Mash was just an experiement; I don't want to add another dependency on Camping.

//Magnus Holm


On Sat, Jan 24, 2009 at 21:12, Jenna Fox <blueberry-DXT9u3ndKiQBwaaFpC1PZw@public.gmane.org> wrote:
Yes, I want my method access too!..

Perhaps it'd be extra worthy of the '2.0' if you also did something akin to:

def [](k);super(k.to_s);end
def []=(k,v);super(k.to_s,v);end

it's some bytes, but I think it's worth it!

What ever happened to Mash?



On 25/01/2009, at 1:50 AM, Aria Stewart wrote:

On Jan 24, 2009, at 7:24, zimbatm <zimbatm-Q4cn4THVH2M@public.gmane.org> wrote:

Hi Magnus,

I prefer using method_missing, with string access for fallback when
key names are not compatible with ruby method names.

And I prefer symbols, but it's a total edge case to me. Strings are great too, and it'd bug me less than indifference.

Aria
_______________________________________________
Camping-list mailing list
Camping-list <at> rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

_______________________________________________
Camping-list mailing list
Camping-list <at> rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

_______________________________________________
Camping-list mailing list
Camping-list@...
http://rubyforge.org/mailman/listinfo/camping-list

Gmane