From dsusco at gmail.com Wed Mar 3 10:43:51 2010 From: dsusco at gmail.com (David Susco) Date: Wed, 3 Mar 2010 10:43:51 -0500 Subject: sending data/overriding response headers? Message-ID: <1bd79b4a1003030743y1b42fcdm3886b4704c53b903@mail.gmail.com> Hey guys, A user would like to download a table dump as a CSV, what's the best way to do this? ActionController has send_data: http://api.rubyonrails.org/classes/ActionController/Streaming.html Is there something similar built into Camping? If not, is there a way to override the response headers of a controller to declare the response as something other than HTML (so the csv isn't displayed in the browser)? -- Dave From julian.tarkhanov at gmail.com Wed Mar 3 11:04:11 2010 From: julian.tarkhanov at gmail.com (Julik Tarkhanov) Date: Wed, 3 Mar 2010 17:04:11 +0100 Subject: sending data/overriding response headers? In-Reply-To: <1bd79b4a1003030743y1b42fcdm3886b4704c53b903@mail.gmail.com> References: <1bd79b4a1003030743y1b42fcdm3886b4704c53b903@mail.gmail.com> Message-ID: On 3 mrt 2010, at 16:43, David Susco wrote: > Is there something similar built into Camping? Before it was so that you could return an IO object from your action and it would just work. Dunno if Camping 2 still supports this. A Content-Disposition header would be in order so that your clients download a proper filename. -- Julik Tarkhanov me at julik.nl From judofyr at gmail.com Wed Mar 3 11:11:13 2010 From: judofyr at gmail.com (Magnus Holm) Date: Wed, 3 Mar 2010 17:11:13 +0100 Subject: sending data/overriding response headers? In-Reply-To: <1bd79b4a1003030743y1b42fcdm3886b4704c53b903@mail.gmail.com> References: <1bd79b4a1003030743y1b42fcdm3886b4704c53b903@mail.gmail.com> Message-ID: <391a49da1003030811t2fe39567ye4c8e14b94ce30fa@mail.gmail.com> Sure, just make sure to enable X-Sendfile in Apache/Nginx, and then set it yourself: def get @headers['X-Sendfile'] = "/full/path/to/file" @headers['Content-Type'] = "text/plain; charset=utf-8" end Or if you want Rack to figure out which Content-Type to send: file = "/full/path/to/file" @headers['X-Sendfile'] = file @headers['Content-Type'] = Rack::Mime.mime_type(File.extname(file)) + "; charset=utf-8" If you ever need to send custom headers, just use the @headers hash. // Magnus Holm On Wed, Mar 3, 2010 at 16:43, David Susco wrote: > Hey guys, > > A user would like to download a table dump as a CSV, what's the best > way to do this? > > ActionController has send_data: > > http://api.rubyonrails.org/classes/ActionController/Streaming.html > > Is there something similar built into Camping? > > If not, is there a way to override the response headers of a > controller to declare the response as something other than HTML (so > the csv isn't displayed in the browser)? > > -- > Dave > _______________________________________________ > 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 judofyr at gmail.com Wed Mar 3 11:20:45 2010 From: judofyr at gmail.com (Magnus Holm) Date: Wed, 3 Mar 2010 17:20:45 +0100 Subject: sending data/overriding response headers? In-Reply-To: References: <1bd79b4a1003030743y1b42fcdm3886b4704c53b903@mail.gmail.com> Message-ID: <391a49da1003030820s36db70f5w99008359caae5a1c@mail.gmail.com> In Camping 2 you can return an object which responds to #each and the server will then stream it to the client. If you want the file to trigger a download-box on the user, you'll have to send Content-Disposition as Julik mentioned. Something like this should work, although I'm not 100% sure: @headers['Content-Disposition'] = 'attachment; filename=table.csv' // Magnus Holm On Wed, Mar 3, 2010 at 17:04, Julik Tarkhanov wrote: > > On 3 mrt 2010, at 16:43, David Susco wrote: > > Is there something similar built into Camping? >> > > > Before it was so that you could return an IO object from your action and it > would just work. Dunno if Camping 2 still supports this. A > Content-Disposition header would be in order > so that your clients download a proper filename. > > -- > Julik Tarkhanov > me at julik.nl > > > > > > > _______________________________________________ > 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 ruby at monnet-usa.com Mon Mar 8 23:36:33 2010 From: ruby at monnet-usa.com (Philippe Monnet) Date: Mon, 08 Mar 2010 21:36:33 -0700 Subject: Are there existing sitemap generators for Camping? Message-ID: <4B95D051.7080200@monnet-usa.com> When searching I have found a few Rails-specific sitemap generators but I was wondering if anyone new of a Camping-specific implementation? Philippe (techarch) -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruby at monnet-usa.com Wed Mar 10 21:05:22 2010 From: ruby at monnet-usa.com (Philippe Monnet) Date: Wed, 10 Mar 2010 19:05:22 -0700 Subject: New blog post on NewRelic performance and monitoring instrumentation for Camping apps Message-ID: <4B984FE2.20900@monnet-usa.com> For those of you who are interested in implementing NewRelic performance management on your Ruby Camping site, I recently posted a blog post explaining how to do that. See http://blog.monnet-usa.com/?p=223. It relies on a NewRelic instrumentation plugin I wrote and that NewRelic integrated in their recent release. Philippe (techarch on Twitter) -------------- next part -------------- An HTML attachment was scrubbed... URL: From dsusco at gmail.com Fri Mar 12 10:04:19 2010 From: dsusco at gmail.com (David Susco) Date: Fri, 12 Mar 2010 10:04:19 -0500 Subject: restful camping with reststop Message-ID: <1bd79b4a1003120704y6cec851ey65c1cd1e736255b6@mail.gmail.com> Has anyone managed to get camping to work with reststop using 1.9.354? -- Dave From ruby at monnet-usa.com Sat Mar 13 12:21:49 2010 From: ruby at monnet-usa.com (Philippe Monnet) Date: Sat, 13 Mar 2010 10:21:49 -0700 Subject: Are there existing sitemap generators for Camping? In-Reply-To: <4B95D051.7080200@monnet-usa.com> References: <4B95D051.7080200@monnet-usa.com> Message-ID: <4B9BC9AD.1030206@monnet-usa.com> Since I could not find one, I wrote a simple (and crude) Google sitemap generator - see http://gist.github.com/330973 After pasting the code in your app controllers module, you just need to customize 2 things: 1) the base url of your site: SITE_BASE_URL = "http://www.myapp.com" 2) list the controllers you want to expose on the sitemap (since you may not want to expose all controllers): def self.sitemap_candidates [ :Test1, :Test2 ] end Have fun. Philippe On 3/8/2010 9:36 PM, Philippe Monnet wrote: > When searching I have found a few Rails-specific sitemap generators > but I was wondering if anyone new of a Camping-specific implementation? > > Philippe (techarch) -------------- next part -------------- An HTML attachment was scrubbed... URL: From judofyr at gmail.com Sat Mar 13 17:46:07 2010 From: judofyr at gmail.com (Magnus Holm) Date: Sat, 13 Mar 2010 23:46:07 +0100 Subject: Are there existing sitemap generators for Camping? In-Reply-To: <4B9BC9AD.1030206@monnet-usa.com> References: <4B95D051.7080200@monnet-usa.com> <4B9BC9AD.1030206@monnet-usa.com> Message-ID: <391a49da1003131446k61391b3cs65ca5e531f952775@mail.gmail.com> Cool. We'll have to find a place on the wiki for these things :-) Couldn't you also figure out SITE_BASE_URL in GoogleSiteMap? @request.url.gsub("/sitemap.xml", "") or something? // Magnus Holm On Sat, Mar 13, 2010 at 18:21, Philippe Monnet wrote: > Since I could not find one, I wrote a simple (and crude) Google sitemap > generator - see http://gist.github.com/330973 > > After pasting the code in your app controllers module, you just need to > customize 2 things: > > 1) the base url of your site: > > SITE_BASE_URL = "http://www.myapp.com" > > 2) list the controllers you want to expose on the sitemap (since you may > not want to expose all controllers): > > def self.sitemap_candidates > [ :Test1, :Test2 ] > end > > Have fun. > > Philippe > > > On 3/8/2010 9:36 PM, Philippe Monnet wrote: > > When searching I have found a few Rails-specific sitemap generators but I > was wondering if anyone new of a Camping-specific implementation? > > Philippe (techarch) > > > > _______________________________________________ > 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 ruby at monnet-usa.com Sun Mar 21 17:05:40 2010 From: ruby at monnet-usa.com (Philippe Monnet) Date: Sun, 21 Mar 2010 15:05:40 -0600 Subject: What now? In-Reply-To: References: <391a49da0908071238g24602d56wf52c3371dae950bd@mail.gmail.com> <3599629A-EC84-4DE6-B522-99C515D845EF@innotts.co.uk> <5b67d7010910150242s1f381214xcb8d226cffddc363@mail.gmail.com> <105591900910150700o262e1903uc7b27b51c671e0a6@mail.gmail.com> <06DC34A0-BEF7-4974-97D9-4A51C3F25493@innotts.co.uk> <1d87b3640910150818q278a915dy91de36e7e1c75182@mail.gmail.com> <391a49da0910171432h6d1ba565u6e3e12ddef33af67@mail.gmail.com> <38A727BD-2896-4D1B-8F1E-FD24C06476A0@innotts.co.uk> <4ADB1C76.9000706@monnet-usa.com> <4ADB97A3.4050201@monnet-usa.com> Message-ID: <4BA68A24.6050206@monnet-usa.com> I was wondering how we can help with next steps? I keep seeing all the attention going to the Sinatra framework (and Rails of course) and would love to help more with promoting Camping. It would be great if one of our web designer / Camping friend could help create a catchy visual for the site. How about a night time view of a camp fire with a tent and maybe a small projector with a big silver screen where we could display rotating content / slides? Any other crazy concepts? Philippe On 10/18/2009 6:03 PM, Dave Everitt wrote: > Below: collated results for a Camping domain name, have added my prefs > and all others. Perhaps we can increment/decrement these scores from > now on to get a final result ;-) > >> [Philippe]: I feel that having the word Ruby in the name would be >> good for SEO and more likely to incite people not familiar with >> Camping to click on a link due to the association with Ruby. > > agreed. 'rubycamping.com' is available (as are the others, I *think*). > Also agree with the need to distinguish Camping from RoR, so not so > sure about 'rubyoncamping.com'? For SEO it's common to have > 1 > domain, with a primary one, so (say) > 'ruby-camping-framework.com/org/net' might be a good buy to forward to > the chosen domain. Since this isn't a commercial site, I'd prefer > .org/.net with the .com variation sitting there quietly - opinions? > >> rubycamping.com [9 +1] >> campingframework.com [2 +1] >> rubyoncamping.com [10 -1] >> whywentcamping.com [1 +2] (cute but I wonder if people may skip the >> site link by thinking it has nothing to do with Ruby) > > Dave > > PS I have to sleep now. > > _______________________________________________ > 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 deveritt at innotts.co.uk Sun Mar 21 17:23:45 2010 From: deveritt at innotts.co.uk (Dave Everitt) Date: Sun, 21 Mar 2010 21:23:45 +0000 Subject: Are there existing sitemap generators for Camping? In-Reply-To: <391a49da1003131446k61391b3cs65ca5e531f952775@mail.gmail.com> References: <4B95D051.7080200@monnet-usa.com> <4B9BC9AD.1030206@monnet-usa.com> <391a49da1003131446k61391b3cs65ca5e531f952775@mail.gmail.com> Message-ID: For now, added to the wiki under 'Miscellaneous Camping links'. Be good to find a few more 'made with Camping' sites/apps to add to the list - anyone want to put up their app? - Dave Everitt > Magnus Holm wrote: Cool. We'll have to find a place on the wiki for > these things :-) > >> Philippe Monnet wrote: I wrote a simple (and crude) Google sitemap >> generator - see http://gist.github.com/330973 From deveritt at innotts.co.uk Sun Mar 21 17:58:09 2010 From: deveritt at innotts.co.uk (Dave Everitt) Date: Sun, 21 Mar 2010 21:58:09 +0000 Subject: What now? In-Reply-To: <4BA68A24.6050206@monnet-usa.com> References: <391a49da0908071238g24602d56wf52c3371dae950bd@mail.gmail.com> <3599629A-EC84-4DE6-B522-99C515D845EF@innotts.co.uk> <5b67d7010910150242s1f381214xcb8d226cffddc363@mail.gmail.com> <105591900910150700o262e1903uc7b27b51c671e0a6@mail.gmail.com> <06DC34A0-BEF7-4974-97D9-4A51C3F25493@innotts.co.uk> <1d87b3640910150818q278a915dy91de36e7e1c75182@mail.gmail.com> <391a49da0910171432h6d1ba565u6e3e12ddef33af67@mail.gmail.com> <38A727BD-2896-4D1B-8F1E-FD24C06476A0@innotts.co.uk> <4ADB1C76.9000706@monnet-usa.com> <4ADB97A3.4050201@monnet-usa.com> <4BA68A24.6050206@monnet-usa.com> Message-ID: <4F437D3B-A422-412A-9FFA-936E485C98C9@innotts.co.uk> Hi Philippe I am one of those Camping friends (although I've been too busy with clients just lately to do much). Although I just posted links to your Camping 'add-ons' to the wiki :-) I agree about Sinatra - from curiosity I've even dabbled with it myself (shame!), although it is nice that Camping still has a small community feel. Perhaps some _why-type cartoons (along the lines you suggest) might be the right way forward for a 'This is Camping' website. Or just keep things clean and minimal. As for content, that was covered in another post to the list some time ago, as was a domain name. Magnus has the substance (tutorial, examples, etc.) and a nice CSS style for the blog example. Maybe start with a developed version of the Camping blog on Heroku (free) so we can each add Camping-related posts to keep things fresh? It's just making enough time to put it all together... I'd be happy to chip in, but what's the best way to build a whole site that uses Camping - a collection of apps and generated static pages? I once used Camping 1.5 (running as CGI) as an easy way to make a simple multipage wireframe mockup, but... Dave > I was wondering how we can help with next steps? > I keep seeing all the attention going to the Sinatra framework (and > Rails of course) and would love to help more with promoting > Camping. It would be great if one of our web designer / Camping > friend could help create a catchy visual for the site. How about a > night time view of a camp fire with a tent and maybe a small > projector with a big silver screen where we could display rotating > content / slides? Any other crazy concepts? > > Philippe From ruby at monnet-usa.com Mon Mar 22 23:16:49 2010 From: ruby at monnet-usa.com (Philippe Monnet) Date: Mon, 22 Mar 2010 21:16:49 -0600 Subject: What now? In-Reply-To: <4F437D3B-A422-412A-9FFA-936E485C98C9@innotts.co.uk> References: <391a49da0908071238g24602d56wf52c3371dae950bd@mail.gmail.com> <3599629A-EC84-4DE6-B522-99C515D845EF@innotts.co.uk> <5b67d7010910150242s1f381214xcb8d226cffddc363@mail.gmail.com> <105591900910150700o262e1903uc7b27b51c671e0a6@mail.gmail.com> <06DC34A0-BEF7-4974-97D9-4A51C3F25493@innotts.co.uk> <1d87b3640910150818q278a915dy91de36e7e1c75182@mail.gmail.com> <391a49da0910171432h6d1ba565u6e3e12ddef33af67@mail.gmail.com> <38A727BD-2896-4D1B-8F1E-FD24C06476A0@innotts.co.uk> <4ADB1C76.9000706@monnet-usa.com> <4ADB97A3.4050201@monnet-usa.com> <4BA68A24.6050206@monnet-usa.com> <4F437D3B-A422-412A-9FFA-936E485C98C9@innotts.co.uk> Message-ID: <4BA832A1.30001@monnet-usa.com> I like the idea of the site being built on Camping and combining mini-apps and static content all integrated with jQuery for example. I am currently running two Camping 2.0 apps on Heroku and they work great. Hosting on Heroku would be also be convenient because of the ability to add Git contributors and because of the ease of deployment. On 3/21/2010 3:58 PM, Dave Everitt wrote: > Hi Philippe > > I am one of those Camping friends (although I've been too busy with > clients just lately to do much). Although I just posted links to your > Camping 'add-ons' to the wiki :-) > > I agree about Sinatra - from curiosity I've even dabbled with it > myself (shame!), although it is nice that Camping still has a small > community feel. Perhaps some _why-type cartoons (along the lines you > suggest) might be the right way forward for a 'This is Camping' > website. Or just keep things clean and minimal. > > As for content, that was covered in another post to the list some time > ago, as was a domain name. Magnus has the substance (tutorial, > examples, etc.) and a nice CSS style for the blog example. Maybe start > with a developed version of the Camping blog on Heroku (free) so we > can each add Camping-related posts to keep things fresh? > > It's just making enough time to put it all together... I'd be happy to > chip in, but what's the best way to build a whole site that uses > Camping - a collection of apps and generated static pages? I once used > Camping 1.5 (running as CGI) as an easy way to make a simple multipage > wireframe mockup, but... > > Dave > >> I was wondering how we can help with next steps? >> I keep seeing all the attention going to the Sinatra framework (and >> Rails of course) and would love to help more with promoting Camping. >> It would be great if one of our web designer / Camping friend could >> help create a catchy visual for the site. How about a night time view >> of a camp fire with a tent and maybe a small projector with a big >> silver screen where we could display rotating content / slides? Any >> other crazy concepts? >> >> Philippe > > _______________________________________________ > 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 ruby at monnet-usa.com Mon Mar 22 23:32:19 2010 From: ruby at monnet-usa.com (Philippe Monnet) Date: Mon, 22 Mar 2010 21:32:19 -0600 Subject: restful camping with reststop In-Reply-To: <1bd79b4a1003120704y6cec851ey65c1cd1e736255b6@mail.gmail.com> References: <1bd79b4a1003120704y6cec851ey65c1cd1e736255b6@mail.gmail.com> Message-ID: <4BA83643.1090804@monnet-usa.com> Hi David, I had played with RESTstop on the old Camping maybe six months ago. I have now started to take a look at what the issues are about. So far I have found a few things like: In reststop.rb: - the service method needs to retrieve the REQUEST_METHOD using @env['REQUEST_METHOD'] -the condition on the if statement on the last m.capture line of the render method needs to be adjusted (not sure what a[0] should be replaced with. So far I have temporarily replaced the line by: s = m.capture{send(:layout){s}} if m.respond_to?(:layout) In the blog.rb example - the version number for camping needs to be updated - require 'camping/db' should be removed since now obsolete - require 'markaby' needs to be added So far I can bring up the app in a browser, login, add a post. But if I use Restr I can only do a GET. The PUT currently fails with a 401. I will continue to try figuring it out over the next week or so. It would be great if the initial author could help us out. Philippe On 3/12/2010 8:04 AM, David Susco wrote: > Has anyone managed to get camping to work with reststop using 1.9.354? > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt at roughest.net Tue Mar 23 11:07:11 2010 From: matt at roughest.net (Matt Zukowski) Date: Tue, 23 Mar 2010 11:07:11 -0400 Subject: restful camping with reststop In-Reply-To: <4BA83643.1090804@monnet-usa.com> References: <1bd79b4a1003120704y6cec851ey65c1cd1e736255b6@mail.gmail.com> <4BA83643.1090804@monnet-usa.com> Message-ID: <1d87b3641003230807h59eb25a6r2d9318abd6c6429b@mail.gmail.com> I actually have a reststop app up and running fine with Camping 2.0 (check out Taskr at http://github.com/zuk/taskr). Tthe catch is that it's a version of 2.0 that I forked about this time last year, and looking at the github graph, Magnus has committed a whole slew of changes since then. So whatever broke Reststop must have been committed in the last 10 months or so. To be honest over the last year I've mostly switched form Camping to Sinatra (and lately to Node.js, which is really really cool by the way). The problem with Camping, for me, is that trying to extend it is a nightmare. I learned this the hard way while writing Reststop and Picnic. Anyway I have a bit of time right now, so since there seems to be some interest, I'll pull down the latest version of Camping and see if I can make it work with Reststop. I should also move Reststop to github while I'm at it. On Mon, Mar 22, 2010 at 11:32 PM, Philippe Monnet wrote: > Hi David, > > I had played with RESTstop on the old Camping maybe six months ago. > I have now started to take a look at what the issues are about. > So far I have found a few things like: > > In reststop.rb: > - the service method needs to retrieve the REQUEST_METHOD using > @env['REQUEST_METHOD'] > -the condition on the if statement on the last m.capture line of the > render method needs to be adjusted (not sure what a[0] should be replaced > with. So far I have temporarily replaced the line by: > s = m.capture{send(:layout){s}} if m.respond_to?(:layout) > > In the blog.rb example > - the version number for camping needs to be updated > - require 'camping/db' should be removed since now obsolete > - require 'markaby' needs to be added > > So far I can bring up the app in a browser, login, add a post. > But if I use Restr I can only do a GET. The PUT currently fails with a 401. > I will continue to try figuring it out over the next week or so. > It would be great if the initial author could help us out. > > Philippe > > > On 3/12/2010 8:04 AM, David Susco wrote: > > Has anyone managed to get camping to work with reststop using 1.9.354? > > > > > > _______________________________________________ > 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 judofyr at gmail.com Tue Mar 23 11:50:54 2010 From: judofyr at gmail.com (Magnus Holm) Date: Tue, 23 Mar 2010 16:50:54 +0100 Subject: restful camping with reststop In-Reply-To: <1d87b3641003230807h59eb25a6r2d9318abd6c6429b@mail.gmail.com> References: <1bd79b4a1003120704y6cec851ey65c1cd1e736255b6@mail.gmail.com> <4BA83643.1090804@monnet-usa.com> <1d87b3641003230807h59eb25a6r2d9318abd6c6429b@mail.gmail.com> Message-ID: <391a49da1003230850l4088dd03w7a0ac82dc780d590@mail.gmail.com> I find extending Camping apps to be quite easy, since it's all classes and modules, but I can understand that extending Camping itself can be difficult/weird. That said, I think a lot can be solved by defining #included and #extended. It would be great if you could tell us a bit exactly the problems you faced. We still have 1k left. Don't hurry, though. Let's get 2.0 out first. // Magnus Holm On Tue, Mar 23, 2010 at 16:07, Matt Zukowski wrote: > I actually have a reststop app up and running fine with Camping 2.0 (check > out Taskr at http://github.com/zuk/taskr). Tthe catch is that it's a > version of 2.0 that I forked about this time last year, and looking at the > github graph, Magnus has committed a whole slew of changes since then. So > whatever broke Reststop must have been committed in the last 10 months or > so. > > To be honest over the last year I've mostly switched form Camping to > Sinatra (and lately to Node.js, which is really really cool by the way). The > problem with Camping, for me, is that trying to extend it is a nightmare. I > learned this the hard way while writing Reststop and Picnic. > > Anyway I have a bit of time right now, so since there seems to be some > interest, I'll pull down the latest version of Camping and see if I can make > it work with Reststop. I should also move Reststop to github while I'm at > it. > > On Mon, Mar 22, 2010 at 11:32 PM, Philippe Monnet wrote: > >> Hi David, >> >> I had played with RESTstop on the old Camping maybe six months ago. >> I have now started to take a look at what the issues are about. >> So far I have found a few things like: >> >> In reststop.rb: >> - the service method needs to retrieve the REQUEST_METHOD using >> @env['REQUEST_METHOD'] >> -the condition on the if statement on the last m.capture line of the >> render method needs to be adjusted (not sure what a[0] should be replaced >> with. So far I have temporarily replaced the line by: >> s = m.capture{send(:layout){s}} if m.respond_to?(:layout) >> >> In the blog.rb example >> - the version number for camping needs to be updated >> - require 'camping/db' should be removed since now obsolete >> - require 'markaby' needs to be added >> >> So far I can bring up the app in a browser, login, add a post. >> But if I use Restr I can only do a GET. The PUT currently fails with a >> 401. I will continue to try figuring it out over the next week or so. >> It would be great if the initial author could help us out. >> >> Philippe >> >> >> On 3/12/2010 8:04 AM, David Susco wrote: >> >> Has anyone managed to get camping to work with reststop using 1.9.354? >> >> >> >> >> >> _______________________________________________ >> 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From judofyr at gmail.com Tue Mar 23 11:58:46 2010 From: judofyr at gmail.com (Magnus Holm) Date: Tue, 23 Mar 2010 16:58:46 +0100 Subject: What now? In-Reply-To: <4BA832A1.30001@monnet-usa.com> References: <391a49da0908071238g24602d56wf52c3371dae950bd@mail.gmail.com> <391a49da0910171432h6d1ba565u6e3e12ddef33af67@mail.gmail.com> <38A727BD-2896-4D1B-8F1E-FD24C06476A0@innotts.co.uk> <4ADB1C76.9000706@monnet-usa.com> <4ADB97A3.4050201@monnet-usa.com> <4BA68A24.6050206@monnet-usa.com> <4F437D3B-A422-412A-9FFA-936E485C98C9@innotts.co.uk> <4BA832A1.30001@monnet-usa.com> Message-ID: <391a49da1003230858g6e3df615oe929136732d9c83b@mail.gmail.com> Indeed, but for now I think http://stuff.judofyr.net/camping-docs/ (or, the URL would actually be camping.rubyforge.org when released) would be enough. I think we're pretty much ready for a release. If you'd like, I could mark HEAD as 2.0.rc1 and push it out to Gemcutter. Then you guys who have 2.0 apps could do a "gem install camping --pre" and make sure everything works. If everything seems fine we can release it :) // Magnus Holm On Tue, Mar 23, 2010 at 04:16, Philippe Monnet wrote: > I like the idea of the site being built on Camping and combining > mini-apps and static content all integrated with jQuery for example. I am > currently running two Camping 2.0 apps on Heroku and they work great. > Hosting on Heroku would be also be convenient because of the ability to add > Git contributors and because of the ease of deployment. > > > On 3/21/2010 3:58 PM, Dave Everitt wrote: > > Hi Philippe > > I am one of those Camping friends (although I've been too busy with clients > just lately to do much). Although I just posted links to your Camping > 'add-ons' to the wiki :-) > > I agree about Sinatra - from curiosity I've even dabbled with it myself > (shame!), although it is nice that Camping still has a small community feel. > Perhaps some _why-type cartoons (along the lines you suggest) might be the > right way forward for a 'This is Camping' website. Or just keep things clean > and minimal. > > As for content, that was covered in another post to the list some time ago, > as was a domain name. Magnus has the substance (tutorial, examples, etc.) > and a nice CSS style for the blog example. Maybe start with a developed > version of the Camping blog on Heroku (free) so we can each add > Camping-related posts to keep things fresh? > > It's just making enough time to put it all together... I'd be happy to chip > in, but what's the best way to build a whole site that uses Camping - a > collection of apps and generated static pages? I once used Camping 1.5 > (running as CGI) as an easy way to make a simple multipage wireframe mockup, > but... > > Dave > > I was wondering how we can help with next steps? > I keep seeing all the attention going to the Sinatra framework (and Rails > of course) and would love to help more with promoting Camping. It would be > great if one of our web designer / Camping friend could help create a catchy > visual for the site. How about a night time view of a camp fire with a tent > and maybe a small projector with a big silver screen where we could display > rotating content / slides? Any other crazy concepts? > > Philippe > > > _______________________________________________ > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt at roughest.net Tue Mar 23 12:01:03 2010 From: matt at roughest.net (Matt Zukowski) Date: Tue, 23 Mar 2010 12:01:03 -0400 Subject: restful camping with reststop In-Reply-To: <391a49da1003230850l4088dd03w7a0ac82dc780d590@mail.gmail.com> References: <1bd79b4a1003120704y6cec851ey65c1cd1e736255b6@mail.gmail.com> <4BA83643.1090804@monnet-usa.com> <1d87b3641003230807h59eb25a6r2d9318abd6c6429b@mail.gmail.com> <391a49da1003230850l4088dd03w7a0ac82dc780d590@mail.gmail.com> Message-ID: <1d87b3641003230901y4187ca03n719d3864ef60f9e9@mail.gmail.com> Hey Magnus, while we have your attention, in 2.0 how do I get access to e['REQUEST_METHOD'] inside the 'service' method? Trying to figure this out as we speak... On Tue, Mar 23, 2010 at 11:50 AM, Magnus Holm wrote: > I find extending Camping apps to be quite easy, since it's all classes and > modules, but I can understand that extending Camping itself can be > difficult/weird. That said, I think a lot can be solved by defining > #included and #extended. It would be great if you could tell us a bit > exactly the problems you faced. We still have 1k left. > > Don't hurry, though. Let's get 2.0 out first. > > // Magnus Holm > > > > On Tue, Mar 23, 2010 at 16:07, Matt Zukowski wrote: > >> I actually have a reststop app up and running fine with Camping 2.0 (check >> out Taskr at http://github.com/zuk/taskr). Tthe catch is that it's a >> version of 2.0 that I forked about this time last year, and looking at the >> github graph, Magnus has committed a whole slew of changes since then. So >> whatever broke Reststop must have been committed in the last 10 months or >> so. >> >> To be honest over the last year I've mostly switched form Camping to >> Sinatra (and lately to Node.js, which is really really cool by the way). The >> problem with Camping, for me, is that trying to extend it is a nightmare. I >> learned this the hard way while writing Reststop and Picnic. >> >> Anyway I have a bit of time right now, so since there seems to be some >> interest, I'll pull down the latest version of Camping and see if I can make >> it work with Reststop. I should also move Reststop to github while I'm at >> it. >> >> On Mon, Mar 22, 2010 at 11:32 PM, Philippe Monnet wrote: >> >>> Hi David, >>> >>> I had played with RESTstop on the old Camping maybe six months ago. >>> I have now started to take a look at what the issues are about. >>> So far I have found a few things like: >>> >>> In reststop.rb: >>> - the service method needs to retrieve the REQUEST_METHOD using >>> @env['REQUEST_METHOD'] >>> -the condition on the if statement on the last m.capture line of the >>> render method needs to be adjusted (not sure what a[0] should be replaced >>> with. So far I have temporarily replaced the line by: >>> s = m.capture{send(:layout){s}} if m.respond_to?(:layout) >>> >>> In the blog.rb example >>> - the version number for camping needs to be updated >>> - require 'camping/db' should be removed since now obsolete >>> - require 'markaby' needs to be added >>> >>> So far I can bring up the app in a browser, login, add a post. >>> But if I use Restr I can only do a GET. The PUT currently fails with a >>> 401. I will continue to try figuring it out over the next week or so. >>> It would be great if the initial author could help us out. >>> >>> Philippe >>> >>> >>> On 3/12/2010 8:04 AM, David Susco wrote: >>> >>> Has anyone managed to get camping to work with reststop using 1.9.354? >>> >>> >>> >>> >>> >>> _______________________________________________ >>> 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 at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > -------------- next part -------------- An HTML attachment was scrubbed... URL: From judofyr at gmail.com Tue Mar 23 12:05:23 2010 From: judofyr at gmail.com (Magnus Holm) Date: Tue, 23 Mar 2010 17:05:23 +0100 Subject: restful camping with reststop In-Reply-To: <1d87b3641003230901y4187ca03n719d3864ef60f9e9@mail.gmail.com> References: <1bd79b4a1003120704y6cec851ey65c1cd1e736255b6@mail.gmail.com> <4BA83643.1090804@monnet-usa.com> <1d87b3641003230807h59eb25a6r2d9318abd6c6429b@mail.gmail.com> <391a49da1003230850l4088dd03w7a0ac82dc780d590@mail.gmail.com> <1d87b3641003230901y4187ca03n719d3864ef60f9e9@mail.gmail.com> Message-ID: <391a49da1003230905q66573e68k762fd3dbd745ef19@mail.gmail.com> @env['REQUEST_METHOD'] is the HTTP method send by the client, @method is the method (in lowercase) Camping is going to run ("r404" for 404 etc.) // Magnus Holm On Tue, Mar 23, 2010 at 17:01, Matt Zukowski wrote: > Hey Magnus, while we have your attention, in 2.0 how do I get access to > e['REQUEST_METHOD'] inside the 'service' method? Trying to figure this out > as we speak... > > > On Tue, Mar 23, 2010 at 11:50 AM, Magnus Holm wrote: > >> I find extending Camping apps to be quite easy, since it's all classes and >> modules, but I can understand that extending Camping itself can be >> difficult/weird. That said, I think a lot can be solved by defining >> #included and #extended. It would be great if you could tell us a bit >> exactly the problems you faced. We still have 1k left. >> >> Don't hurry, though. Let's get 2.0 out first. >> >> // Magnus Holm >> >> >> >> On Tue, Mar 23, 2010 at 16:07, Matt Zukowski wrote: >> >>> I actually have a reststop app up and running fine with Camping 2.0 >>> (check out Taskr at http://github.com/zuk/taskr). Tthe catch is that >>> it's a version of 2.0 that I forked about this time last year, and looking >>> at the github graph, Magnus has committed a whole slew of changes since >>> then. So whatever broke Reststop must have been committed in the last 10 >>> months or so. >>> >>> To be honest over the last year I've mostly switched form Camping to >>> Sinatra (and lately to Node.js, which is really really cool by the way). The >>> problem with Camping, for me, is that trying to extend it is a nightmare. I >>> learned this the hard way while writing Reststop and Picnic. >>> >>> Anyway I have a bit of time right now, so since there seems to be some >>> interest, I'll pull down the latest version of Camping and see if I can make >>> it work with Reststop. I should also move Reststop to github while I'm at >>> it. >>> >>> On Mon, Mar 22, 2010 at 11:32 PM, Philippe Monnet wrote: >>> >>>> Hi David, >>>> >>>> I had played with RESTstop on the old Camping maybe six months ago. >>>> I have now started to take a look at what the issues are about. >>>> So far I have found a few things like: >>>> >>>> In reststop.rb: >>>> - the service method needs to retrieve the REQUEST_METHOD using >>>> @env['REQUEST_METHOD'] >>>> -the condition on the if statement on the last m.capture line of the >>>> render method needs to be adjusted (not sure what a[0] should be replaced >>>> with. So far I have temporarily replaced the line by: >>>> s = m.capture{send(:layout){s}} if m.respond_to?(:layout) >>>> >>>> In the blog.rb example >>>> - the version number for camping needs to be updated >>>> - require 'camping/db' should be removed since now obsolete >>>> - require 'markaby' needs to be added >>>> >>>> So far I can bring up the app in a browser, login, add a post. >>>> But if I use Restr I can only do a GET. The PUT currently fails with a >>>> 401. I will continue to try figuring it out over the next week or so. >>>> It would be great if the initial author could help us out. >>>> >>>> Philippe >>>> >>>> >>>> On 3/12/2010 8:04 AM, David Susco wrote: >>>> >>>> Has anyone managed to get camping to work with reststop using 1.9.354? >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> 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 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt at roughest.net Tue Mar 23 12:23:53 2010 From: matt at roughest.net (Matt Zukowski) Date: Tue, 23 Mar 2010 12:23:53 -0400 Subject: restful camping with reststop In-Reply-To: <391a49da1003230905q66573e68k762fd3dbd745ef19@mail.gmail.com> References: <1bd79b4a1003120704y6cec851ey65c1cd1e736255b6@mail.gmail.com> <4BA83643.1090804@monnet-usa.com> <1d87b3641003230807h59eb25a6r2d9318abd6c6429b@mail.gmail.com> <391a49da1003230850l4088dd03w7a0ac82dc780d590@mail.gmail.com> <1d87b3641003230901y4187ca03n719d3864ef60f9e9@mail.gmail.com> <391a49da1003230905q66573e68k762fd3dbd745ef19@mail.gmail.com> Message-ID: <1d87b3641003230923v6ffe89bcxc769743e55204330@mail.gmail.com> Okay got it... but as I look at this a bit more, the ridiculous things I had to do to make Reststop work (for Camping 1.0) are all coming back to me. As I recall, the root of all evil was Camping#goes. I had to override it in order to inject the Reststop code into Camping. Camping#qsp was the second evil, and I see that it's now gone. I'm looking around now to see what you've done to replace it (I take it Rack took care of some of that). On Tue, Mar 23, 2010 at 12:05 PM, Magnus Holm wrote: > @env['REQUEST_METHOD'] is the HTTP method send by the client, @method is > the method (in lowercase) Camping is going to run ("r404" for 404 etc.) > > // Magnus Holm > > > > On Tue, Mar 23, 2010 at 17:01, Matt Zukowski wrote: > >> Hey Magnus, while we have your attention, in 2.0 how do I get access to >> e['REQUEST_METHOD'] inside the 'service' method? Trying to figure this out >> as we speak... >> >> >> On Tue, Mar 23, 2010 at 11:50 AM, Magnus Holm wrote: >> >>> I find extending Camping apps to be quite easy, since it's all classes >>> and modules, but I can understand that extending Camping itself can be >>> difficult/weird. That said, I think a lot can be solved by defining >>> #included and #extended. It would be great if you could tell us a bit >>> exactly the problems you faced. We still have 1k left. >>> >>> Don't hurry, though. Let's get 2.0 out first. >>> >>> // Magnus Holm >>> >>> >>> >>> On Tue, Mar 23, 2010 at 16:07, Matt Zukowski wrote: >>> >>>> I actually have a reststop app up and running fine with Camping 2.0 >>>> (check out Taskr at http://github.com/zuk/taskr). Tthe catch is that >>>> it's a version of 2.0 that I forked about this time last year, and looking >>>> at the github graph, Magnus has committed a whole slew of changes since >>>> then. So whatever broke Reststop must have been committed in the last 10 >>>> months or so. >>>> >>>> To be honest over the last year I've mostly switched form Camping to >>>> Sinatra (and lately to Node.js, which is really really cool by the way). The >>>> problem with Camping, for me, is that trying to extend it is a nightmare. I >>>> learned this the hard way while writing Reststop and Picnic. >>>> >>>> Anyway I have a bit of time right now, so since there seems to be some >>>> interest, I'll pull down the latest version of Camping and see if I can make >>>> it work with Reststop. I should also move Reststop to github while I'm at >>>> it. >>>> >>>> On Mon, Mar 22, 2010 at 11:32 PM, Philippe Monnet wrote: >>>> >>>>> Hi David, >>>>> >>>>> I had played with RESTstop on the old Camping maybe six months ago. >>>>> I have now started to take a look at what the issues are about. >>>>> So far I have found a few things like: >>>>> >>>>> In reststop.rb: >>>>> - the service method needs to retrieve the REQUEST_METHOD using >>>>> @env['REQUEST_METHOD'] >>>>> -the condition on the if statement on the last m.capture line of the >>>>> render method needs to be adjusted (not sure what a[0] should be replaced >>>>> with. So far I have temporarily replaced the line by: >>>>> s = m.capture{send(:layout){s}} if m.respond_to?(:layout) >>>>> >>>>> In the blog.rb example >>>>> - the version number for camping needs to be updated >>>>> - require 'camping/db' should be removed since now obsolete >>>>> - require 'markaby' needs to be added >>>>> >>>>> So far I can bring up the app in a browser, login, add a post. >>>>> But if I use Restr I can only do a GET. The PUT currently fails with a >>>>> 401. I will continue to try figuring it out over the next week or so. >>>>> It would be great if the initial author could help us out. >>>>> >>>>> Philippe >>>>> >>>>> >>>>> On 3/12/2010 8:04 AM, David Susco wrote: >>>>> >>>>> Has anyone managed to get camping to work with reststop using 1.9.354? >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> 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 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 at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > -------------- next part -------------- An HTML attachment was scrubbed... URL: From judofyr at gmail.com Tue Mar 23 12:36:01 2010 From: judofyr at gmail.com (Magnus Holm) Date: Tue, 23 Mar 2010 17:36:01 +0100 Subject: restful camping with reststop In-Reply-To: <1d87b3641003230923v6ffe89bcxc769743e55204330@mail.gmail.com> References: <1bd79b4a1003120704y6cec851ey65c1cd1e736255b6@mail.gmail.com> <4BA83643.1090804@monnet-usa.com> <1d87b3641003230807h59eb25a6r2d9318abd6c6429b@mail.gmail.com> <391a49da1003230850l4088dd03w7a0ac82dc780d590@mail.gmail.com> <1d87b3641003230901y4187ca03n719d3864ef60f9e9@mail.gmail.com> <391a49da1003230905q66573e68k762fd3dbd745ef19@mail.gmail.com> <1d87b3641003230923v6ffe89bcxc769743e55204330@mail.gmail.com> Message-ID: <391a49da1003230936o7f25e429l3031057a38ef7ef4@mail.gmail.com> code = %q{ # This Ruby code will be called everytime Camping.goes is called. # And "Camping" is replaced with the app module, so you can do stuff like: def Camping.foo puts "Hello World!" end # You probably just want to do: module Camping include MyExtension end } # For Camping.goes Camping::S << code # For previus Camping.goes Camping::Apps.each { |app| app.module_eval(code.gsub("Camping", app.to_s)) } As for qsp, it's replaced by Rack::Utils.parse_query. This creates a regular Hash though, so I've written a Base#n to convert it to Camping::H. # Before: hash = Camping.qsp("hoho=1") # Now: (inside an instance of a controller) hash = n(Rack::Utils.parse_query("hoho=1")) // Magnus Holm On Tue, Mar 23, 2010 at 17:23, Matt Zukowski wrote: > Okay got it... but as I look at this a bit more, the ridiculous things I > had to do to make Reststop work (for Camping 1.0) are all coming back to me. > > As I recall, the root of all evil was Camping#goes. I had to override it in > order to inject the Reststop code into Camping. Camping#qsp was the second > evil, and I see that it's now gone. I'm looking around now to see what > you've done to replace it (I take it Rack took care of some of that). > > > On Tue, Mar 23, 2010 at 12:05 PM, Magnus Holm wrote: > >> @env['REQUEST_METHOD'] is the HTTP method send by the client, @method is >> the method (in lowercase) Camping is going to run ("r404" for 404 etc.) >> >> // Magnus Holm >> >> >> >> On Tue, Mar 23, 2010 at 17:01, Matt Zukowski wrote: >> >>> Hey Magnus, while we have your attention, in 2.0 how do I get access to >>> e['REQUEST_METHOD'] inside the 'service' method? Trying to figure this out >>> as we speak... >>> >>> >>> On Tue, Mar 23, 2010 at 11:50 AM, Magnus Holm wrote: >>> >>>> I find extending Camping apps to be quite easy, since it's all classes >>>> and modules, but I can understand that extending Camping itself can be >>>> difficult/weird. That said, I think a lot can be solved by defining >>>> #included and #extended. It would be great if you could tell us a bit >>>> exactly the problems you faced. We still have 1k left. >>>> >>>> Don't hurry, though. Let's get 2.0 out first. >>>> >>>> // Magnus Holm >>>> >>>> >>>> >>>> On Tue, Mar 23, 2010 at 16:07, Matt Zukowski wrote: >>>> >>>>> I actually have a reststop app up and running fine with Camping 2.0 >>>>> (check out Taskr at http://github.com/zuk/taskr). Tthe catch is that >>>>> it's a version of 2.0 that I forked about this time last year, and looking >>>>> at the github graph, Magnus has committed a whole slew of changes since >>>>> then. So whatever broke Reststop must have been committed in the last 10 >>>>> months or so. >>>>> >>>>> To be honest over the last year I've mostly switched form Camping to >>>>> Sinatra (and lately to Node.js, which is really really cool by the way). The >>>>> problem with Camping, for me, is that trying to extend it is a nightmare. I >>>>> learned this the hard way while writing Reststop and Picnic. >>>>> >>>>> Anyway I have a bit of time right now, so since there seems to be some >>>>> interest, I'll pull down the latest version of Camping and see if I can make >>>>> it work with Reststop. I should also move Reststop to github while I'm at >>>>> it. >>>>> >>>>> On Mon, Mar 22, 2010 at 11:32 PM, Philippe Monnet >>>> > wrote: >>>>> >>>>>> Hi David, >>>>>> >>>>>> I had played with RESTstop on the old Camping maybe six months ago. >>>>>> I have now started to take a look at what the issues are about. >>>>>> So far I have found a few things like: >>>>>> >>>>>> In reststop.rb: >>>>>> - the service method needs to retrieve the REQUEST_METHOD using >>>>>> @env['REQUEST_METHOD'] >>>>>> -the condition on the if statement on the last m.capture line of the >>>>>> render method needs to be adjusted (not sure what a[0] should be replaced >>>>>> with. So far I have temporarily replaced the line by: >>>>>> s = m.capture{send(:layout){s}} if m.respond_to?(:layout) >>>>>> >>>>>> In the blog.rb example >>>>>> - the version number for camping needs to be updated >>>>>> - require 'camping/db' should be removed since now obsolete >>>>>> - require 'markaby' needs to be added >>>>>> >>>>>> So far I can bring up the app in a browser, login, add a post. >>>>>> But if I use Restr I can only do a GET. The PUT currently fails with a >>>>>> 401. I will continue to try figuring it out over the next week or so. >>>>>> It would be great if the initial author could help us out. >>>>>> >>>>>> Philippe >>>>>> >>>>>> >>>>>> On 3/12/2010 8:04 AM, David Susco wrote: >>>>>> >>>>>> Has anyone managed to get camping to work with reststop using 1.9.354? >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> 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 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 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt at roughest.net Tue Mar 23 15:49:51 2010 From: matt at roughest.net (Matt Zukowski) Date: Tue, 23 Mar 2010 15:49:51 -0400 Subject: restful camping with reststop In-Reply-To: <391a49da1003230936o7f25e429l3031057a38ef7ef4@mail.gmail.com> References: <1bd79b4a1003120704y6cec851ey65c1cd1e736255b6@mail.gmail.com> <4BA83643.1090804@monnet-usa.com> <1d87b3641003230807h59eb25a6r2d9318abd6c6429b@mail.gmail.com> <391a49da1003230850l4088dd03w7a0ac82dc780d590@mail.gmail.com> <1d87b3641003230901y4187ca03n719d3864ef60f9e9@mail.gmail.com> <391a49da1003230905q66573e68k762fd3dbd745ef19@mail.gmail.com> <1d87b3641003230923v6ffe89bcxc769743e55204330@mail.gmail.com> <391a49da1003230936o7f25e429l3031057a38ef7ef4@mail.gmail.com> Message-ID: <1d87b3641003231249s30dd7c77t8276929d305a84a7@mail.gmail.com> Alright I spent a few hours trying to see if I can make things work with 2.0. I was able to make some progress (mostly thanks to Magnus' help!) but ran out of time before I could get things runnings. Here's the result: http://gist.github.com/341555 I'm not sure when I will get a chance in the near future to play around with this again, but if someone wants to take it and run with it I'd be happy to help. Matt. On Tue, Mar 23, 2010 at 12:36 PM, Magnus Holm wrote: > code = %q{ > # This Ruby code will be called everytime Camping.goes is called. > # And "Camping" is replaced with the app module, so you can do stuff like: > def Camping.foo > puts "Hello World!" > end > > # You probably just want to do: > module Camping > include MyExtension > end > } > > # For Camping.goes > Camping::S << code > # For previus Camping.goes > Camping::Apps.each { |app| app.module_eval(code.gsub("Camping", app.to_s)) > } > > As for qsp, it's replaced by Rack::Utils.parse_query. This creates a > regular Hash though, so I've written a Base#n to convert it to Camping::H. > > # Before: > hash = Camping.qsp("hoho=1") > # Now: (inside an instance of a controller) > hash = n(Rack::Utils.parse_query("hoho=1")) > > > // Magnus Holm > > > > On Tue, Mar 23, 2010 at 17:23, Matt Zukowski wrote: > >> Okay got it... but as I look at this a bit more, the ridiculous things I >> had to do to make Reststop work (for Camping 1.0) are all coming back to me. >> >> As I recall, the root of all evil was Camping#goes. I had to override it >> in order to inject the Reststop code into Camping. Camping#qsp was the >> second evil, and I see that it's now gone. I'm looking around now to see >> what you've done to replace it (I take it Rack took care of some of that). >> >> >> On Tue, Mar 23, 2010 at 12:05 PM, Magnus Holm wrote: >> >>> @env['REQUEST_METHOD'] is the HTTP method send by the client, @method is >>> the method (in lowercase) Camping is going to run ("r404" for 404 etc.) >>> >>> // Magnus Holm >>> >>> >>> >>> On Tue, Mar 23, 2010 at 17:01, Matt Zukowski wrote: >>> >>>> Hey Magnus, while we have your attention, in 2.0 how do I get access to >>>> e['REQUEST_METHOD'] inside the 'service' method? Trying to figure this out >>>> as we speak... >>>> >>>> >>>> On Tue, Mar 23, 2010 at 11:50 AM, Magnus Holm wrote: >>>> >>>>> I find extending Camping apps to be quite easy, since it's all classes >>>>> and modules, but I can understand that extending Camping itself can be >>>>> difficult/weird. That said, I think a lot can be solved by defining >>>>> #included and #extended. It would be great if you could tell us a bit >>>>> exactly the problems you faced. We still have 1k left. >>>>> >>>>> Don't hurry, though. Let's get 2.0 out first. >>>>> >>>>> // Magnus Holm >>>>> >>>>> >>>>> >>>>> On Tue, Mar 23, 2010 at 16:07, Matt Zukowski wrote: >>>>> >>>>>> I actually have a reststop app up and running fine with Camping 2.0 >>>>>> (check out Taskr at http://github.com/zuk/taskr). Tthe catch is that >>>>>> it's a version of 2.0 that I forked about this time last year, and looking >>>>>> at the github graph, Magnus has committed a whole slew of changes since >>>>>> then. So whatever broke Reststop must have been committed in the last 10 >>>>>> months or so. >>>>>> >>>>>> To be honest over the last year I've mostly switched form Camping to >>>>>> Sinatra (and lately to Node.js, which is really really cool by the way). The >>>>>> problem with Camping, for me, is that trying to extend it is a nightmare. I >>>>>> learned this the hard way while writing Reststop and Picnic. >>>>>> >>>>>> Anyway I have a bit of time right now, so since there seems to be some >>>>>> interest, I'll pull down the latest version of Camping and see if I can make >>>>>> it work with Reststop. I should also move Reststop to github while I'm at >>>>>> it. >>>>>> >>>>>> On Mon, Mar 22, 2010 at 11:32 PM, Philippe Monnet < >>>>>> ruby at monnet-usa.com> wrote: >>>>>> >>>>>>> Hi David, >>>>>>> >>>>>>> I had played with RESTstop on the old Camping maybe six months ago. >>>>>>> I have now started to take a look at what the issues are about. >>>>>>> So far I have found a few things like: >>>>>>> >>>>>>> In reststop.rb: >>>>>>> - the service method needs to retrieve the REQUEST_METHOD using >>>>>>> @env['REQUEST_METHOD'] >>>>>>> -the condition on the if statement on the last m.capture line of >>>>>>> the render method needs to be adjusted (not sure what a[0] should be >>>>>>> replaced with. So far I have temporarily replaced the line by: >>>>>>> s = m.capture{send(:layout){s}} if m.respond_to?(:layout) >>>>>>> >>>>>>> In the blog.rb example >>>>>>> - the version number for camping needs to be updated >>>>>>> - require 'camping/db' should be removed since now obsolete >>>>>>> - require 'markaby' needs to be added >>>>>>> >>>>>>> So far I can bring up the app in a browser, login, add a post. >>>>>>> But if I use Restr I can only do a GET. The PUT currently fails with >>>>>>> a 401. I will continue to try figuring it out over the next week or so. >>>>>>> It would be great if the initial author could help us out. >>>>>>> >>>>>>> Philippe >>>>>>> >>>>>>> >>>>>>> On 3/12/2010 8:04 AM, David Susco wrote: >>>>>>> >>>>>>> Has anyone managed to get camping to work with reststop using 1.9.354? >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> 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 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 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 at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt at roughest.net Tue Mar 23 15:50:37 2010 From: matt at roughest.net (Matt Zukowski) Date: Tue, 23 Mar 2010 15:50:37 -0400 Subject: restful camping with reststop In-Reply-To: <1d87b3641003231249s30dd7c77t8276929d305a84a7@mail.gmail.com> References: <1bd79b4a1003120704y6cec851ey65c1cd1e736255b6@mail.gmail.com> <4BA83643.1090804@monnet-usa.com> <1d87b3641003230807h59eb25a6r2d9318abd6c6429b@mail.gmail.com> <391a49da1003230850l4088dd03w7a0ac82dc780d590@mail.gmail.com> <1d87b3641003230901y4187ca03n719d3864ef60f9e9@mail.gmail.com> <391a49da1003230905q66573e68k762fd3dbd745ef19@mail.gmail.com> <1d87b3641003230923v6ffe89bcxc769743e55204330@mail.gmail.com> <391a49da1003230936o7f25e429l3031057a38ef7ef4@mail.gmail.com> <1d87b3641003231249s30dd7c77t8276929d305a84a7@mail.gmail.com> Message-ID: <1d87b3641003231250i2e309d3h294576983a9baba1@mail.gmail.com> Sorry that link should be: http://gist.github.com/341555#file_reststop2.rb On Tue, Mar 23, 2010 at 3:49 PM, Matt Zukowski wrote: > Alright I spent a few hours trying to see if I can make things work with > 2.0. > > I was able to make some progress (mostly thanks to Magnus' help!) but ran > out of time before I could get things runnings. > > Here's the result: > > http://gist.github.com/341555 > > I'm not sure when I will get a chance in the near future to play around > with this again, but if someone wants to take it and run with it I'd be > happy to help. > > Matt. > > > On Tue, Mar 23, 2010 at 12:36 PM, Magnus Holm wrote: > >> code = %q{ >> # This Ruby code will be called everytime Camping.goes is called. >> # And "Camping" is replaced with the app module, so you can do stuff like: >> def Camping.foo >> puts "Hello World!" >> end >> >> # You probably just want to do: >> module Camping >> include MyExtension >> end >> } >> >> # For Camping.goes >> Camping::S << code >> # For previus Camping.goes >> Camping::Apps.each { |app| app.module_eval(code.gsub("Camping", app.to_s)) >> } >> >> As for qsp, it's replaced by Rack::Utils.parse_query. This creates a >> regular Hash though, so I've written a Base#n to convert it to Camping::H. >> >> # Before: >> hash = Camping.qsp("hoho=1") >> # Now: (inside an instance of a controller) >> hash = n(Rack::Utils.parse_query("hoho=1")) >> >> >> // Magnus Holm >> >> >> >> On Tue, Mar 23, 2010 at 17:23, Matt Zukowski wrote: >> >>> Okay got it... but as I look at this a bit more, the ridiculous things I >>> had to do to make Reststop work (for Camping 1.0) are all coming back to me. >>> >>> As I recall, the root of all evil was Camping#goes. I had to override it >>> in order to inject the Reststop code into Camping. Camping#qsp was the >>> second evil, and I see that it's now gone. I'm looking around now to see >>> what you've done to replace it (I take it Rack took care of some of that). >>> >>> >>> On Tue, Mar 23, 2010 at 12:05 PM, Magnus Holm wrote: >>> >>>> @env['REQUEST_METHOD'] is the HTTP method send by the client, @method is >>>> the method (in lowercase) Camping is going to run ("r404" for 404 etc.) >>>> >>>> // Magnus Holm >>>> >>>> >>>> >>>> On Tue, Mar 23, 2010 at 17:01, Matt Zukowski wrote: >>>> >>>>> Hey Magnus, while we have your attention, in 2.0 how do I get access to >>>>> e['REQUEST_METHOD'] inside the 'service' method? Trying to figure this out >>>>> as we speak... >>>>> >>>>> >>>>> On Tue, Mar 23, 2010 at 11:50 AM, Magnus Holm wrote: >>>>> >>>>>> I find extending Camping apps to be quite easy, since it's all classes >>>>>> and modules, but I can understand that extending Camping itself can be >>>>>> difficult/weird. That said, I think a lot can be solved by defining >>>>>> #included and #extended. It would be great if you could tell us a bit >>>>>> exactly the problems you faced. We still have 1k left. >>>>>> >>>>>> Don't hurry, though. Let's get 2.0 out first. >>>>>> >>>>>> // Magnus Holm >>>>>> >>>>>> >>>>>> >>>>>> On Tue, Mar 23, 2010 at 16:07, Matt Zukowski wrote: >>>>>> >>>>>>> I actually have a reststop app up and running fine with Camping 2.0 >>>>>>> (check out Taskr at http://github.com/zuk/taskr). Tthe catch is that >>>>>>> it's a version of 2.0 that I forked about this time last year, and looking >>>>>>> at the github graph, Magnus has committed a whole slew of changes since >>>>>>> then. So whatever broke Reststop must have been committed in the last 10 >>>>>>> months or so. >>>>>>> >>>>>>> To be honest over the last year I've mostly switched form Camping to >>>>>>> Sinatra (and lately to Node.js, which is really really cool by the way). The >>>>>>> problem with Camping, for me, is that trying to extend it is a nightmare. I >>>>>>> learned this the hard way while writing Reststop and Picnic. >>>>>>> >>>>>>> Anyway I have a bit of time right now, so since there seems to be >>>>>>> some interest, I'll pull down the latest version of Camping and see if I can >>>>>>> make it work with Reststop. I should also move Reststop to github while I'm >>>>>>> at it. >>>>>>> >>>>>>> On Mon, Mar 22, 2010 at 11:32 PM, Philippe Monnet < >>>>>>> ruby at monnet-usa.com> wrote: >>>>>>> >>>>>>>> Hi David, >>>>>>>> >>>>>>>> I had played with RESTstop on the old Camping maybe six months ago. >>>>>>>> I have now started to take a look at what the issues are about. >>>>>>>> So far I have found a few things like: >>>>>>>> >>>>>>>> In reststop.rb: >>>>>>>> - the service method needs to retrieve the REQUEST_METHOD using >>>>>>>> @env['REQUEST_METHOD'] >>>>>>>> -the condition on the if statement on the last m.capture line of >>>>>>>> the render method needs to be adjusted (not sure what a[0] should be >>>>>>>> replaced with. So far I have temporarily replaced the line by: >>>>>>>> s = m.capture{send(:layout){s}} if m.respond_to?(:layout) >>>>>>>> >>>>>>>> In the blog.rb example >>>>>>>> - the version number for camping needs to be updated >>>>>>>> - require 'camping/db' should be removed since now obsolete >>>>>>>> - require 'markaby' needs to be added >>>>>>>> >>>>>>>> So far I can bring up the app in a browser, login, add a post. >>>>>>>> But if I use Restr I can only do a GET. The PUT currently fails with >>>>>>>> a 401. I will continue to try figuring it out over the next week or so. >>>>>>>> It would be great if the initial author could help us out. >>>>>>>> >>>>>>>> Philippe >>>>>>>> >>>>>>>> >>>>>>>> On 3/12/2010 8:04 AM, David Susco wrote: >>>>>>>> >>>>>>>> Has anyone managed to get camping to work with reststop using 1.9.354? >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> 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 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 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 at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruby at monnet-usa.com Wed Mar 24 07:23:07 2010 From: ruby at monnet-usa.com (Philippe Monnet) Date: Wed, 24 Mar 2010 05:23:07 -0600 Subject: What now? In-Reply-To: <391a49da1003230858g6e3df615oe929136732d9c83b@mail.gmail.com> References: <391a49da0908071238g24602d56wf52c3371dae950bd@mail.gmail.com> <391a49da0910171432h6d1ba565u6e3e12ddef33af67@mail.gmail.com> <38A727BD-2896-4D1B-8F1E-FD24C06476A0@innotts.co.uk> <4ADB1C76.9000706@monnet-usa.com> <4ADB97A3.4050201@monnet-usa.com> <4BA68A24.6050206@monnet-usa.com> <4F437D3B-A422-412A-9FFA-936E485C98C9@innotts.co.uk> <4BA832A1.30001@monnet-usa.com> <391a49da1003230858g6e3df615oe929136732d9c83b@mail.gmail.com> Message-ID: <4BA9F61B.20109@monnet-usa.com> Having a new official release would be great especially since Sinatra published their 1.0 release yesterday. ;-) The new Rubyforge page would be nice but wouldn't a more marketing-centric site help increase adoption? On 3/23/2010 9:58 AM, Magnus Holm wrote: > Indeed, but for now I think http://stuff.judofyr.net/camping-docs/ > (or, the URL would actually be camping.rubyforge.org > when released) would be enough. > > I think we're pretty much ready for a release. If you'd like, I could > mark HEAD as 2.0.rc1 and push it out to Gemcutter. Then you guys who > have 2.0 apps could do a "gem install camping --pre" and make sure > everything works. If everything seems fine we can release it :) > > > // Magnus Holm > > > On Tue, Mar 23, 2010 at 04:16, Philippe Monnet > wrote: > > I like the idea of the site being built on Camping and combining > mini-apps and static content all integrated with jQuery for > example. I am currently running two Camping 2.0 apps on Heroku and > they work great. Hosting on Heroku would be also be convenient > because of the ability to add Git contributors and because of the > ease of deployment. > > > On 3/21/2010 3:58 PM, Dave Everitt wrote: >> Hi Philippe >> >> I am one of those Camping friends (although I've been too busy >> with clients just lately to do much). Although I just posted >> links to your Camping 'add-ons' to the wiki :-) >> >> I agree about Sinatra - from curiosity I've even dabbled with it >> myself (shame!), although it is nice that Camping still has a >> small community feel. Perhaps some _why-type cartoons (along the >> lines you suggest) might be the right way forward for a 'This is >> Camping' website. Or just keep things clean and minimal. >> >> As for content, that was covered in another post to the list some >> time ago, as was a domain name. Magnus has the substance >> (tutorial, examples, etc.) and a nice CSS style for the blog >> example. Maybe start with a developed version of the Camping blog >> on Heroku (free) so we can each add Camping-related posts to keep >> things fresh? >> >> It's just making enough time to put it all together... I'd be >> happy to chip in, but what's the best way to build a whole site >> that uses Camping - a collection of apps and generated static >> pages? I once used Camping 1.5 (running as CGI) as an easy way to >> make a simple multipage wireframe mockup, but... >> >> Dave >> >>> I was wondering how we can help with next steps? >>> I keep seeing all the attention going to the Sinatra framework >>> (and Rails of course) and would love to help more with promoting >>> Camping. It would be great if one of our web designer / Camping >>> friend could help create a catchy visual for the site. How about >>> a night time view of a camp fire with a tent and maybe a small >>> projector with a big silver screen where we could display >>> rotating content / slides? Any other crazy concepts? >>> >>> Philippe >> >> _______________________________________________ >> 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 at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruby at monnet-usa.com Wed Mar 24 23:37:51 2010 From: ruby at monnet-usa.com (Philippe Monnet) Date: Wed, 24 Mar 2010 21:37:51 -0600 Subject: restful camping with reststop In-Reply-To: <1d87b3641003231249s30dd7c77t8276929d305a84a7@mail.gmail.com> References: <1bd79b4a1003120704y6cec851ey65c1cd1e736255b6@mail.gmail.com> <4BA83643.1090804@monnet-usa.com> <1d87b3641003230807h59eb25a6r2d9318abd6c6429b@mail.gmail.com> <391a49da1003230850l4088dd03w7a0ac82dc780d590@mail.gmail.com> <1d87b3641003230901y4187ca03n719d3864ef60f9e9@mail.gmail.com> <391a49da1003230905q66573e68k762fd3dbd745ef19@mail.gmail.com> <1d87b3641003230923v6ffe89bcxc769743e55204330@mail.gmail.com> <391a49da1003230936o7f25e429l3031057a38ef7ef4@mail.gmail.com> <1d87b3641003231249s30dd7c77t8276929d305a84a7@mail.gmail.com> Message-ID: <4BAADA8F.3070109@monnet-usa.com> Matt, Thanks for the head start on the port to 2.0. I have started to finish it and am about 95% there. At this point I can run through all browser-based scenarios and have started some of the Restr-based scenarios. I am now trying to figure out how to do the authentication bit for the PUT scenarios. I hope to complete this by the end of the week-end. Philippe On 3/23/2010 1:49 PM, Matt Zukowski wrote: > Alright I spent a few hours trying to see if I can make things work > with 2.0. > > I was able to make some progress (mostly thanks to Magnus' help!) but > ran out of time before I could get things runnings. > > Here's the result: > > http://gist.github.com/341555 > > I'm not sure when I will get a chance in the near future to play > around with this again, but if someone wants to take it and run with > it I'd be happy to help. > > Matt. > > On Tue, Mar 23, 2010 at 12:36 PM, Magnus Holm > wrote: > > code = %q{ > # This Ruby code will be called everytime Camping.goes is called. > # And "Camping" is replaced with the app module, so you can do > stuff like: > def Camping.foo > puts "Hello World!" > end > > # You probably just want to do: > module Camping > include MyExtension > end > } > > # For Camping.goes > Camping::S << code > # For previus Camping.goes > Camping::Apps.each { |app| app.module_eval(code.gsub("Camping", > app.to_s)) } > > As for qsp, it's replaced by Rack::Utils.parse_query. This creates > a regular Hash though, so I've written a Base#n to convert it to > Camping::H. > > # Before: > hash = Camping.qsp("hoho=1") > # Now: (inside an instance of a controller) > hash = n(Rack::Utils.parse_query("hoho=1")) > > > // Magnus Holm > > > > On Tue, Mar 23, 2010 at 17:23, Matt Zukowski > wrote: > > Okay got it... but as I look at this a bit more, the > ridiculous things I had to do to make Reststop work (for > Camping 1.0) are all coming back to me. > > As I recall, the root of all evil was Camping#goes. I had to > override it in order to inject the Reststop code into Camping. > Camping#qsp was the second evil, and I see that it's now gone. > I'm looking around now to see what you've done to replace it > (I take it Rack took care of some of that). > > > On Tue, Mar 23, 2010 at 12:05 PM, Magnus Holm > > wrote: > > @env['REQUEST_METHOD'] is the HTTP method send by the > client, @method is the method (in lowercase) Camping is > going to run ("r404" for 404 etc.) > > // Magnus Holm > > > > On Tue, Mar 23, 2010 at 17:01, Matt Zukowski > > wrote: > > Hey Magnus, while we have your attention, in 2.0 how > do I get access to e['REQUEST_METHOD'] inside the > 'service' method? Trying to figure this out as we > speak... > > > On Tue, Mar 23, 2010 at 11:50 AM, Magnus Holm > > wrote: > > I find extending Camping apps to be quite easy, > since it's all classes and modules, but I can > understand that extending Camping itself can be > difficult/weird. That said, I think a lot can be > solved by defining #included and #extended. It > would be great if you could tell us a bit exactly > the problems you faced. We still have 1k left. > > Don't hurry, though. Let's get 2.0 out first. > > // Magnus Holm > > > > On Tue, Mar 23, 2010 at 16:07, Matt Zukowski > > wrote: > > I actually have a reststop app up and running > fine with Camping 2.0 (check out Taskr at > http://github.com/zuk/taskr). Tthe catch is > that it's a version of 2.0 that I forked about > this time last year, and looking at the github > graph, Magnus has committed a whole slew of > changes since then. So whatever broke Reststop > must have been committed in the last 10 months > or so. > > To be honest over the last year I've mostly > switched form Camping to Sinatra (and lately > to Node.js, which is really really cool by the > way). The problem with Camping, for me, is > that trying to extend it is a nightmare. I > learned this the hard way while writing > Reststop and Picnic. > > Anyway I have a bit of time right now, so > since there seems to be some interest, I'll > pull down the latest version of Camping and > see if I can make it work with Reststop. I > should also move Reststop to github while I'm > at it. > > On Mon, Mar 22, 2010 at 11:32 PM, Philippe > Monnet > wrote: > > Hi David, > > I had played with RESTstop on the old > Camping maybe six months ago. > I have now started to take a look at what > the issues are about. > So far I have found a few things like: > > In reststop.rb: > - the service method needs to retrieve > the REQUEST_METHOD using > @env['REQUEST_METHOD'] > -the condition on the if statement on > the last m.capture line of the render > method needs to be adjusted (not sure what > a[0] should be replaced with. So far I > have temporarily replaced the line by: > s = m.capture{send(:layout){s}} if > m.respond_to?(:layout) > > In the blog.rb example > - the version number for camping needs > to be updated > - require 'camping/db' should be removed > since now obsolete > - require 'markaby' needs to be added > > So far I can bring up the app in a > browser, login, add a post. > But if I use Restr I can only do a GET. > The PUT currently fails with a 401. I will > continue to try figuring it out over the > next week or so. > It would be great if the initial author > could help us out. > > Philippe > > > On 3/12/2010 8:04 AM, David Susco wrote: >> Has anyone managed to get camping to work with reststop using 1.9.354? >> >> > > > _______________________________________________ > 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 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 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 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruby at monnet-usa.com Fri Mar 26 23:42:41 2010 From: ruby at monnet-usa.com (Philippe Monnet) Date: Fri, 26 Mar 2010 21:42:41 -0600 Subject: restful camping with reststop In-Reply-To: <4BAADA8F.3070109@monnet-usa.com> References: <1bd79b4a1003120704y6cec851ey65c1cd1e736255b6@mail.gmail.com> <4BA83643.1090804@monnet-usa.com> <1d87b3641003230807h59eb25a6r2d9318abd6c6429b@mail.gmail.com> <391a49da1003230850l4088dd03w7a0ac82dc780d590@mail.gmail.com> <1d87b3641003230901y4187ca03n719d3864ef60f9e9@mail.gmail.com> <391a49da1003230905q66573e68k762fd3dbd745ef19@mail.gmail.com> <1d87b3641003230923v6ffe89bcxc769743e55204330@mail.gmail.com> <391a49da1003230936o7f25e429l3031057a38ef7ef4@mail.gmail.com> <1d87b3641003231249s30dd7c77t8276929d305a84a7@mail.gmail.com> <4BAADA8F.3070109@monnet-usa.com> Message-ID: <4BAD7EB1.9050302@monnet-usa.com> Ok, after a few more code changes, I am now able to run through all browser-based scenarios and all *restr*-based scenarios. I have added a comment starting with /@techarch/ on all the lines I have changed. I have also updated *restr.rb* so that the cookie header can be exchanged back and forth. I created a *test.rb* with a few snippets to use in IRB using Restr. My gist is available at: http://gist.github.com/343058 Feel free to pick and choose/rewrite/optimize as needed when merging into Reststop. ;-) Philippe (@techarch on Twitter) On 3/24/2010 9:37 PM, Philippe Monnet wrote: > Matt, > > Thanks for the head start on the port to 2.0. > I have started to finish it and am about 95% there. > At this point I can run through all browser-based scenarios and have > started some of the Restr-based scenarios. I am now trying to figure > out how to do the authentication bit for the PUT scenarios. > I hope to complete this by the end of the week-end. > > Philippe > > On 3/23/2010 1:49 PM, Matt Zukowski wrote: >> Alright I spent a few hours trying to see if I can make things work >> with 2.0. >> >> I was able to make some progress (mostly thanks to Magnus' help!) but >> ran out of time before I could get things runnings. >> >> Here's the result: >> >> http://gist.github.com/341555 >> >> I'm not sure when I will get a chance in the near future to play >> around with this again, but if someone wants to take it and run with >> it I'd be happy to help. >> >> Matt. >> >> On Tue, Mar 23, 2010 at 12:36 PM, Magnus Holm > > wrote: >> >> code = %q{ >> # This Ruby code will be called everytime Camping.goes is called. >> # And "Camping" is replaced with the app module, so you can do >> stuff like: >> def Camping.foo >> puts "Hello World!" >> end >> >> # You probably just want to do: >> module Camping >> include MyExtension >> end >> } >> >> # For Camping.goes >> Camping::S << code >> # For previus Camping.goes >> Camping::Apps.each { |app| app.module_eval(code.gsub("Camping", >> app.to_s)) } >> >> As for qsp, it's replaced by Rack::Utils.parse_query. This >> creates a regular Hash though, so I've written a Base#n to >> convert it to Camping::H. >> >> # Before: >> hash = Camping.qsp("hoho=1") >> # Now: (inside an instance of a controller) >> hash = n(Rack::Utils.parse_query("hoho=1")) >> >> >> // Magnus Holm >> >> >> >> On Tue, Mar 23, 2010 at 17:23, Matt Zukowski > > wrote: >> >> Okay got it... but as I look at this a bit more, the >> ridiculous things I had to do to make Reststop work (for >> Camping 1.0) are all coming back to me. >> >> As I recall, the root of all evil was Camping#goes. I had to >> override it in order to inject the Reststop code into >> Camping. Camping#qsp was the second evil, and I see that it's >> now gone. I'm looking around now to see what you've done to >> replace it (I take it Rack took care of some of that). >> >> >> On Tue, Mar 23, 2010 at 12:05 PM, Magnus Holm >> > wrote: >> >> @env['REQUEST_METHOD'] is the HTTP method send by the >> client, @method is the method (in lowercase) Camping is >> going to run ("r404" for 404 etc.) >> >> // Magnus Holm >> >> >> >> On Tue, Mar 23, 2010 at 17:01, Matt Zukowski >> > wrote: >> >> Hey Magnus, while we have your attention, in 2.0 how >> do I get access to e['REQUEST_METHOD'] inside the >> 'service' method? Trying to figure this out as we >> speak... >> >> >> On Tue, Mar 23, 2010 at 11:50 AM, Magnus Holm >> > wrote: >> >> I find extending Camping apps to be quite easy, >> since it's all classes and modules, but I can >> understand that extending Camping itself can be >> difficult/weird. That said, I think a lot can be >> solved by defining #included and #extended. It >> would be great if you could tell us a bit exactly >> the problems you faced. We still have 1k left. >> >> Don't hurry, though. Let's get 2.0 out first. >> >> // Magnus Holm >> >> >> >> On Tue, Mar 23, 2010 at 16:07, Matt Zukowski >> > wrote: >> >> I actually have a reststop app up and running >> fine with Camping 2.0 (check out Taskr at >> http://github.com/zuk/taskr). Tthe catch is >> that it's a version of 2.0 that I forked >> about this time last year, and looking at the >> github graph, Magnus has committed a whole >> slew of changes since then. So whatever broke >> Reststop must have been committed in the last >> 10 months or so. >> >> To be honest over the last year I've mostly >> switched form Camping to Sinatra (and lately >> to Node.js, which is really really cool by >> the way). The problem with Camping, for me, >> is that trying to extend it is a nightmare. I >> learned this the hard way while writing >> Reststop and Picnic. >> >> Anyway I have a bit of time right now, so >> since there seems to be some interest, I'll >> pull down the latest version of Camping and >> see if I can make it work with Reststop. I >> should also move Reststop to github while I'm >> at it. >> >> On Mon, Mar 22, 2010 at 11:32 PM, Philippe >> Monnet > > wrote: >> >> Hi David, >> >> I had played with RESTstop on the old >> Camping maybe six months ago. >> I have now started to take a look at what >> the issues are about. >> So far I have found a few things like: >> >> In reststop.rb: >> - the service method needs to retrieve >> the REQUEST_METHOD using >> @env['REQUEST_METHOD'] >> -the condition on the if statement on >> the last m.capture line of the render >> method needs to be adjusted (not sure >> what a[0] should be replaced with. So far >> I have temporarily replaced the line by: >> s = m.capture{send(:layout){s}} if >> m.respond_to?(:layout) >> >> In the blog.rb example >> - the version number for camping needs >> to be updated >> - require 'camping/db' should be >> removed since now obsolete >> - require 'markaby' needs to be added >> >> So far I can bring up the app in a >> browser, login, add a post. >> But if I use Restr I can only do a GET. >> The PUT currently fails with a 401. I >> will continue to try figuring it out over >> the next week or so. >> It would be great if the initial author >> could help us out. >> >> Philippe >> >> >> On 3/12/2010 8:04 AM, David Susco wrote: >>> Has anyone managed to get camping to work with reststop using 1.9.354? >>> >>> >> >> >> _______________________________________________ >> 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 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 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 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt at roughest.net Sat Mar 27 15:26:37 2010 From: matt at roughest.net (Matt Zukowski) Date: Sat, 27 Mar 2010 15:26:37 -0400 Subject: restful camping with reststop In-Reply-To: <4BAD7EB1.9050302@monnet-usa.com> References: <1bd79b4a1003120704y6cec851ey65c1cd1e736255b6@mail.gmail.com> <1d87b3641003230807h59eb25a6r2d9318abd6c6429b@mail.gmail.com> <391a49da1003230850l4088dd03w7a0ac82dc780d590@mail.gmail.com> <1d87b3641003230901y4187ca03n719d3864ef60f9e9@mail.gmail.com> <391a49da1003230905q66573e68k762fd3dbd745ef19@mail.gmail.com> <1d87b3641003230923v6ffe89bcxc769743e55204330@mail.gmail.com> <391a49da1003230936o7f25e429l3031057a38ef7ef4@mail.gmail.com> <1d87b3641003231249s30dd7c77t8276929d305a84a7@mail.gmail.com> <4BAADA8F.3070109@monnet-usa.com> <4BAD7EB1.9050302@monnet-usa.com> Message-ID: <1d87b3641003271226l1ef6782en24818e6f5400c4d0@mail.gmail.com> Nicely done! Also glad you're using restr... seems like rest-client is getting all the love nowdays. I'm happy to start a full-fledged githup repo for reststop. Although maybe a better place for it would be the general 'camping' github account? Matt. On Fri, Mar 26, 2010 at 11:42 PM, Philippe Monnet wrote: > Ok, after a few more code changes, I am now able to run through all > browser-based scenarios and all *restr*-based scenarios. > I have added a comment starting with *@techarch* on all the lines I have > changed. > I have also updated *restr.rb* so that the cookie header can be exchanged > back and forth. > I created a *test.rb* with a few snippets to use in IRB using Restr. > My gist is available at: http://gist.github.com/343058 > Feel free to pick and choose/rewrite/optimize as needed when merging into > Reststop. ;-) > > Philippe (@techarch on Twitter) > > On 3/24/2010 9:37 PM, Philippe Monnet wrote: > > Matt, > > Thanks for the head start on the port to 2.0. > I have started to finish it and am about 95% there. > At this point I can run through all browser-based scenarios and have > started some of the Restr-based scenarios. I am now trying to figure out how > to do the authentication bit for the PUT scenarios. > I hope to complete this by the end of the week-end. > > Philippe > > On 3/23/2010 1:49 PM, Matt Zukowski wrote: > > Alright I spent a few hours trying to see if I can make things work with > 2.0. > > I was able to make some progress (mostly thanks to Magnus' help!) but ran > out of time before I could get things runnings. > > Here's the result: > > http://gist.github.com/341555 > > I'm not sure when I will get a chance in the near future to play around > with this again, but if someone wants to take it and run with it I'd be > happy to help. > > Matt. > > On Tue, Mar 23, 2010 at 12:36 PM, Magnus Holm wrote: > >> code = %q{ >> # This Ruby code will be called everytime Camping.goes is called. >> # And "Camping" is replaced with the app module, so you can do stuff like: >> def Camping.foo >> puts "Hello World!" >> end >> >> # You probably just want to do: >> module Camping >> include MyExtension >> end >> } >> >> # For Camping.goes >> Camping::S << code >> # For previus Camping.goes >> Camping::Apps.each { |app| app.module_eval(code.gsub("Camping", app.to_s)) >> } >> >> As for qsp, it's replaced by Rack::Utils.parse_query. This creates a >> regular Hash though, so I've written a Base#n to convert it to Camping::H. >> >> # Before: >> hash = Camping.qsp("hoho=1") >> # Now: (inside an instance of a controller) >> hash = n(Rack::Utils.parse_query("hoho=1")) >> >> >> // Magnus Holm >> >> >> >> On Tue, Mar 23, 2010 at 17:23, Matt Zukowski wrote: >> >>> Okay got it... but as I look at this a bit more, the ridiculous things I >>> had to do to make Reststop work (for Camping 1.0) are all coming back to me. >>> >>> >>> As I recall, the root of all evil was Camping#goes. I had to override >>> it in order to inject the Reststop code into Camping. Camping#qsp was the >>> second evil, and I see that it's now gone. I'm looking around now to see >>> what you've done to replace it (I take it Rack took care of some of that). >>> >>> >>> On Tue, Mar 23, 2010 at 12:05 PM, Magnus Holm wrote: >>> >>>> @env['REQUEST_METHOD'] is the HTTP method send by the client, @method is >>>> the method (in lowercase) Camping is going to run ("r404" for 404 etc.) >>>> >>>> // Magnus Holm >>>> >>>> >>>> >>>> On Tue, Mar 23, 2010 at 17:01, Matt Zukowski wrote: >>>> >>>>> Hey Magnus, while we have your attention, in 2.0 how do I get access to >>>>> e['REQUEST_METHOD'] inside the 'service' method? Trying to figure this out >>>>> as we speak... >>>>> >>>>> >>>>> On Tue, Mar 23, 2010 at 11:50 AM, Magnus Holm wrote: >>>>> >>>>>> I find extending Camping apps to be quite easy, since it's all classes >>>>>> and modules, but I can understand that extending Camping itself can be >>>>>> difficult/weird. That said, I think a lot can be solved by defining >>>>>> #included and #extended. It would be great if you could tell us a bit >>>>>> exactly the problems you faced. We still have 1k left. >>>>>> >>>>>> Don't hurry, though. Let's get 2.0 out first. >>>>>> >>>>>> // Magnus Holm >>>>>> >>>>>> >>>>>> >>>>>> On Tue, Mar 23, 2010 at 16:07, Matt Zukowski wrote: >>>>>> >>>>>>> I actually have a reststop app up and running fine with Camping 2.0 >>>>>>> (check out Taskr at http://github.com/zuk/taskr). Tthe catch is that >>>>>>> it's a version of 2.0 that I forked about this time last year, and looking >>>>>>> at the github graph, Magnus has committed a whole slew of changes since >>>>>>> then. So whatever broke Reststop must have been committed in the last 10 >>>>>>> months or so. >>>>>>> >>>>>>> To be honest over the last year I've mostly switched form Camping >>>>>>> to Sinatra (and lately to Node.js, which is really really cool by the way). >>>>>>> The problem with Camping, for me, is that trying to extend it is >>>>>>> a nightmare. I learned this the hard way while writing Reststop and Picnic. >>>>>>> >>>>>>> Anyway I have a bit of time right now, so since there seems to be >>>>>>> some interest, I'll pull down the latest version of Camping and see if I can >>>>>>> make it work with Reststop. I should also move Reststop to github while I'm >>>>>>> at it. >>>>>>> >>>>>>> On Mon, Mar 22, 2010 at 11:32 PM, Philippe Monnet < >>>>>>> ruby at monnet-usa.com> wrote: >>>>>>> >>>>>>>> Hi David, >>>>>>>> >>>>>>>> I had played with RESTstop on the old Camping maybe six months ago. >>>>>>>> I have now started to take a look at what the issues are about. >>>>>>>> So far I have found a few things like: >>>>>>>> >>>>>>>> In reststop.rb: >>>>>>>> - the service method needs to retrieve the REQUEST_METHOD using >>>>>>>> @env['REQUEST_METHOD'] >>>>>>>> -the condition on the if statement on the last m.capture line of >>>>>>>> the render method needs to be adjusted (not sure what a[0] should be >>>>>>>> replaced with. So far I have temporarily replaced the line by: >>>>>>>> s = m.capture{send(:layout){s}} if m.respond_to?(:layout) >>>>>>>> >>>>>>>> In the blog.rb example >>>>>>>> - the version number for camping needs to be updated >>>>>>>> - require 'camping/db' should be removed since now obsolete >>>>>>>> - require 'markaby' needs to be added >>>>>>>> >>>>>>>> So far I can bring up the app in a browser, login, add a post. >>>>>>>> But if I use Restr I can only do a GET. The PUT currently fails with >>>>>>>> a 401. I will continue to try figuring it out over the next week or so. >>>>>>>> It would be great if the initial author could help us out. >>>>>>>> >>>>>>>> Philippe >>>>>>>> >>>>>>>> >>>>>>>> On 3/12/2010 8:04 AM, David Susco wrote: >>>>>>>> >>>>>>>> Has anyone managed to get camping to work with reststop using 1.9.354? >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> 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 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 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 at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > > > _______________________________________________ > Camping-list mailing listCamping-list at rubyforge.orghttp://rubyforge.org/mailman/listinfo/camping-list > > > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > -------------- next part -------------- An HTML attachment was scrubbed... URL: