From danbryan at gmail.com Mon Jan 2 06:10:01 2012 From: danbryan at gmail.com (Daniel Bryan) Date: Mon, 2 Jan 2012 22:10:01 +1100 Subject: Is it possible to read session data from Camping::Session in a middleware? Message-ID: I'm trying to implement some simple middleware that will have behaviour based on session data. >From looking at the source for Camping::Session and Rack::Session, I thought I'd just be able to put my own middleware between Camping::Session and my app. I tried doing it the same way that Camping::Session works - by including a module in my app - but if I inspect the environment in there, it's still encrypted. Has anyone else tried something like this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From a at creativepony.com Mon Jan 2 06:20:30 2012 From: a at creativepony.com (Jenna Fox) Date: Mon, 2 Jan 2012 22:20:30 +1100 Subject: Is it possible to read session data from Camping::Session in a middleware? In-Reply-To: References: Message-ID: <1707BDD9541B455A8B42A94F8E2E2B93@creativepony.com> If you look in to the Rack docs, you'll find more info on how to chain middleware together. Camping provides some friendly shortcuts to that, but 'including a module' is not how that's supposed to work, is my understanding. Essentially Rack middleware work by creating an object which responds to a 'call' method, and then calls the call on another thing, creating a chain of 'call' method calls. Call call? Call. Call call call. But yes, if you play with that more directly, you can clearly describe which objects feed in to each other, and have the session middleware at a more outer layer than your own middleware. Usually this ends up looking like: run OuterMostMiddleware.new(MiddleMiddleware.new(InnerMiddleware.new(SomeCampingApp))) Each layer wraps around the outside of the next, so the message from a web request travels in left to right along this line, then the response travels back right to left as each 'call' method on the middleware objects finish their work and return to the next layer leftward. ? Jenna Fox On Monday, 2 January 2012 at 10:10 PM, Daniel Bryan wrote: > I'm trying to implement some simple middleware that will have behaviour based on session data. > > From looking at the source for Camping::Session and Rack::Session, I thought I'd just be able to put my own middleware between Camping::Session and my app. I tried doing it the same way that Camping::Session works - by including a module in my app - but if I inspect the environment in there, it's still encrypted. > > Has anyone else tried something like this? > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org (mailto:Camping-list at rubyforge.org) > http://rubyforge.org/mailman/listinfo/camping-list > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From danbryan at gmail.com Mon Jan 2 06:39:50 2012 From: danbryan at gmail.com (Daniel Bryan) Date: Mon, 2 Jan 2012 22:39:50 +1100 Subject: Is it possible to read session data from Camping::Session in a middleware? In-Reply-To: <1707BDD9541B455A8B42A94F8E2E2B93@creativepony.com> References: <1707BDD9541B455A8B42A94F8E2E2B93@creativepony.com> Message-ID: <05A94A99A1F244A19D3B684E908F856F@gmail.com> Ah, thanks. I thought that the order of calling 'use' would explicitly describe the order. This was my main problem - since Camping's doing a bit of a hack to neatly slot the middleware in without people needing a rackup file or whatever, it's a bit unclear on how to get stuff in the right order. I ended up just using Rack::Session::Cookie in my rackup file, and removing 'include Camping::Session' from my Camping app. On Monday, 2 January 2012 at 10:20 PM, Jenna Fox wrote: > If you look in to the Rack docs, you'll find more info on how to chain middleware together. Camping provides some friendly shortcuts to that, but 'including a module' is not how that's supposed to work, is my understanding. Essentially Rack middleware work by creating an object which responds to a 'call' method, and then calls the call on another thing, creating a chain of 'call' method calls. Call call? Call. > > Call call call. > > But yes, if you play with that more directly, you can clearly describe which objects feed in to each other, and have the session middleware at a more outer layer than your own middleware. Usually this ends up looking like: > > run OuterMostMiddleware.new(MiddleMiddleware.new(InnerMiddleware.new(SomeCampingApp))) > > Each layer wraps around the outside of the next, so the message from a web request travels in left to right along this line, then the response travels back right to left as each 'call' method on the middleware objects finish their work and return to the next layer leftward. > > > ? > Jenna Fox > > > On Monday, 2 January 2012 at 10:10 PM, Daniel Bryan wrote: > > > I'm trying to implement some simple middleware that will have behaviour based on session data. > > > > From looking at the source for Camping::Session and Rack::Session, I thought I'd just be able to put my own middleware between Camping::Session and my app. I tried doing it the same way that Camping::Session works - by including a module in my app - but if I inspect the environment in there, it's still encrypted. > > > > Has anyone else tried something like this? > > _______________________________________________ > > Camping-list mailing list > > Camping-list at rubyforge.org (mailto:Camping-list at rubyforge.org) > > http://rubyforge.org/mailman/listinfo/camping-list > > > > > > > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org (mailto:Camping-list at rubyforge.org) > http://rubyforge.org/mailman/listinfo/camping-list > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From judofyr at gmail.com Mon Jan 2 08:33:08 2012 From: judofyr at gmail.com (Magnus Holm) Date: Mon, 2 Jan 2012 14:33:08 +0100 Subject: Is it possible to read session data from Camping::Session in a middleware? In-Reply-To: <05A94A99A1F244A19D3B684E908F856F@gmail.com> References: <1707BDD9541B455A8B42A94F8E2E2B93@creativepony.com> <05A94A99A1F244A19D3B684E908F856F@gmail.com> Message-ID: On Mon, Jan 2, 2012 at 12:39, Daniel Bryan wrote: > Ah, thanks. > > I thought that the order of calling 'use' would explicitly describe the > order. This was my main problem - since Camping's doing a bit of a hack to > neatly slot the middleware in without people needing a rackup file or > whatever, it's a bit unclear on how to get stuff in the right order. Yeah, it's in reverse order: module App use Foo use Bar end is the same as: Bar.new(Foo.new(App)) > I ended up just using Rack::Session::Cookie in my rackup file, and removing > 'include Camping::Session' from my Camping app. From judofyr at gmail.com Sun Jan 15 14:26:37 2012 From: judofyr at gmail.com (Magnus Holm) Date: Sun, 15 Jan 2012 20:26:37 +0100 Subject: Mab is pretty much done Message-ID: Just thought I'd let you know that I've been working on Mab lately: https://github.com/camping/mab. This will replace Markaby in the next release. Also, I've been benchmarking it on this simple, but view-heavy, app. Camping w/Markaby: 480 requests/second Camping w/Mab: 1490 requests/second Camping.goes :App module App::Controllers class Index def get render :index end end end module App::Views def index div.page.index do div.big do h1.main! "Welcome! World." end end end def layout html do head do title "Web Page" end body do div.wrapper! do yield end end end end end // Magnus Holm From a at creativepony.com Sun Jan 15 15:27:52 2012 From: a at creativepony.com (Jenna Fox) Date: Mon, 16 Jan 2012 07:27:52 +1100 Subject: Mab is pretty much done In-Reply-To: References: Message-ID: <18B16A88B2BA4EFEA6F788B87E5CA7BC@creativepony.com> Excellent work! and some great examples you have in that readme ;) ? Jenna Fox On Monday, 16 January 2012 at 6:26 AM, Magnus Holm wrote: > Just thought I'd let you know that I've been working on Mab lately: > > https://github.com/camping/mab. > > This will replace Markaby in the next release. > > Also, I've been benchmarking it on this simple, but view-heavy, app. > > Camping w/Markaby: 480 requests/second > Camping w/Mab: 1490 requests/second > > Camping.goes :App > > module App::Controllers > class Index > def get > render :index > end > end > end > > module App::Views > def index > div.page.index do > div.big do > h1.main! "Welcome! World." > end > end > end > > def layout > html do > head do > title "Web Page" > end > > body do > div.wrapper! do > yield > end > end > end > end > end > > // Magnus Holm > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org (mailto:Camping-list at rubyforge.org) > http://rubyforge.org/mailman/listinfo/camping-list > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From judofyr at gmail.com Sun Jan 15 16:51:02 2012 From: judofyr at gmail.com (Magnus Holm) Date: Sun, 15 Jan 2012 22:51:02 +0100 Subject: New reloader Message-ID: I finally pushed out the new reloader: https://github.com/camping/camping/compare/e160094...342bf80 Two big features: * camping config.ru You can now run the Camping Server on a .ru-file. If you somehow need a more elaborate Rack-setup (Camping.use is not enough), this means you can still use the reloader. * public/ is automatically served Given this directory: config.ru app.rb app/controllers.rb public/ camping.png Running either `camping config.ru` or `camping app.rb` makes camping.png available on http://localhost:3301/camping.png Some things that are *not* supported anymore: * camping app1.rb app2.rb Nobody used it; it made everything more complex. * Mounting several apps from one file Before, if you had this file: # app.rb Camping.goes :App Camping.goes :App2 Running `camping app.rb` mounted App on /app and App2 on /app2. Now, App will be mounted at /. (If you named the file app2.rb, App2 would be mounted). If you need the previous functionality, just create a config.ru: map '/app' do run App end map '/app2' do run App2 end This gives you more control and can be reused by other servers (Thin, Passenger) etc. // Magnus Holm From ruby at monnet-usa.com Sun Jan 15 22:24:59 2012 From: ruby at monnet-usa.com (Philippe Monnet) Date: Sun, 15 Jan 2012 20:24:59 -0700 Subject: Mab is pretty much done In-Reply-To: References: Message-ID: <4F13988B.6050009@monnet-usa.com> Very nice Magnus! :-) I will be playing with mab soon. On 1/15/2012 12:26 PM, Magnus Holm wrote: > Just thought I'd let you know that I've been working on Mab lately: > > https://github.com/camping/mab. > > This will replace Markaby in the next release. > > Also, I've been benchmarking it on this simple, but view-heavy, app. > > Camping w/Markaby: 480 requests/second > Camping w/Mab: 1490 requests/second > > Camping.goes :App > > module App::Controllers > class Index > def get > render :index > end > end > end > > module App::Views > def index > div.page.index do > div.big do > h1.main! "Welcome! World." > end > end > end > > def layout > html do > head do > title "Web Page" > end > > body do > div.wrapper! do > yield > end > end > end > end > end > > // Magnus Holm > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > -------------- next part -------------- An HTML attachment was scrubbed... URL: From IcePapih at lavabit.com Mon Jan 16 02:38:31 2012 From: IcePapih at lavabit.com (Isak Andersson) Date: Mon, 16 Jan 2012 08:38:31 +0100 Subject: New reloader In-Reply-To: References: Message-ID: <6253ccbc-d496-4b00-aa2d-b3da5a2bfab5@email.android.com> Nice! It'd a bit sad that you can't serve multiple apps anymore though but you are probably most definitely right about the fact that nobody uses it! Good work! -Isak Andersson -- Skickat fr?n min Android-telefon med K-9 E-post. Urs?kta min f?ordighet. Magnus Holm skrev: I finally pushed out the new reloader: https://github.com/camping/camping/compare/e160094...342bf80 Two big features: * camping config.ru You can now run the Camping Server on a .ru-file. If you somehow need a more elaborate Rack-setup (Camping.use is not enough), this means you can still use the reloader. * public/ is automatically served Given this directory: config.ru app.rb app/controllers.rb public/ camping.png Running either `camping config.ru` or `camping app.rb` makes camping.png available on http://localhost:3301/camping.png Some things that are *not* supported anymore: * camping app1.rb app2.rb Nobody used it; it made everything more complex. * Mounting several apps from one file Before, if you had this file: # app.rb Camping.goes :App Camping.goes :App2 Running `camping app.rb` mounted App on /app and App2 on /app2. Now, App will be mounted at /. (If you named the file app2.rb, App2 would be mounted). If you need the previous functionality, just create a config.ru: map '/app' do run App end map '/app2' do run App2 end This gives you more control and can be reused by other servers (Thin, Passenger) etc. // Magnus Holm _____________________________________________ Camping-list mailing list Camping-list at rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list _____________________________________________ About Make-Up and Skin types. Get Up to 70% Off on a VIp consultation http://click.lavabit.com/bahusiqfst36twgjw31njj948r1atcxpr7mk1efj3edqj8dd81eb/ _____________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From judofyr at gmail.com Wed Jan 25 06:00:46 2012 From: judofyr at gmail.com (Magnus Holm) Date: Wed, 25 Jan 2012 12:00:46 +0100 Subject: Camping 2.2 pre-release Message-ID: gem install camping --source http://gems.judofyr.net/ *wonders how much Mab breaks* // Magnus Holm From a at creativepony.com Wed Jan 25 07:03:25 2012 From: a at creativepony.com (Jenna Fox) Date: Wed, 25 Jan 2012 23:03:25 +1100 Subject: Camping 2.2 pre-release In-Reply-To: References: Message-ID: <04D216CEE1D5465588C1B4B4F36994BC@creativepony.com> failing test case, running in camping: def layout text "\n" html { head { title "foo" } } end Markaby output: foo Mab output: <!DOCTYPE html> foo ? Jenna Fox On Wednesday, 25 January 2012 at 10:00 PM, Magnus Holm wrote: > gem install camping --source http://gems.judofyr.net/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From a at creativepony.com Tue Jan 31 15:55:44 2012 From: a at creativepony.com (Jenna Fox) Date: Wed, 1 Feb 2012 07:55:44 +1100 Subject: +1 shorter domain name Message-ID: <0F440C54DB5C4659827D866D50EFA085@creativepony.com> Just thought it worth mentioning, we now collectively do own camping.io - this is where judofyr's site will go when it's ready, and we're planning to use github pages as hosting for now (yes, we won't be running it as a dynamic camping website, seeing as we can't think of any good dynamic functionality) Speaking of dynamic functionality. Do you guys remember the old ruby/rails beast forums? They kind of died out, but a really simple clean forum can be a really nice thing, and it send a clear message by being publicly readable - camping is not dead. You wouldn't need to join a mailing list to find that out. I've been thinking about forums a lot lately, and I think http://camendesign.com/nononsense_forum is a really great way to build a really simple forum - you use folders for sub forums, and rss or atom feeds for threads. This way you can subscribe to them also, and it has a built in API of sorts. Probably atom is the way to go. rss is a bit of a hack job. I'm really keen to kill this myth that camping is inactive. Another way I think we might do this is to bring in camping-related projects as well. In the same way rails is the home of active record, perhaps camping aught to be the home of things like mab. ? Jenna Fox -------------- next part -------------- An HTML attachment was scrubbed... URL: From nerdfunk at gmail.com Tue Jan 31 22:18:47 2012 From: nerdfunk at gmail.com (adam moore) Date: Wed, 1 Feb 2012 12:18:47 +0900 Subject: +1 shorter domain name In-Reply-To: <0F440C54DB5C4659827D866D50EFA085@creativepony.com> References: <0F440C54DB5C4659827D866D50EFA085@creativepony.com> Message-ID: I've recently been using Arch linux and 90% of the appeal comes from their awesome user-led wiki.. Something which we can gradually add to, build on camping of course, and which hand-holds beginners would be ideal I think On Wed, Feb 1, 2012 at 5:55 AM, Jenna Fox wrote: > Just thought it worth mentioning, we now collectively do own camping.io - > this is where judofyr's site will go when it's ready, and we're planning to > use github pages as hosting for now (yes, we won't be running it as a > dynamic camping website, seeing as we can't think of any good dynamic > functionality) > > Speaking of dynamic functionality. Do you guys remember the old ruby/rails > beast forums? They kind of died out, but a really simple clean forum can be > a really nice thing, and it send a clear message by being publicly readable > - camping is not dead. You wouldn't need to join a mailing list to find that > out. I've been thinking about forums a lot lately, and I > think?http://camendesign.com/nononsense_forum is a really great way to build > a really simple forum - you use folders for sub forums, and rss or atom > feeds for threads. This way you can subscribe to them also, and it has a > built in API of sorts. Probably atom is the way to go. rss is a bit of a > hack job. > > I'm really keen to kill this myth that camping is inactive. Another way I > think we might do this is to bring in camping-related projects as well. In > the same way rails is the home of active record, perhaps camping aught to be > the home of things like mab. > > > ? > Jenna Fox > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list From a at creativepony.com Tue Jan 31 22:50:42 2012 From: a at creativepony.com (Jenna Fox) Date: Wed, 1 Feb 2012 14:50:42 +1100 Subject: +1 shorter domain name In-Reply-To: References: <0F440C54DB5C4659827D866D50EFA085@creativepony.com> Message-ID: <2C3FFB90437549DDA075D7B96CAEF1ED@creativepony.com> That sounds great, but I remain skeptical that people will spend the time necessary to write good quality articles (or anything at all) on a wiki, seeing as we have had a wiki as our entire website for quite a long time. Do you have any thoughts on who would contribute and what their motivations would be? ? Jenna Fox On Wednesday, 1 February 2012 at 2:18 PM, adam moore wrote: > I've recently been using Arch linux and 90% of the appeal comes from > their awesome user-led wiki.. > Something which we can gradually add to, build on camping of course, > and which hand-holds beginners would be ideal I think > > On Wed, Feb 1, 2012 at 5:55 AM, Jenna Fox wrote: > > Just thought it worth mentioning, we now collectively do own camping.io (http://camping.io) - > > this is where judofyr's site will go when it's ready, and we're planning to > > use github pages as hosting for now (yes, we won't be running it as a > > dynamic camping website, seeing as we can't think of any good dynamic > > functionality) > > > > Speaking of dynamic functionality. Do you guys remember the old ruby/rails > > beast forums? They kind of died out, but a really simple clean forum can be > > a really nice thing, and it send a clear message by being publicly readable > > - camping is not dead. You wouldn't need to join a mailing list to find that > > out. I've been thinking about forums a lot lately, and I > > think http://camendesign.com/nononsense_forum is a really great way to build > > a really simple forum - you use folders for sub forums, and rss or atom > > feeds for threads. This way you can subscribe to them also, and it has a > > built in API of sorts. Probably atom is the way to go. rss is a bit of a > > hack job. > > > > I'm really keen to kill this myth that camping is inactive. Another way I > > think we might do this is to bring in camping-related projects as well. In > > the same way rails is the home of active record, perhaps camping aught to be > > the home of things like mab. > > > > > > ? > > Jenna Fox > > > > > > _______________________________________________ > > Camping-list mailing list > > Camping-list at rubyforge.org (mailto:Camping-list at rubyforge.org) > > http://rubyforge.org/mailman/listinfo/camping-list > > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org (mailto:Camping-list at rubyforge.org) > http://rubyforge.org/mailman/listinfo/camping-list > > -------------- next part -------------- An HTML attachment was scrubbed... URL: