Re: Philosophy
My attitude towards using camping for serious business mostly stems from being burnt by rails. I practice coding as an extension of creativity, not as a job, and rails has enormous hosting costs for someone with no income. I initially started using camping as it could run well as a CGI script on the cheapest grungeist web hosts. Capitalistic forces have largely taken over the once gloriously creative practice of hacking, and turned it in to little more than data entry jobs, with all it's best practices, unit tests, and all the rest. Camping to me is special because it's all about creation, and not about fitting in to a certain task or market. This is entirely self destructive though in the long term for businesses too, as tools which are unusable by the poor are tools which are unusable in the future. Students don't have software dollars. Though as an open source project we owe nothing to capitalism. We have no business propping up commerce. Rails is a great tool for building medium to large business applications and so my preference is that we entirely ignore that which drives 'marketed' frameworks, and focus on what we're really good at — making fun awesome hacks, and teaching the next generations. Little doodads for the sake of themselves. Thoughts? :) — Jenna / @Bluebie On 24/08/2010, at 11:47 AM, Philippe Monnet r...@monnet-usa.com wrote: I am not sure I can even try to get close to the philosophy as I consider myself still a newcomer to Camping. So I am missing a lot of the background on Camping (even though I have read quite a few materials, books, posts, videos, etc. about _why's contributions. For me, I love Camping because: � - it is small � - the code is crazy clever and taught me a lot about things I did not know about Ruby metaprogramming �- the MVC structure help me structure my thoughts and apps �- it is very extensible once you figure out the extensibility points you need �- creating all sorts of apps or services is really fun and enjoyable �- you can build some decent size/complexity apps if you try (I don't subscribe to the analogy about the dark side as I feel Camping is about freedom to build whatever you want) �- you can either use it for play or for work (that tends to happen if you like it so much you want everything to be built with it. �- it can capture your imagination in terms of what you could use it for (e.g. the fun/play/learn sandbox idea) Philippe (@techarch) PS -I have deployed apps on Heroku and will help with the deployment section of the book � On 8/23/2010 3:05 AM, Jenna Fox wrote: The camping website (new one) includes a link to a not-existant wiki page called 'Philosophy', which was inherited from Judofyr's version. I keep meaning to create this article, but I'm increasingly wondering... What do we all feel is Camping's philosophy? My take: Camping is all about hacking and exploring and having fun, and certainly isn't serious business. I think it's also for newbies, including kids, because that's what nearly all of _why's projects were for. But that's very past tense. I'm not sure anymore. What do you all see camping as being? What's it's purpose for you? � Jenna ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Philosophy
http://github.com/camping/camping/wiki/Philosophy Whatcha guys think? — Jenna ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Philosophy
Is ruby like emo? -the littlest stooge On Mon, Aug 23, 2010 at 9:26 PM, Jenna Fox a...@creativepony.com wrote: http://github.com/camping/camping/wiki/Philosophy Whatcha guys think? — Jenna ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Wiki Writing Requests!
Hi Jenna - done (Markdown). Others can add to it now - Dave E. Heya! So I'm trying to get this new website all tied up in a nice little bunch. I'm a bit silly when it comes to git-fu though. Could one of you create a page on the camping/camping wiki called 'Contributing', and put stuff in it which tells people how to do that? Use Markdown or Textile. Doesn't really matter which. I'm moving most of the articles I work on over to Markdown because textile and my brain don't like each other and I don't much like being stuck in the middle of their squabbles. Do whatever though. ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
What is the process for publishing to campingrb.tumblr.com?
In the future when we have updates/announcements related to Camping, how will we be able to publish them to the Tumblr blog? ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
FireFox fix for the camping.js file on the http://camping.rubyforge.org/api.html page
The API page does not work in terms of display and section collapsing/expanding in FireFox (but works on IE and Chrome). I fixed the Javascript file by moving up the declaration of the m and s functions. Magnus, if you place the camping.js file on GitHub I will patch it for you. Otherwise I will just email the file so that RubyForge can be updated. Philippe (@techarch) ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: FireFox fix for the camping.js file on the http://camping.rubyforge.org/api.html page
http://github.com/camping/camping/blob/master/extras/rdoc/generator/template/flipbook/js/camping.js Feel free to push directly to camping/camping :-) // Magnus Holm On Sun, Aug 22, 2010 at 17:24, Philippe Monnet r...@monnet-usa.com wrote: The API page does not work in terms of display and section collapsing/expanding in FireFox (but works on IE and Chrome). I fixed the Javascript file by moving up the declaration of the m and s functions. Magnus, if you place the camping.js file on GitHub I will patch it for you. Otherwise I will just email the file so that RubyForge can be updated. Philippe (@techarch) ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: What is the process for publishing to campingrb.tumblr.com?
It would be great if you could add the various members of the Camping organization on GitHub once they create an account on Tumblr. I just created mine: techarch.tumblr.com Philippe (@techarch) On 8/22/2010 4:59 PM, Jenna Fox wrote: Create an account on tumblr.com http://tumblr.com, then visit http://campingrb.tumblr.com/submit and submit your post in to the log's publishing queue. One of the log's members will then check and approve it. People who contribute a couple of good posts will likely be given membership in the blog, letting you skip the queue. On 23/08/2010, at 12:55 AM, Philippe Monnet wrote: In the future when we have updates/announcements related to Camping, how will we be able to publish them to the Tumblr blog? ___ Camping-list mailing list Camping-list@rubyforge.org mailto:Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: What is the process for publishing to campingrb.tumblr.com?
would you all walk me through how to create a camping esque framevork from scratch or point me in the right direction? help me creative pony, PM you're my only hope. On Sun, Aug 22, 2010 at 6:18 PM, Jenna Fox a...@creativepony.com wrote: All invited now. On 23/08/2010, at 9:43 AM, Philippe Monnet wrote: It would be great if you could add the various members of the Camping organization on GitHub once they create an account on Tumblr. I just created mine: techarch.tumblr.com Philippe (@techarch) On 8/22/2010 4:59 PM, Jenna Fox wrote: Create an account on tumblr.com, then visit http://campingrb.tumblr.com/submit and submit your post in to the log's publishing queue. One of the log's members will then check and approve it. People who contribute a couple of good posts will likely be given membership in the blog, letting you skip the queue. On 23/08/2010, at 12:55 AM, Philippe Monnet wrote: In the future when we have updates/announcements related to Camping, how will we be able to publish them to the Tumblr blog? ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing listcamping-l...@rubyforge.orghttp://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: What is the process for publishing to campingrb.tumblr.com?
Why would you want to recreate the camping framework? It already exists. Is there some feature or change we could make which would make camping more suitable for your needs? — Jenna On 23/08/2010, at 12:17 PM, Angel Robert Marquez wrote: would you all walk me through how to create a camping esque framevork from scratch or point me in the right direction? help me creative pony, PM you're my only hope. On Sun, Aug 22, 2010 at 6:18 PM, Jenna Fox a...@creativepony.com wrote: All invited now. On 23/08/2010, at 9:43 AM, Philippe Monnet wrote: It would be great if you could add the various members of the Camping organization on GitHub once they create an account on Tumblr. I just created mine: techarch.tumblr.com Philippe (@techarch) On 8/22/2010 4:59 PM, Jenna Fox wrote: Create an account on tumblr.com, then visit http://campingrb.tumblr.com/submit and submit your post in to the log's publishing queue. One of the log's members will then check and approve it. People who contribute a couple of good posts will likely be given membership in the blog, letting you skip the queue. On 23/08/2010, at 12:55 AM, Philippe Monnet wrote: In the future when we have updates/announcements related to Camping, how will we be able to publish them to the Tumblr blog? ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Need input on proposed tweaks to www.ruby-camping.com
Bartosz Dziewoński wrote: Windows XP, Opera 10.61 (newest stable), 1024x768. It looks similar in Firefox 3.6 (http://imgur.com/atSts.png). Yeah. It's an artefact of Microsoft's plainly terrible type engine. I'm not sure how to fix it or even if it's possible to fix it, short of manually fattening up the typeface and User-Agent sniffing to serve differently weighted typefaces to Microsoft platforms. There are tons of things which are more important to me than making a custom typeface just to work around windows 'features'. I'll keep pondering for now. Also, the header breaks in Firefox - the fills do not fit the outlines: http://imgur.com/cJXoq.png I'm aware of this issue and I fixed it in github yesterday (!) and sent a pull request to Judofyr, however it hasn't been pushed yet to rubyforge. The issue is to do with kerning data being stripped from one of the fonts and not the other, an easy fix. Windows is far more aggressive than other platforms in manipulating and modifying typefaces in it's attempts to mathematically optimise them for display on computer screens. Most times this backfires, but like I said, it's fixed now, I just don't have the ability to push the update. Meanwhile: Working on moving the whole thing over to being backed by the GitHub wiki, making it much more dynamic, and giving you all the opportunity to contribute to making the camping site great, without having to figure out webby and the rest. The wiki mirroring version is working really well locally. — Jenna___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Don't understand one part of the book
Hi Guys/Gals. I am new to the world of Camping. It looks very simple. I have two issues: - What types of applications is Camping more suitable than Rails. - The part Modeling the World in http://camping.rubyforge.org/book/02_getting_started.html is not clear for me where I have to encounter: If you want to migrate up to version one, create the skeleton for the Page model, which should be able to store, title which is a string, content which is a larger text, created_at which is the time it was created, updated_at which is the previous time it was updated. I am not able to get this message. Thank you for your help :) -- Saludos/Greetings Quiliro Ordóñez 593(2)340 1517 / 593(9)821 8696 Even The Troops Are Waking Up http://tinyogg.com/watch/My8SB/ ACTA – Un acuerdo que puede garantizar la crucificción de internethttp://quiliro.wordpress.com GNU should mean GNU's not Ubuntu!http://quidam.cc/03-03-2010/gnu-should-mean-gnus-not-ubuntu Estas son opiniones personales y no representan la posición de ninguna organización. ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Don't understand one part of the book
On Aug 21, 2010, at 11:40 AM, Quiliro Ordóñez wrote: Hi Guys/Gals. I am new to the world of Camping. It looks very simple. I have two issues: - What types of applications is Camping more suitable than Rails. Where you want something small and easy. Or you like knowing exactly what every part does. - The part Modeling the World in http://camping.rubyforge.org/book/02_getting_started.html is not clear for me where I have to encounter: If you want to migrate up to version one, create the skeleton for the Page model, which should be able to store, title which is a string, content which is a larger text, created_at which is the time it was created, updated_at which is the previous time it was updated. I am not able to get this message. It's just laying out a simple database schema: four fields, stored in a table called pages. It's actually ActiveRecord under the hood. ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Don't understand one part of the book
Hi Quiliro Camping is good for what you want it to be - e.g. - create small focussed applications that can work together, - make an app that does a useful thing for yourself, - experiment and enjoy! Take a look at the wiki - it's a work in progress, but there's plenty to help explain: http://github.com/camping/camping/wiki/WhyWentCamping-Homepage The text simply explains in plain language what the code above actually does, that's all :-) Dave Everitt Hi Guys/Gals. I am new to the world of Camping. It looks very simple. I have two issues: What types of applications is Camping more suitable than Rails. The part Modeling the World in http://camping.rubyforge.org/book/ 02_getting_started.html is not clear for me where I have to encounter: If you want to migrate up to version one, create the skeleton for the Page model, which should be able to store, title which is a string, content which is a larger text, created_at which is the time it was created, updated_at which is the previous time it was updated. I am not able to get this message. Thank you for your help :) -- Saludos/Greetings Quiliro Ordóñez ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Don't understand one part of the book
Great help. Thank you all for the different angles of answers given to my question. The links are great to keep learning and the explanations give a detailed view of the tool. :-) -- Saludos/Greetings Quiliro Ordóñez 593(2)340 1517 / 593(9)821 8696 Even The Troops Are Waking Up http://tinyogg.com/watch/My8SB/ ACTA – Un acuerdo que puede garantizar la crucificción de internethttp://quiliro.wordpress.com GNU should mean GNU's not Ubuntu!http://quidam.cc/03-03-2010/gnu-should-mean-gnus-not-ubuntu Lo único que se necesita para que triunfe el mal es que los hombres de bien no hagan nada. Sergei Bondarchuk Estas son opiniones personales y no representan la posición de organización alguna. ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Wiki Writing Requests!
Heya! So I'm trying to get this new website all tied up in a nice little bunch. I'm a bit silly when it comes to git-fu though. Could one of you create a page on the camping/camping wiki called 'Contributing', and put stuff in it which tells people how to do that? Use Markdown or Textile. Doesn't really matter which. I'm moving most of the articles I work on over to Markdown because textile and my brain don't like each other and I don't much like being stuck in the middle of their squabbles. Do whatever though. Thanks a bunch. — Pony ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Need input on proposed tweaks to www.ruby-camping.com
Jenna, on whitebook.mooo.com there are links pointing to localhost:4331. Website is nice, but menu item are slightly unreadable :( -- Matma Rex ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Need input on proposed tweaks to www.ruby-camping.com
2010/8/19 Jenna Fox a...@creativepony.com: Not right now? I can find no mention of this localhost:4331. I guess you caught my dev server while I was playing around and forgot to set the hostname right. It wouldn't be published like that. It's a macro-type thing to make the tumblog work properly with nav and stylesheet reference when on a diff domain/subdomain. I know, I know, just wanted to point out, maybe you had had forgotten about it or something. Everything works now. Website is nice, but menu item are slightly unreadable :( Too unreadable? Well, yes, the sidebar menu font (TopStitch) is classy, but hard to read, especially at this size. Of course, if I focus on it, I can read it, but IMO menus, just like main text, should be readable at first glance. Maybe try bolding it (if this font is available bold) or raising font size to 17-18 pt? (To make sure it's not something wrong on my side and that we're talking about the same thing, screenshot: http://imgur.com/2rfQv.png. I have old crappy small 1024x768 display.) -- Matma Rex ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Need input on proposed tweaks to www.ruby-camping.com
Okay. My web design is ready for prime time! You can see it up now at http://whitebook.mooo.com/ and http://campingrb.tumblr.com/ - keep in mind it's running off a home computer (called whitebook), so please don't send much traffic towards it. I've forked whywentcamping.com from the camping user on Github, and all these changes are up there. All you need to do is pull that, change the own_domain variable in layouts/default.txt to whatever, webby built in the CLI, and push it out to a server someplace. Oh, and let me know where it is so I can update the tumblog and if anyone wants in on the log, poke me an email address and I'll invite. Think community blog. I'll add the thingy to let people submit posts for consideration laters. Whatcha think? I'd like to make the headings look more interesting. Not sure how yet. Will experiment some. Also, need to rewrite homepage to be niftier, I think. — Jenna On 13/08/2010, at 8:19 PM, Dave Everitt wrote: Okay - we might be all running before we can walk, what with no real improvement to existing content yet. Everything I do professionally in this field starts with a solid content plan/list and a kind of strategy - there are some pretty good content suggestions in older posts. Before go any further (since we're all pretty busy) perhaps the main effort after all should go into refining the content on: http://whywentcamping.judofyr.net and avoiding duplication from: http://camping.rubyforge.org The only thing stopping me is that I have to get to grips with Webby, which I've never used. I was going down the Nanoc and Sass route before I got abducted by some nasty paid work. Or even make it all in... Camping (gasp!). But I do like the diversity of views of this group, although the healthy disagreement makes things hard to pin down. BTW Tumblr is fine (I use it), but why not use the blog on whywentcamping.judofyr.net instead? - DaveE My suggestion is that it not exist. Magnus already made a brilliant camping website at http://whywentcamping.judofyr.net/ It has content, but no drawings of tents. However I think we can have both in the same website. Could make an issue about it on the github issue tracker if you like. ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Need input on proposed tweaks to www.ruby-camping.com
Okay - we might be all running before we can walk, what with no real improvement to existing content yet. Everything I do professionally in this field starts with a solid content plan/list and a kind of strategy - there are some pretty good content suggestions in older posts. Before go any further (since we're all pretty busy) perhaps the main effort after all should go into refining the content on: http://whywentcamping.judofyr.net and avoiding duplication from: http://camping.rubyforge.org The only thing stopping me is that I have to get to grips with Webby, which I've never used. I was going down the Nanoc and Sass route before I got abducted by some nasty paid work. Or even make it all in... Camping (gasp!). But I do like the diversity of views of this group, although the healthy disagreement makes things hard to pin down. BTW Tumblr is fine (I use it), but why not use the blog on whywentcamping.judofyr.net instead? - DaveE My suggestion is that it not exist. Magnus already made a brilliant camping website at http://whywentcamping.judofyr.net/ It has content, but no drawings of tents. However I think we can have both in the same website. Could make an issue about it on the github issue tracker if you like. ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Need input on proposed tweaks to www.ruby-camping.com
One thing is clear: we all love Camping! Months ago after seeing other frameworks like Sinatra and Padrino garner so much attention, I realized that the one thing missing on our side was not content but a marketing-oriented site to incite other rubyists to check out and try camping. So I drafted http://www.ruby-camping.com (after many posts on this mailing list) to serve as that marketing site to: 1. Quickly communicate what Camping is about 2. Advertise its strength and benefits 3. Provide links for people to download it, join the community and dive into the docs 4. Start tracking traffic so we can get a sense of whether or not we are starting to get some attention This is a very different goal from (and not mutually exclusive with) the goal of a blog or wiki. I also asked for help - knowing that we're all super busy. So I am glad some of you are starting to help out . On 8/13/2010 4:19 AM, Dave Everitt wrote: Okay - we might be all running before we can walk, what with no real improvement to existing content yet. Everything I do professionally in this field starts with a solid content plan/list and a kind of strategy - there are some pretty good content suggestions in older posts. Before go any further (since we're all pretty busy) perhaps the main effort after all should go into refining the content on: http://whywentcamping.judofyr.net and avoiding duplication from: http://camping.rubyforge.org The only thing stopping me is that I have to get to grips with Webby, which I've never used. I was going down the Nanoc and Sass route before I got abducted by some nasty paid work. Or even make it all in... Camping (gasp!). But I do like the diversity of views of this group, although the healthy disagreement makes things hard to pin down. BTW Tumblr is fine (I use it), but why not use the blog on whywentcamping.judofyr.net instead? - DaveE My suggestion is that it not exist. Magnus already made a brilliant camping website at http://whywentcamping.judofyr.net/ It has content, but no drawings of tents. However I think we can have both in the same website. Could make an issue about it on the github issue tracker if you like. ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list --- Original Message Subject:Re: Wiki vs homepage Date: Thu, 08 Jul 2010 20:20:04 -0600 From: Philippe Monnet r...@monnet-usa.com Reply-To: camping-list@rubyforge.org To: camping-list@rubyforge.org Yeah, I agree that it makes sense to have two sites, one to promote Camping and one to serve as the official reference. And a wiki would be very convenient for that. On 7/8/2010 1:55 PM, Magnus Holm wrote: Hey guys, Philippe had some interesting points about the website: 1. Keep the home page simple with all content fitting within 1280 x 1024 2. Use a catchy design (need some help here) 3. Accentuate that Camping is about Ruby (maybe also include the ruby logo somewhere) 4. Have a brief note about the connection to _why and a link to a page explaining the history of Camping with further links to _why's other sites 5. Encourage people to try it by capitalizing on some of Camping's strengths: - Fast to learn - requires only basic Ruby skills - Much simpler than Rails but more structure than Sinatra/Padrino - Lightning fast and memory efficient allowing fast and efficient sites - Can evolve from simple file to organized directory structure - Can layer in more features later using persistence and choice of view engines 6. How about using some kind of an animated (auto advancing) slideshow to highlight some of the benefits? See an example at: http://blog.monnet-usa.com/?p=276 7. How about a page on learning with a link to the book as well as a list of links for other tutorials or short explanations on key topics (e.g. how to do migrations, how to use include/extend, how to use different view engines, etc.)? 8. How about a page about plugins with some brief description of their intent? 9. I would love for us to include _why's cartoons in some of the sub pages ;-) Now, the more I look at this list (and my own thoughts about the new camping site) I realize that we're talking about two different things: * A site to attract new users * A site to inform regular users It looks like my attempt (http://whywentcamping.judofyr.net/) tries to target the latter, while Philippe targeted the former (http://rubycamping.monnet-usa.com/). Both sites serves a purpose and I believe both are equally important. -- Here's what I propose: We split the site into two parts. We turn what I've created into a wiki. Everyone are welcome to edit and add their own content. Then we take Philippe's ideas/design/site and turn it into ruby-camping.com or whywentcamping.com or whatnot. It probably doesn't need to be more than a single page. What'd ya think? // Magnus Holm
Re: Need input on proposed tweaks to www.ruby-camping.com
I've yet to hear any compelling reason why that should be a separate 'site' on it's own domain name, over and away from everything else, rather than just a refresh of the existing camping homepage. You make some good points. We could write the homepage better. It's very dry at the moment. I'm very much against the wilful keeping of any sort of traffic statistics. Camping is a vibrant creative experimental project which often tries new hacks and ideas because we all feel free to do whatever. We're all just here having fun. Anyone who comes to camping wanting a serious framework will be disappointed. That's not to say you can't do serious things with camping, just that it's not what camping is about. The trouble with statistics is when you start paying attention to them, you can't help but change your behaviour to make the numbers do a little dance, and then it stops being a fun creative experimental place, and starts being a game where we try and 'win'. I don't want to play that game. I don't think many people here do. It's part of what makes this bunch special. Now there's nothing wrong with having a nicer homepage, and an all around more together website. We just need to remember what our goals are, collectively. We aren't a business. We have no motivation to see more users using camping, aside from a casual humanitarian effort. No marketing. Marketing is for people who need markets. We aren't in any of those. Not selling, camping. A silly little thing for making toys. Don't forget that. On 13/08/2010, at 11:42 PM, Philippe Monnet wrote: One thing is clear: we all love Camping! Months ago after seeing other frameworks like Sinatra and Padrino garner so much attention, I realized that the one thing missing on our side was not content but a marketing-oriented site to incite other rubyists to check out and try camping. So I drafted http://www.ruby-camping.com (after many posts on this mailing list) to serve as that marketing site to: 1. Quickly communicate what Camping is about 2. Advertise its strength and benefits 3. Provide links for people to download it, join the community and dive into the docs 4. Start tracking traffic so we can get a sense of whether or not we are starting to get some attention This is a very different goal from (and not mutually exclusive with) the goal of a blog or wiki. I also asked for help - knowing that we're all super busy. So I am glad some of you are starting to help out . On 8/13/2010 4:19 AM, Dave Everitt wrote: Okay - we might be all running before we can walk, what with no real improvement to existing content yet. Everything I do professionally in this field starts with a solid content plan/list and a kind of strategy - there are some pretty good content suggestions in older posts. Before go any further (since we're all pretty busy) perhaps the main effort after all should go into refining the content on: http://whywentcamping.judofyr.net and avoiding duplication from: http://camping.rubyforge.org The only thing stopping me is that I have to get to grips with Webby, which I've never used. I was going down the Nanoc and Sass route before I got abducted by some nasty paid work. Or even make it all in... Camping (gasp!). But I do like the diversity of views of this group, although the healthy disagreement makes things hard to pin down. BTW Tumblr is fine (I use it), but why not use the blog on whywentcamping.judofyr.net instead? - DaveE My suggestion is that it not exist. Magnus already made a brilliant camping website at http://whywentcamping.judofyr.net/ It has content, but no drawings of tents. However I think we can have both in the same website. Could make an issue about it on the github issue tracker if you like. ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list --- Original Message Subject: Re: Wiki vs homepage Date: Thu, 08 Jul 2010 20:20:04 -0600 From: Philippe Monnet r...@monnet-usa.com Reply-To: camping-list@rubyforge.org To: camping-list@rubyforge.org Yeah, I agree that it makes sense to have two sites, one to promote Camping and one to serve as the official reference. And a wiki would be very convenient for that. On 7/8/2010 1:55 PM, Magnus Holm wrote: Hey guys, Philippe had some interesting points about the website: 1. Keep the home page simple with all content fitting within 1280 x 1024 2. Use a catchy design (need some help here) 3. Accentuate that Camping is about Ruby (maybe also include the ruby logo somewhere) 4. Have a brief note about the connection to _why and a link to a page explaining the history of Camping with further links to _why's other sites 5. Encourage people to try it by capitalizing on some of Camping's strengths: - Fast to learn - requires
Re: two security questions
This example worked here: require 'rubygems' require 'rack/csrf' require 'camping' require 'camping/session' Camping.goes :Hello module Hello use Rack::Csrf include Camping::Session end module Hello::Controllers class Index def get Rack::Csrf.csrf_token(@env) end end end Notice that you'll have to reverse the `use`-lines. Maybe we should file that as a bug? Since it works the other way both in Rackup files and Sinatra? // Magnus Holm On Wed, Aug 11, 2010 at 21:33, David Susco dsu...@gmail.com wrote: Ted, Do you use Camping::Session with Rack::Csrf? If so, how did you get it to work? Once I include Camping::Session the csrf_token changes every time I call the method. Can anyone explain what include Camping::Session is actually doing? Dave On Mon, Aug 9, 2010 at 12:22 PM, Ted Kimble t...@tedkimble.com wrote: For cross-site request forgery protection I've simply used the Rack::Csrf middleware before (http://github.com/baldowl/rack_csrf). The github page is pretty self explanatory. For Haml, you should just be able to set its :escape_html option to true and then %p= @something_nasty will be escaped by default. See: http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#escape_html-option for more info. Best, Ted On Mon, Aug 9, 2010 at 9:15 AM, David Susco dsu...@gmail.com wrote: Hey guys, What do people do to protect against cross-site request forgery? To mimic what rails does I was thinking of creating a unique key for each session, and then in my logged_in? helper checking if the key passed by the user matches the one I set in the session. On the second question, I'm using Tilt with Haml templates. Any idea how I can set Haml's :escape_html option so each template escapes all HTML within variables? -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Fwd: Need input on proposed tweaks to www.ruby-camping.com
Pigy made some great suggestions for the site - see http://github.com/camping/camping/issues/#issue/23 I pushed the changes to my personal staging site: http://rubycamping.monnet-usa.com/ Could you guys take a look and let me know if you like the new version better than the current draft of the site (http://www.ruby-camping.com/)? Based on the group feedback I''ll make some further tweaks or just push the changes to the main site this week-end. Philippe ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: two security questions
Ted, Do you use Camping::Session with Rack::Csrf? If so, how did you get it to work? Once I include Camping::Session the csrf_token changes every time I call the method. Can anyone explain what include Camping::Session is actually doing? Dave On Mon, Aug 9, 2010 at 12:22 PM, Ted Kimble t...@tedkimble.com wrote: For cross-site request forgery protection I've simply used the Rack::Csrf middleware before (http://github.com/baldowl/rack_csrf). The github page is pretty self explanatory. For Haml, you should just be able to set its :escape_html option to true and then %p= @something_nasty will be escaped by default. See: http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#escape_html-option for more info. Best, Ted On Mon, Aug 9, 2010 at 9:15 AM, David Susco dsu...@gmail.com wrote: Hey guys, What do people do to protect against cross-site request forgery? To mimic what rails does I was thinking of creating a unique key for each session, and then in my logged_in? helper checking if the key passed by the user matches the one I set in the session. On the second question, I'm using Tilt with Haml templates. Any idea how I can set Haml's :escape_html option so each template escapes all HTML within variables? -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: two security questions
Dave, Unfortunately I've actually not yet used Rack::Csrf with Camping. In Sinatra, I just: use Rack::Session::Cookie, :secret = something use Rack::Csrf and it works fine. Looking at Camping's source for Camping::Session, it looks like it's basically doing the same (http://github.com/camping/camping/blob/master/lib/camping/session.rb#L32). The csrf_token shouldn't be changing every time, as Rack::Csrf is storing it in your session. Can you verify that rack.session is present in your session. Ted On Wed, Aug 11, 2010 at 2:33 PM, David Susco dsu...@gmail.com wrote: Ted, Do you use Camping::Session with Rack::Csrf? If so, how did you get it to work? Once I include Camping::Session the csrf_token changes every time I call the method. Can anyone explain what include Camping::Session is actually doing? Dave On Mon, Aug 9, 2010 at 12:22 PM, Ted Kimble t...@tedkimble.com wrote: For cross-site request forgery protection I've simply used the Rack::Csrf middleware before (http://github.com/baldowl/rack_csrf). The github page is pretty self explanatory. For Haml, you should just be able to set its :escape_html option to true and then %p= @something_nasty will be escaped by default. See: http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#escape_html-option for more info. Best, Ted On Mon, Aug 9, 2010 at 9:15 AM, David Susco dsu...@gmail.com wrote: Hey guys, What do people do to protect against cross-site request forgery? To mimic what rails does I was thinking of creating a unique key for each session, and then in my logged_in? helper checking if the key passed by the user matches the one I set in the session. On the second question, I'm using Tilt with Haml templates. Any idea how I can set Haml's :escape_html option so each template escapes all HTML within variables? -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: two security questions
Thanks, that did the trick. Got to comb through my templates now though :P. On Tue, Aug 10, 2010 at 4:01 PM, Magnus Holm judo...@gmail.com wrote: David, As far as I remember, this should work: module App set :haml, { :escape_html = true } end You set options (as specified in http://github.com/rtomayko/tilt/blob/master/TEMPLATES.md) by: set :EXTENSION, { :a= true, :b = false } // Magnus Holm On Mon, Aug 9, 2010 at 19:08, David Susco dsu...@gmail.com wrote: Thanks I'll look into the middleware. I know that's how you escape HTML in Haml, what am asking though is how you set the :escape_html option when all you have is an instance of Tilt. Dave On Mon, Aug 9, 2010 at 12:22 PM, Ted Kimble t...@tedkimble.com wrote: For cross-site request forgery protection I've simply used the Rack::Csrf middleware before (http://github.com/baldowl/rack_csrf). The github page is pretty self explanatory. For Haml, you should just be able to set its :escape_html option to true and then %p= @something_nasty will be escaped by default. See: http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#escape_html-option for more info. Best, Ted On Mon, Aug 9, 2010 at 9:15 AM, David Susco dsu...@gmail.com wrote: Hey guys, What do people do to protect against cross-site request forgery? To mimic what rails does I was thinking of creating a unique key for each session, and then in my logged_in? helper checking if the key passed by the user matches the one I set in the session. On the second question, I'm using Tilt with Haml templates. Any idea how I can set Haml's :escape_html option so each template escapes all HTML within variables? -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: two security questions
Great; sorry for the delay, but I've been here in the last days :-) http://upload.wikimedia.org/wikipedia/commons/b/bd/Preikestolen_Norge.jpg // Magnus Holm On Tue, Aug 10, 2010 at 22:50, David Susco dsu...@gmail.com wrote: Thanks, that did the trick. Got to comb through my templates now though :P. On Tue, Aug 10, 2010 at 4:01 PM, Magnus Holm judo...@gmail.com wrote: David, As far as I remember, this should work: module App set :haml, { :escape_html = true } end You set options (as specified in http://github.com/rtomayko/tilt/blob/master/TEMPLATES.md) by: set :EXTENSION, { :a= true, :b = false } // Magnus Holm On Mon, Aug 9, 2010 at 19:08, David Susco dsu...@gmail.com wrote: Thanks I'll look into the middleware. I know that's how you escape HTML in Haml, what am asking though is how you set the :escape_html option when all you have is an instance of Tilt. Dave On Mon, Aug 9, 2010 at 12:22 PM, Ted Kimble t...@tedkimble.com wrote: For cross-site request forgery protection I've simply used the Rack::Csrf middleware before (http://github.com/baldowl/rack_csrf). The github page is pretty self explanatory. For Haml, you should just be able to set its :escape_html option to true and then %p= @something_nasty will be escaped by default. See: http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#escape_html-option for more info. Best, Ted On Mon, Aug 9, 2010 at 9:15 AM, David Susco dsu...@gmail.com wrote: Hey guys, What do people do to protect against cross-site request forgery? To mimic what rails does I was thinking of creating a unique key for each session, and then in my logged_in? helper checking if the key passed by the user matches the one I set in the session. On the second question, I'm using Tilt with Haml templates. Any idea how I can set Haml's :escape_html option so each template escapes all HTML within variables? -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Installing Camping on ubuntu lucid
hi, I'm moving my Camping from OS X to a Ubuntu Lucid unix machine. The camping gem has been successfully installed, but I can't access it directly from the command line. mo...@lucid:/u/apps/portablechecking$ gem list *** LOCAL GEMS *** actionmailer (2.3.8) actionpack (2.3.8) activerecord (2.3.8) activeresource (2.3.8) activesupport (2.3.8) builder (2.1.2) camping (2.0) daemons (1.1.0) eventmachine (0.12.10) pg (0.9.0) rack (1.2.1, 1.1.0) rails (2.3.8) rake (0.8.7) sqlite3-ruby (1.3.1) thin (1.2.7) The ubuntu package is Camping 1.5 only ... sudo apt-get install camping http://packages.ubuntu.com/lucid/camping any ideas ? thanks, r. ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Reloading in a standard config.ru rack app (Camping 2.0)
On a somewhat related note. How do people handle static content in a development environment? Is there a way to make the camping server aware of the public/ directory and serve the files within it? What about in production? Is passenger smart enough to pass requests for files in public/ back to apache or is some further configuration required? Dave 2010/8/1 Omar Gómez omar.go...@gmail.com: Worked like a charm, Thanks a lot! On Sun, Aug 1, 2010 at 7:52 AM, camping-list-requ...@rubyforge.org wrote: Message: 8 Date: Sun, 01 Aug 2010 06:51:52 -0600 From: Philippe Monnet r...@monnet-usa.com To: camping-list@rubyforge.org Subject: Re: Reloading in a standard config.ru rack app (Camping 2.0) Message-ID: 4c556de8.3040...@monnet-usa.com Content-Type: text/plain; charset=iso-8859-1; Format=flowed Hi Omar, When I want to test using rackup instead of the Camping server I use the following config.ru assuming that myapp.rb has a MyApp module: gem 'camping' , '= 2.0' %w(rack activerecord camping camping/session camping/reloader ).each { | r | require r} reloader = Camping::Reloader.new('myapp.rb') app = reloader.apps[:MyApp] run app And when I need to mount static content I also add the following statements _before _run app: use Rack::Reloader use Rack::Static, :urls = [ '/css', '/css/images' '/images', '/js' ], :root = File.expand_path(File.dirname(__FILE__)) Note that this only meant for local testing or in your staging environment (for example if you need to make a quick change while troubleshooting an issue). Philippe On 7/31/2010 6:12 PM, Omar G?mez wrote: Dear Camping ninjas, I've been using Camping via bin/camping and reloading works as expected OK. What I have not been able to do is to correctly setup a Camping app with reloading support in a standard config.ru rack app. Thanks for your attention --Omar G?mez -- Follow me at: Twitter: http://twitter.com/omargomez Buzz: http://www.google.com/profiles/108165850309051561506#buzz ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Reloading in a standard config.ru rack app (Camping 2.0)
Hi! On Mon, Aug 02, 2010 at 09:19:25AM -0400, David Susco wrote: On a somewhat related note. How do people handle static content in a development environment? Is there a way to make the camping server aware of the public/ directory and serve the files within it? What about in production? Is passenger smart enough to pass requests for files in public/ back to apache or is some further configuration required? I think everyone uses some variant on the following controller: class StaticX MIME_TYPES = {'.css' = 'text/css', '.js' = 'text/javascript', '.jpeg' = 'image/jpeg', '.jpg' = 'image/jpeg', '.png' = 'image/png'} def get(path) @headers['Content-Type'] = MIME_TYPES[path[/\.\w+$/, 0]] || text/plain unless path.include? .. @headers['X-Sendfile'] = (BASE_DIR + path).to_s else @status = 403 403 - Invalid path end end end with declaring at top: BASE_DIR = Pathname.new(__FILE__).dirname + public Given that passenger picks up Camping apps only if they have a public subdirectory and a config.ru, it might make sense to create a camping/static library for serving static data with auto-mime-type detection and ship this with Camping. Serving static files seems to be done often. What do you guys think? N.B. I had to install Apache with Passenger and the xsendfile module, but then it worked out of the box. Kind regards, Paul -- PhD Student @ Eindhoven | email: p...@luon.net University of Technology, The Netherlands | JID: p...@luon.net Using the Power of Debian GNU/Linux | GnuPG key ID: 0x50064181 ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Reloading in a standard config.ru rack app (Camping 2.0)
¡Holá Señor Gómez! First of all: *Never* use the reloader in production. It's sloow! And because config.ru is mostly used for production, the reloader isn't enabled there. Why do you want to use the reloader in config.ru instead of bin/camping by the way? If you want custom middlewares, you can always do it like this: module App user Middleware end And you can change the server it uses by `camping -s thin`. Anyway, if you want to use Camping::Reloader, you can do something like this: require 'camping' require 'camping/reloader' reloader = Camping::Reloader.new('hello.rb') reloader.on_reload do |app| app.create if app.respond_to?(:create) end app = proc do |env| # Reload (if needed) at every request: reloader.reload! # Returns a hash of the apps: apps = reloader.apps # Get the first app: apps.values.first.call(env) # If you have several apps, you probably want to # mount them on different paths instead. end run app If you're on *nix you can also use Shotgun (http://github.com/rtomayko/shotgun): require 'camping' Shotgun.after_fork do Camping::Apps.each do |app| app.create if app.respond_to?(:create) end end require 'hello' run Hello And run the app with: `shotgun config.ru`. Shotgun spawns your app in each own process at *every* request, so it's like it's automatically starting and stopping a server between each request. This means that it's slower, but more correct. Camping::Reloader keeps everything in the same process, and uses some Ruby magic to automatically remove objects and load files again. It work 90% of the times, but is faster (it only reloads when needed) and it also works on Windows. Good luck! // Magnus Holm 2010/8/1 Omar Gómez omar.go...@gmail.com: Dear Camping ninjas, I've been using Camping via bin/camping and reloading works as expected OK. What I have not been able to do is to correctly setup a Camping app with reloading support in a standard config.ru rack app. Thanks for your attention --Omar Gómez -- Follow me at: Twitter: http://twitter.com/omargomez Buzz: http://www.google.com/profiles/108165850309051561506#buzz ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
www.ruby-camping.com is live
The first draft of www.ruby-camping.com http://www.ruby-camping.com is live. I have also added Google, and Yahoo tracking so we can get metrics on the traffic. To accelerate indexing and boost search ranking it would be great if people could start linking to the site. The source for the site is on our GitHub Camping organization at http://github.com/camping/ruby-camping.com. I will deploy the changes upon request. ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Reloading in a standard config.ru rack app (Camping 2.0)
Worked like a charm, Thanks a lot! On Sun, Aug 1, 2010 at 7:52 AM, camping-list-requ...@rubyforge.org wrote: Message: 8 Date: Sun, 01 Aug 2010 06:51:52 -0600 From: Philippe Monnet r...@monnet-usa.com To: camping-list@rubyforge.org Subject: Re: Reloading in a standard config.ru rack app (Camping 2.0) Message-ID: 4c556de8.3040...@monnet-usa.com Content-Type: text/plain; charset=iso-8859-1; Format=flowed Hi Omar, When I want to test using rackup instead of the Camping server I use the following config.ru assuming that myapp.rb has a MyApp module: gem 'camping' , '= 2.0' %w(rack activerecord camping camping/session camping/reloader ).each { | r | require r} reloader = Camping::Reloader.new('myapp.rb') app = reloader.apps[:MyApp] run app And when I need to mount static content I also add the following statements _before _run app: use Rack::Reloader use Rack::Static, :urls = [ '/css', '/css/images' '/images', '/js' ], :root = File.expand_path(File.dirname(__FILE__)) Note that this only meant for local testing or in your staging environment (for example if you need to make a quick change while troubleshooting an issue). Philippe On 7/31/2010 6:12 PM, Omar G?mez wrote: Dear Camping ninjas, I've been using Camping via bin/camping and reloading works as expected OK. What I have not been able to do is to correctly setup a Camping app with reloading support in a standard config.ru rack app. Thanks for your attention --Omar G?mez -- Follow me at: Twitter: http://twitter.com/omargomez Buzz: http://www.google.com/profiles/108165850309051561506#buzz ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Multiple inserts in ActiveRecord
I had this problem in Rails! Yes, the short circuit evaluation messes it up. So I did this: if [...@company.valid?, @user.valid?].all? # do stuff end jeremy On Sat, Jul 31, 2010 at 9:43 PM, David Susco dsu...@gmail.com wrote: That's weird, I can't test anything until Monday but what happens when you nest it in two ifs? If @company.valid? if @user.valid? save On Sat, Jul 31, 2010 at 12:17 PM, Skyler Richter skylerrich...@gmail.com wrote: @David Susco I figured that was the way to do it. Thats what I tried the first time but I seem to only be able to validate 1 item at a time. It only validates the company model and it ignores the @user.valid? If I rearrange my code so that the user gets saved first then only the user validates and then it ignores the @company.valid?. Any ideas? On Sat, Jul 31, 2010 at 6:31 AM, David Susco dsu...@gmail.com wrote: You could check if both the company and user are valid, and if so create them. @company = Company.new (...) @user = User.new (...) if (@company.valid? and @user.valid?) �...@company.save �...@user.save ) Dave On Sat, Jul 31, 2010 at 7:20 AM, Magnus Holm judo...@gmail.com wrote: Hey campers, I'm wondering if any of you know a better solution to skylerrichter's problem: http://github.com/camping/camping/issues#issue/28 The basic idea is that he want to create a Company, and then the first User in that Company: @company = Company.create( :name = @input.name, :sub_domain = @input.subdomain) # Create the first user: @user = User.create( :company_id = @company.id, :first_name = @input.first_name, :last_name = @input.last_name, :email = @input.email, :password = @input.password) Both Company and User has validations, so there's a possibility that they don't actually get saved to the DB, and in that case he don't want *any* of them to be saved (I assume). I was thinking about something like this: begin Company.transaction do @company = Company.create!( :name = @input.name, :sub_domain = @input.subdomain) @user = User.create!( :company_id = @company.id, :first_name = @input.first_name, :last_name = @input.last_name, :email = @input.email, :password = @input.password) end rescue @errors = [...@company, @user].compact.map(:full_messages).flatten render :errors else redirect Login end But I'm wondering if there's a better way to solve this? // Magnus Holm ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Multiple inserts in ActiveRecord
Hey campers, I'm wondering if any of you know a better solution to skylerrichter's problem: http://github.com/camping/camping/issues#issue/28 The basic idea is that he want to create a Company, and then the first User in that Company: @company = Company.create( :name = @input.name, :sub_domain = @input.subdomain) # Create the first user: @user = User.create( :company_id = @company.id, :first_name = @input.first_name, :last_name = @input.last_name, :email = @input.email, :password = @input.password) Both Company and User has validations, so there's a possibility that they don't actually get saved to the DB, and in that case he don't want *any* of them to be saved (I assume). I was thinking about something like this: begin Company.transaction do @company = Company.create!( :name = @input.name, :sub_domain = @input.subdomain) @user = User.create!( :company_id = @company.id, :first_name = @input.first_name, :last_name = @input.last_name, :email = @input.email, :password = @input.password) end rescue @errors = [...@company, @user].compact.map(:full_messages).flatten render :errors else redirect Login end But I'm wondering if there's a better way to solve this? // Magnus Holm ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Multiple inserts in ActiveRecord
@David Susco I figured that was the way to do it. Thats what I tried the first time but I seem to only be able to validate 1 item at a time. It only validates the company model and it ignores the @user.valid? If I rearrange my code so that the user gets saved first then only the user validates and then it ignores the @company.valid?. Any ideas? On Sat, Jul 31, 2010 at 6:31 AM, David Susco dsu...@gmail.com wrote: You could check if both the company and user are valid, and if so create them. @company = Company.new (...) @user = User.new (...) if (@company.valid? and @user.valid?) �...@company.save �...@user.save ) Dave On Sat, Jul 31, 2010 at 7:20 AM, Magnus Holm judo...@gmail.com wrote: Hey campers, I'm wondering if any of you know a better solution to skylerrichter's problem: http://github.com/camping/camping/issues#issue/28 The basic idea is that he want to create a Company, and then the first User in that Company: @company = Company.create( :name = @input.name, :sub_domain = @input.subdomain) # Create the first user: @user = User.create( :company_id = @company.id, :first_name = @input.first_name, :last_name = @input.last_name, :email = @input.email, :password = @input.password) Both Company and User has validations, so there's a possibility that they don't actually get saved to the DB, and in that case he don't want *any* of them to be saved (I assume). I was thinking about something like this: begin Company.transaction do @company = Company.create!( :name = @input.name, :sub_domain = @input.subdomain) @user = User.create!( :company_id = @company.id, :first_name = @input.first_name, :last_name = @input.last_name, :email = @input.email, :password = @input.password) end rescue @errors = [...@company, @user].compact.map(:full_messages).flatten render :errors else redirect Login end But I'm wondering if there's a better way to solve this? // Magnus Holm ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Reloading in a standard config.ru rack app (Camping 2.0)
Dear Camping ninjas, I've been using Camping via bin/camping and reloading works as expected OK. What I have not been able to do is to correctly setup a Camping app with reloading support in a standard config.ru rack app. Thanks for your attention --Omar Gómez -- Follow me at: Twitter: http://twitter.com/omargomez Buzz: http://www.google.com/profiles/108165850309051561506#buzz ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: using Tilt requires full controller reference
Alright I updated camping to .405, did a pristine on Tilt (v1.0.1), removed the include X from my Base module and my controllers are still being found (no anonymous modules errors). Re: your test, I required camping/template and got this: NameError: uninitialized constant Riki::Base::Template /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:440:in `load_missing_constant' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:80:in `const_missing' (eval):13:in `lookup' (eval):12:in `fetch' (eval):12:in `lookup' (eval):15:in `render' ./riki/controllers.rb:11:in `get' (eval):28:in `send' (eval):28:in `service' (eval):28:in `catch' (eval):28:in `service' (eval):39:in `call' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/session/cookie.rb:37:in `call' (eval):43:in `call' /usr/local/lib/ruby/gems/1.8/gems/camping-2.0.405/bin/../lib/camping/server.rb:176:in `call' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:47:in `_call' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:35:in `call' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb:24:in `call' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/commonlogger.rb:18:in `call' /usr/local/lib/ruby/gems/1.8/gems/camping-2.0.405/bin/../lib/camping/server.rb:242:in `call' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/content_length.rb:13:in `call' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb:48:in `service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb:14:in `run' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:155:in `start' /usr/local/lib/ruby/gems/1.8/gems/camping-2.0.405/bin/../lib/camping/server.rb:144:in `start' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:83:in `start' /usr/local/lib/ruby/gems/1.8/gems/camping-2.0.405/bin/camping:9 /usr/local/bin/camping:19:in `load' /usr/local/bin/camping:19 On Fri, Jul 23, 2010 at 5:44 PM, Magnus Holm judo...@gmail.com wrote: You'll have to agree that include X sounds so much better than include Controllers? :-) Could you test one more thing for me? Without a Tilt patch, can you add `require 'camping/templates'` right after `require 'camping'` and check if it still works? Here you go: `gem install camping --source http://gems.judofyr.net/` // Magnus Holm On Fri, Jul 23, 2010 at 21:48, David Susco dsu...@gmail.com wrote: lol, at first I thought you were messing with me. X is the apps Controllers module, correct? Will I always have to do this when using Tilt? Or only until this patch makes it into a gem? Dave On Fri, Jul 23, 2010 at 3:09 PM, Magnus Holm judo...@gmail.com wrote: Wait, forget about that Tilt patch. Try this instead: module App include X end // Magnus Holm On Fri, Jul 23, 2010 at 18:01, David Susco dsu...@gmail.com wrote: Hey Magnus, I patched the files and it's still the same thing. Here's the backtrace, let me know if you want browser dump as well. 127.0.0.1 - - [23/Jul/2010 11:48:39] GET /Home HTTP/1.1 500 95353 0.3607 ArgumentError: Anonymous modules have no name to be referenced by /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:585:in `to_constant_name' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:391:in `qualified_name_for' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:104:in `const_missing' /var/www/apps/crud/riki/views/layout.haml:23:in `evaluate_source' /usr/local/lib/ruby/gems/1.8/gems/tilt-1.0.1/lib/tilt.rb:195:in `evaluate' /usr/local/lib/ruby/gems/1.8/gems/tilt-1.0.1/lib/tilt.rb:560:in `evaluate' /usr/local/lib/ruby/gems/1.8/gems/tilt-1.0.1/lib/tilt.rb:128:in `render' (eval):15:in `render' (eval):15:in `render' ./riki/controllers.rb:85:in `get' (eval):27:in `send' (eval):27:in `service'
Re: Camping on StackOverflow
I've asked some of them (even though they are several months olds) and have also subscribed to the camping-tag. I'll try to automatically forward them to the camping-list :-) // Magnus Holm On Sun, Jul 25, 2010 at 12:53, Dave Everitt dever...@innotts.co.uk wrote: Camping has a new user on StackOverflow :-) - I just stumbled across this: http://stackoverflow.com/questions/2618535/camping-return-user-to-recent-entries-but-keep-errors If anyone with a StackOverflow account wants to leap in? Dave Everitt ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Camping on StackOverflow
Oh, and if you have an account on SO don't forget to use your voting power to upvote or downvote! :-) On 7/25/2010 7:11 AM, Philippe Monnet wrote: I think we probably need to also keep an eye on StackOverflow since it is now one of the top tech destinations with a super high amount of developer traffic. I just subscribed to the Camping tag RSS feed too. Also when answering we can encourage people to join our mailing list in our comments. I will check more often as I use StackOverflow several times a week anyway. I guess it's all part of our diversification to get the word out on Camping. Do you guys think we should cherry pick interesting questions every so often and either cross post to our list or maybe add to an FAQ page? On 7/25/2010 6:00 AM, Magnus Holm wrote: I've asked some of them (even though they are several months olds) and have also subscribed to the camping-tag. I'll try to automatically forward them to the camping-list :-) // Magnus Holm On Sun, Jul 25, 2010 at 12:53, Dave Everittdever...@innotts.co.uk wrote: Camping has a new user on StackOverflow :-) - I just stumbled across this: http://stackoverflow.com/questions/2618535/camping-return-user-to-recent-entries-but-keep-errors If anyone with a StackOverflow account wants to leap in? Dave Everitt ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Camping on StackOverflow
I think we probably need to also keep an eye on StackOverflow since it is now one of the top tech destinations with a super high amount of developer traffic. I just subscribed to the Camping tag RSS feed too. Also when answering we can encourage people to join our mailing list in our comments. I will check more often as I use StackOverflow several times a week anyway. I guess it's all part of our diversification to get the word out on Camping. Do you guys think we should cherry pick interesting questions every so often and either cross post to our list or maybe add to an FAQ page? On 7/25/2010 6:00 AM, Magnus Holm wrote: I've asked some of them (even though they are several months olds) and have also subscribed to the camping-tag. I'll try to automatically forward them to the camping-list :-) // Magnus Holm On Sun, Jul 25, 2010 at 12:53, Dave Everittdever...@innotts.co.uk wrote: Camping has a new user on StackOverflow :-) - I just stumbled across this: http://stackoverflow.com/questions/2618535/camping-return-user-to-recent-entries-but-keep-errors If anyone with a StackOverflow account wants to leap in? Dave Everitt ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Camping on StackOverflow
There aren't enough Camping questions on SO to cherry pick :-) but getting them to use the mailing list would be good, although we'd also want to answer directly on SO - Dave E. On 25 Jul 2010, at 14:11, Philippe Monnet wrote: I think we probably need to also keep an eye on StackOverflow since it is now one of the top tech destinations with a super high amount of developer traffic. I just subscribed to the Camping tag RSS feed too. Also when answering we can encourage people to join our mailing list in our comments. I will check more often as I use StackOverflow several times a week anyway. I guess it's all part of our diversification to get the word out on Camping. Do you guys think we should cherry pick interesting questions every so often and either cross post to our list or maybe add to an FAQ page? On 7/25/2010 6:00 AM, Magnus Holm wrote: I've asked some of them (even though they are several months olds) and have also subscribed to the camping-tag. I'll try to automatically forward them to the camping-list :-) ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Wiki vs homepage
Also in the spirit of SEO, maybe we just need to have multiple domain names all linking back or redirecting to ruby-camping.com. I am willing to buy and commit to ruby-camping.com so anyone else is free to buy campingrb.com or any other naming permutation they like. This way we can all have our cake and eat it too! Any objections at this point on me moving forward? On 7/23/2010 12:19 PM, Dave Everitt wrote: May not be attractive, but if it's already a ruby-related meme, worth considering - Dave E On 23 Jul 2010, at 17:38, Philippe Monnet wrote: My preference would be to have Ruby explicitly mentioned in the name and a clear easy-to-read url. This makes it a bit more SEO friendly too which is important for a promo site. IMHO suffixing with rb is not very visually attractive. On 7/23/2010 9:39 AM, Steve Klabnik wrote: I don't know if it's available or not, but why not campingrb.com rather than ruby-camping.com? Many of the other small web frameworks follow this url scheme (sinatrarb and padrinorb). ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Camping on StackOverflow
Speaking of the mailing list: rubyforge sucks! Couldn't we have something nice, like librelist? Those hackety hack guys with their fancy mailing list put ours to shame. _why is still the admin contact of this list. :| On 26/07/2010, at 12:18 AM, Dave Everitt wrote: There aren't enough Camping questions on SO to cherry pick :-) but getting them to use the mailing list would be good, although we'd also want to answer directly on SO - Dave E. On 25 Jul 2010, at 14:11, Philippe Monnet wrote: I think we probably need to also keep an eye on StackOverflow since it is now one of the top tech destinations with a super high amount of developer traffic. I just subscribed to the Camping tag RSS feed too. Also when answering we can encourage people to join our mailing list in our comments. I will check more often as I use StackOverflow several times a week anyway. I guess it's all part of our diversification to get the word out on Camping. Do you guys think we should cherry pick interesting questions every so often and either cross post to our list or maybe add to an FAQ page? On 7/25/2010 6:00 AM, Magnus Holm wrote: I've asked some of them (even though they are several months olds) and have also subscribed to the camping-tag. I'll try to automatically forward them to the camping-list :-) ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Camping on StackOverflow
Librelist looks great. Can it take the existing archives? How can inboard links to the existing list be forwarded? Are the killer questions - Dave E. Speaking of the mailing list: rubyforge sucks! Couldn't we have something nice, like librelist? Those hackety hack guys with their fancy mailing list put ours to shame. _why is still the admin contact of this list. :| ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Camping on StackOverflow
There is an interesting comment on the Librelist site: ... All archives are accessible efficiently via rsync as maildir directories. This means you can _/host your mailing list archives on your project's site rather than directing users to Librelist/_. Librelist also provides simple archive browsing for smaller projects that can't host themselves. I am not very Unix savvy at all but does this imply you could rsynch from RubyForge? I am way out of my depth here... On 7/25/2010 10:22 AM, Dave Everitt wrote: Librelist looks great. Can it take the existing archives? How can inboard links to the existing list be forwarded? Are the killer questions - Dave E. Speaking of the mailing list: rubyforge sucks! Couldn't we have something nice, like librelist? Those hackety hack guys with their fancy mailing list put ours to shame. _why is still the admin contact of this list. :| ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Wiki vs homepage
Ok I would really like to get the promo site going so that we have something up and running before Why Day (Aug 19th per http://whyday.org/). I propose the following: 1. I can go ahead and buy the ruby-camping.com domain - should someone also buy the .org equivalent? I think the promo site has to have a straightforward name related to ruby and camping (similar to ruby-lang) to make it easy for people to remember the site or search for it. (We can use whywentcamping.com for something else like either the doc site or the site focusing on learning and hosting simple apps - see Jenna's ideas on this) 2. Until we know what other things we want to do with ruby-camping.com in terms of showcasing apps and all, I can either host the site: a) at my host (11 - ok for now with straight content only - the downside is I will be the bottleneck for updates b) or deploy it on Heroku - we can have multiple collaborators to push content via git. This would also give us more flexibility in the long run (like diff versions of Ruby, db, plugins, etc - and maybe we can get sponsored 3. For the time being I will leave the site as straight HTML and Javascript (we can switch it to Camping+Tilt later) 4. I will create a ruby-camping.com project under camping in GitHub and upload the content. This way anyone can contribute to the design - wink wink uh-hmm Jenna/Dave/Matt/... ;-) Let me know if you're ok with this or provide alternatives. I'd like to get this done this week-end. Philippe (@techarch) On 7/8/2010 1:55 PM, Magnus Holm wrote: Hey guys, Philippe had some interesting points about the website: 1. Keep the home page simple with all content fitting within 1280 x 1024 2. Use a catchy design (need some help here) 3. Accentuate that Camping is about Ruby (maybe also include the ruby logo somewhere) 4. Have a brief note about the connection to _why and a link to a page explaining the history of Camping with further links to _why's other sites 5. Encourage people to try it by capitalizing on some of Camping's strengths: - Fast to learn - requires only basic Ruby skills - Much simpler than Rails but more structure than Sinatra/Padrino - Lightning fast and memory efficient allowing fast and efficient sites - Can evolve from simple file to organized directory structure - Can layer in more features later using persistence and choice of view engines 6. How about using some kind of an animated (auto advancing) slideshow to highlight some of the benefits? See an example at: http://blog.monnet-usa.com/?p=276 7. How about a page on learning with a link to the book as well as a list of links for other tutorials or short explanations on key topics (e.g. how to do migrations, how to use include/extend, how to use different view engines, etc.)? 8. How about a page about plugins with some brief description of their intent? 9. I would love for us to include _why's cartoons in some of the sub pages ;-) Now, the more I look at this list (and my own thoughts about the new camping site) I realize that we're talking about two different things: * A site to attract new users * A site to inform regular users It looks like my attempt (http://whywentcamping.judofyr.net/) tries to target the latter, while Philippe targeted the former (http://rubycamping.monnet-usa.com/). Both sites serves a purpose and I believe both are equally important. -- Here's what I propose: We split the site into two parts. We turn what I've created into a wiki. Everyone are welcome to edit and add their own content. Then we take Philippe's ideas/design/site and turn it into ruby-camping.com or whywentcamping.com or whatnot. It probably doesn't need to be more than a single page. What'd ya think? // Magnus Holm ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Wiki vs homepage
Hi Steve - I really like that idea. Of course, someone (us) is going to have to actually purchase the domain at some point :-) - Dave E I don't know if it's available or not, but why not campingrb.com rather than ruby-camping.com? Many of the other small web frameworks follow this url scheme (sinatrarb and padrinorb). ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: using Tilt requires full controller reference
Hey Magnus, I patched the files and it's still the same thing. Here's the backtrace, let me know if you want browser dump as well. 127.0.0.1 - - [23/Jul/2010 11:48:39] GET /Home HTTP/1.1 500 95353 0.3607 ArgumentError: Anonymous modules have no name to be referenced by /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:585:in `to_constant_name' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:391:in `qualified_name_for' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:104:in `const_missing' /var/www/apps/crud/riki/views/layout.haml:23:in `evaluate_source' /usr/local/lib/ruby/gems/1.8/gems/tilt-1.0.1/lib/tilt.rb:195:in `evaluate' /usr/local/lib/ruby/gems/1.8/gems/tilt-1.0.1/lib/tilt.rb:560:in `evaluate' /usr/local/lib/ruby/gems/1.8/gems/tilt-1.0.1/lib/tilt.rb:128:in `render' (eval):15:in `render' (eval):15:in `render' ./riki/controllers.rb:85:in `get' (eval):27:in `send' (eval):27:in `service' (eval):27:in `catch' (eval):27:in `service' (eval):38:in `call' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/session/cookie.rb:37:in `call' (eval):42:in `call' /usr/local/lib/ruby/gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:176:in `call' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:47:in `_call' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:35:in `call' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb:24:in `call' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/commonlogger.rb:18:in `call' /usr/local/lib/ruby/gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:242:in `call' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/content_length.rb:13:in `call' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb:48:in `service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb:14:in `run' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:155:in `start' /usr/local/lib/ruby/gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:144:in `start' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:83:in `start' /usr/local/lib/ruby/gems/1.8/gems/camping-2.0.392/bin/camping:9 /usr/local/bin/camping:19:in `load' /usr/local/bin/camping:19 On Wed, Jul 21, 2010 at 5:26 PM, Magnus Holm judo...@gmail.com wrote: A reference to a controller is also a constant. Everything which starts with an uppercase letter is in fact a constant. Hm. Could you give me a backtrace? It seems like it's ActiveSupport's const_missing or something like that. You don't really need to read/understand all those comments in the patch. It's all related to the fact that Tilt defines the template as a method under the Tilt::CompileSite (which is included in each request in Camping) so when you call #render it actually calls a method called #_tilt_ajdbakjasjdbakjsbdk in the background. Calling a method is way faster than instance_eval, so this gives a significant speed improvement. The problem by defining the method under Tilt::CompileSite is that constant lookup is now relative to Tilt::CompileSite instead of your request. This is what the patch fixes. // Magnus Holm On Wed, Jul 21, 2010 at 22:53, David Susco dsu...@gmail.com wrote: Thanks Magnus, I gave that a shot but I'm still getting an argument error: Anonymous modules have no name to be referenced by I'm trying to wrap my mind around what this patch is doing, but I don't see the connection between constants and a reference to a controller. Dave On Wed, Jul 21, 2010 at 3:29 PM, Magnus Holm judo...@gmail.com wrote: This is a well-known bug in Tilt: http://groups.google.com/group/tiltrb/browse_thread/thread/19fef5370c4d417f The thread includes a quite simple patch for 1.8, and a larger, very hackish patch for 1.8+1.9. // Magnus Holm On Wed, Jul 21, 2010 at 21:05, David Susco dsu...@gmail.com wrote: When using Tilt for views I need to completely specify the
Re: Wiki vs homepage
My preference would be to have Ruby explicitly mentioned in the name and a clear easy-to-read url. This makes it a bit more SEO friendly too which is important for a promo site. IMHO suffixing with rb is not very visually attractive. On 7/23/2010 9:39 AM, Steve Klabnik wrote: I don't know if it's available or not, but why not campingrb.com http://campingrb.com rather than ruby-camping.com http://ruby-camping.com? Many of the other small web frameworks follow this url scheme (sinatrarb and padrinorb). Or maybe not. I just think it's an interesting url for Ruby projects. ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Wiki vs homepage
Anyone know who did this: http://camping.tumblr.com/ ? Dave E Jenna: I suggest a tumblr, because it doesn't cost anything, can have group committers, all the features we need, and it too is connected to the rich heritage of _why :) ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Wiki vs homepage
May not be attractive, but if it's already a ruby-related meme, worth considering - Dave E On 23 Jul 2010, at 17:38, Philippe Monnet wrote: My preference would be to have Ruby explicitly mentioned in the name and a clear easy-to-read url. This makes it a bit more SEO friendly too which is important for a promo site. IMHO suffixing with rb is not very visually attractive. On 7/23/2010 9:39 AM, Steve Klabnik wrote: I don't know if it's available or not, but why not campingrb.com rather than ruby-camping.com? Many of the other small web frameworks follow this url scheme (sinatrarb and padrinorb). ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: using Tilt requires full controller reference
lol, at first I thought you were messing with me. X is the apps Controllers module, correct? Will I always have to do this when using Tilt? Or only until this patch makes it into a gem? Dave On Fri, Jul 23, 2010 at 3:09 PM, Magnus Holm judo...@gmail.com wrote: Wait, forget about that Tilt patch. Try this instead: module App include X end // Magnus Holm On Fri, Jul 23, 2010 at 18:01, David Susco dsu...@gmail.com wrote: Hey Magnus, I patched the files and it's still the same thing. Here's the backtrace, let me know if you want browser dump as well. 127.0.0.1 - - [23/Jul/2010 11:48:39] GET /Home HTTP/1.1 500 95353 0.3607 ArgumentError: Anonymous modules have no name to be referenced by /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:585:in `to_constant_name' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:391:in `qualified_name_for' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:104:in `const_missing' /var/www/apps/crud/riki/views/layout.haml:23:in `evaluate_source' /usr/local/lib/ruby/gems/1.8/gems/tilt-1.0.1/lib/tilt.rb:195:in `evaluate' /usr/local/lib/ruby/gems/1.8/gems/tilt-1.0.1/lib/tilt.rb:560:in `evaluate' /usr/local/lib/ruby/gems/1.8/gems/tilt-1.0.1/lib/tilt.rb:128:in `render' (eval):15:in `render' (eval):15:in `render' ./riki/controllers.rb:85:in `get' (eval):27:in `send' (eval):27:in `service' (eval):27:in `catch' (eval):27:in `service' (eval):38:in `call' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/session/cookie.rb:37:in `call' (eval):42:in `call' /usr/local/lib/ruby/gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:176:in `call' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:47:in `_call' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lint.rb:35:in `call' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb:24:in `call' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/commonlogger.rb:18:in `call' /usr/local/lib/ruby/gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:242:in `call' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/content_length.rb:13:in `call' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb:48:in `service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb:14:in `run' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:155:in `start' /usr/local/lib/ruby/gems/1.8/gems/camping-2.0.392/bin/../lib/camping/server.rb:144:in `start' /usr/local/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/server.rb:83:in `start' /usr/local/lib/ruby/gems/1.8/gems/camping-2.0.392/bin/camping:9 /usr/local/bin/camping:19:in `load' /usr/local/bin/camping:19 On Wed, Jul 21, 2010 at 5:26 PM, Magnus Holm judo...@gmail.com wrote: A reference to a controller is also a constant. Everything which starts with an uppercase letter is in fact a constant. Hm. Could you give me a backtrace? It seems like it's ActiveSupport's const_missing or something like that. You don't really need to read/understand all those comments in the patch. It's all related to the fact that Tilt defines the template as a method under the Tilt::CompileSite (which is included in each request in Camping) so when you call #render it actually calls a method called #_tilt_ajdbakjasjdbakjsbdk in the background. Calling a method is way faster than instance_eval, so this gives a significant speed improvement. The problem by defining the method under Tilt::CompileSite is that constant lookup is now relative to Tilt::CompileSite instead of your request. This is what the patch fixes. // Magnus Holm On Wed, Jul 21, 2010 at 22:53, David Susco dsu...@gmail.com wrote: Thanks Magnus, I gave that a shot but I'm still getting an argument error: Anonymous modules have no name to be referenced by I'm trying to wrap my mind around what this patch is doing, but I don't see the connection between
Re: database filesystem duality
it began with camping, Matju had been using Ruby in Gridflow since ages before, so he pointed me to poignant guide and i noticed the announcement on redhanded and tried out store them in some sort of indexy thing, where we could use filesystem locks to keep from writing over eachother, and garbage collect / compress every now and then. That could work really well, and could be nice pure ruby. Mmmm. Is this crazy? Am I a nut for thinking that a simple multiprocess safe key/value store would actually be really easy to do? I've played with the filesystem as a storage medium a fair bit.. it seems like it should be almost trivial! Maybe I should make this right now! eventualy i had wiped out all the varying parts with replacements, but it is important to remember Camping provided the scaffolding to get off the ground went 1.9x Ruby because of proper lexical scoping of blocks (mainly) + fast but that broke Markaby..and there was all this code in there with Builder and such and god knows what i was suposed to fix (multipled by metaprogramming tweak-ness) Ruby's Hash/Array connstructors obviated a custom template-language parser or meta-methodery hacks (magic?) http://element.rubyforge.org/git?p=element.git;a=blob;f=ruby/H.rb so sqlite databases being locked by other processes, mysql servers that werent running or had a wrong password (or hardpowerd and required myisamcks). then redland's SWIG wrappers segfaulting ruby with memory errors back to FS. i guess E class is sort of a jquery for a filesystem sitting at convergence of HTTP URIs, and filesystem paths so i want to read today's email (delivered by getmail, with a 1 line procmailrc rule to put into dirs by date, and cloud-persisted across phones/netbooks with rsync/ceph/nfs) so GET /mail, it goes to thiS: fn '/mail/GET',-e,r{[303,{Location: '/m/'+(Time.now.strftime '%Y/%m/%d')+'/*?'+(r ?r['QUERY_STRING']:'')}]} which constructs today's path, and redirects: GET /m/2010/07/20/*?view=threads there are no 'routes' just a mapping from URI to resourceSet. which includes globbing, 'fragments' of documents (after #), and depth-first traversal (for pagination of large quantities of stuff, or sorted values) so that glob all todays mails, extracts the triples and creates a (Hash) model alive for the request. views are specified in QS, so ?view=threads, you get a basic overview: http://i574.photobucket.com/albums/ss187/ix9/hyper/2010-03-27-051943_1280x800_scrot.png triple sources are functions that yield 3 values, and exist for most of the comon things. so your message, aanlktimtvv0c39kypjyj-ve1uxhgrh1tsc6x3q8g-...@mail.gmail.com has an ID, and URI and the Filesystem cant just store this as is, unless you want 3 million files in a dir. so using sometihng git-like: irb(main):005:0 E('aanlktimtvv0c39kypjyj-ve1uxhgrh1tsc6x3q8g-...@mail.gmail.com').d = /var/E/ee/dc/QUFOTGtUaW10VlYwQzM5a3lQSllKLXZlMXVYSEdSSDFUc0M2eDNROEctSXBCQG1haWwuZ21haWwuY29t does its best to use a path similar to the URI, to not nuke everything outright irb(main):006:0 E('http://camping.org').d = /var/http://camping.org; in addition to these paths, theres a path of metadata _about_ this path irb(main):007:0 E('http://camping.org').u = #E:0x00015ebfd8 @uri=/http://camping.org/, @graph=nil so , in this way, you can create indexed properties: eg, mail references are ugly index paths like: /usr/src/index//http:/rdfs.org/sioc/ns#reference//E/e0/43/MTI3OTYyODYzMi4zMjcxLjEwLmNhbWVsQG1pZGdhcmQ= so when i request a message, provide a query in the QS: fn 'data/thread',-d,_,m{d.walk SIOC+'reference',m} this walks those index paths and constructs the entire thread def walk p,m={},v={} m.merge! memoModel v[uri]=true ((attr p)||[]).concat(((E p).po self)||[]).map{|r| r.E.walk p,m,v if !v[r.uri]} m end ..theres functions to go to/from memory models, lookup FS indexes, and so on, in probably camping-style (ive been told my code is 'obfuscated' anwyas) some other doc @ http://blog.whats-your.name/public/carmen.html creating a 265 message thread including finding all the messages and rendering a view takes about a second on my laptop, which is fine for my needs. you could use the resourceSet X mtimes as a cache key since all data is (convertable to/from) RDF you could go crazy with 4store and SPARQL if you needed more insane indexing options so yeah, let me know what you come up with, im interested in checking it out if a darn OS booted, you have a FS.., ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Wiki vs homepage
I love the idea of having Key/Value databases available to camping apps as a standard thing on the platform. They aren't the same thing as a filesystem though, and I don't think we should pretend otherwise. If we don't want to give users filesystem access, that's *fine*, even though I don't see why we shouldn't. What about this - We make a sister project, ForeverHash, which works just like a normal hash except that when you .new it you have to give it a name, like ForeverHash.new(:people), resulting in people.db existing some place in the filesystem. We could have a campers-toolkit gem which would default to using yaml or marshal or whatever to shove that stuff in a file on close, and read it in on launch. When stuff like TokyoCabinet is available, it'd just magically be faster and awesomer. campers-toolkit could have tons of neat little bonus toys like that. Thing is, Heroku is this big scary thing which is all about performance and big deployments and commercialisation and not at all about learning and hacking and making stupid little games and programs that do your math homework for you (that's why I learnt to write basic!). We already have Heroku. We don't need another abstraction to it. Fake filesystem atop a key/value database would be a fun hack, but it'd go crazy with things like the exotic file locks sqlite uses. I propose this: We settle on the idea that we are in fact an awesome bunch and that camping still has that wonderful educational essence of it's beginnings, and that being loosely connected to _why, we already have some weight with educators. There are computer labs full to the brim with boxes doing nearly nothing in schools all around the place! The internet itself was practically born of excessive computing power at universities needing to find something to do with itself! So I propose we stop eating the little scraps of free stuff the capitalist processes that drive services like heroku and dreamhost produce, and really try and pester the educational systems of the world - see if they'll give us a server and plug it in to some pipes to get this idea going. If we can get a dedicated server somewhere, making secured little app hosting is trivial and fun and super easy to do! Web hosting friends inform me that linuxes have no worries at all with hundreds of thousands of user accounts. That's how tryruby worked way back when - it made a new user account when you entered your first command, ran it, and removed the account if it idled out. That's how try ruby was secure! All we need to do is use the same tools shared webhosts have been using for decades, like unix file permissions and apache or ngynix and passenger and chroot and a user account per user or app, and we have a totally viable way to do this. Passenger will run as many processes as each app needs, and shut them down when nobody is using that app. The ruby processes can run under that user's account, and we can automatically apply permissions to the files as they're uploaded and updated. Then we just short out the system/``/chown type commands in the ruby process with a little bootstrap code added to the rackup and we've got it sorted. The tech here is easy and fun. Getting a server to run it on could be tricky - but we have avenues to explore. We NEED to get a good website up with a blog (I suggest a tumblr, because it doesn't cost anything, can have group committers, all the features we need, and it too is connected to the rich heritage of _why :) Then we can put the callout. Once a plan is formed for the tech and the look of the thing, we can get a blog post up explaining the idea and asking for help, and start mailing it around to universities and schools, asking if they have any extra servers they might donate to the cause. Carnegie Mellon physically hosted art code. Maybe they'd host us too! // Sidebar: Okay, so yaml and marshal would suck as a backend because it'd go crazy without any obvious reason if the user launched multiple processes, as they may well do if using lighttpd. Still, it doesn't have to be *fast*, so maybe there's some sort of compramise to be had? Marshal the values, and store them in some sort of indexy thing, where we could use filesystem locks to keep from writing over eachother, and garbage collect / compress every now and then. That could work really well, and could be nice pure ruby. Mmmm. Is this crazy? Am I a nut for thinking that a simple multiprocess safe key/value store would actually be really easy to do? I've played with the filesystem as a storage medium a fair bit.. it seems like it should be almost trivial! Maybe I should make this right now! On Sat, Jul 17, 2010 at 11:05 PM, Philippe Monnet r...@monnet-usa.comwrote: I think having a section off of the promo site (and linked from the wiki too) to showcase simple user-created apps is a great idea as I have not seen that concept on other sites. I believe Magnus is building a TryCamping thing too which would be awesome
Re: Wiki vs homepage
I agree wholly on the design front, and would like to contribute cartoony doodles and simple (not Backend Web Developer simple, but Designer Simple) web designs in vaguely _why's quirky fun style, if you guys are up for that. I'm currently rather more focused on Hackety Hack's web stuff, but in a couple of weeks when I get tired of drawing fruit bats and laser-breathing dinosaurs, Maybe camping would be a fun place to doodle? :) If I forget, poke me @Bluebie. @Judofyr - if you want to chat, I am a...@creativepony.com on msn/jabber these days. :) Oh, and I don't know what the others think of this idea, but there is some talk of HetyH having a forum in the next refresh of it's website. How would you guys feel about being a part of that? I'm rather fond of the idea of reuniting the old _why community in some common shared space like that, though I'd fully understand if you guys feel it'd be a smelly situation to be a category in another project's forum. Maybe instead - if you guys are pro-forum - there could be a website.. perhaps named something like 'Whyism', a special little cult of _why place for us all to hang out and talk about all his old projects, and our new stuff too. To keep the spirit of it all alive? — Jenna Fox http://creativepony.com On 09/07/2010, at 5:55 AM, Magnus Holm wrote: Hey guys, Philippe had some interesting points about the website: 1. Keep the home page simple with all content fitting within 1280 x 1024 2. Use a catchy design (need some help here) 3. Accentuate that Camping is about Ruby (maybe also include the ruby logo somewhere) 4. Have a brief note about the connection to _why and a link to a page explaining the history of Camping with further links to _why's other sites 5. Encourage people to try it by capitalizing on some of Camping's strengths: - Fast to learn - requires only basic Ruby skills - Much simpler than Rails but more structure than Sinatra/Padrino - Lightning fast and memory efficient allowing fast and efficient sites - Can evolve from simple file to organized directory structure - Can layer in more features later using persistence and choice of view engines 6. How about using some kind of an animated (auto advancing) slideshow to highlight some of the benefits? See an example at: http://blog.monnet-usa.com/?p=276 7. How about a page on learning with a link to the book as well as a list of links for other tutorials or short explanations on key topics (e.g. how to do migrations, how to use include/extend, how to use different view engines, etc.)? 8. How about a page about plugins with some brief description of their intent? 9. I would love for us to include _why's cartoons in some of the sub pages ;-) Now, the more I look at this list (and my own thoughts about the new camping site) I realize that we're talking about two different things: * A site to attract new users * A site to inform regular users It looks like my attempt (http://whywentcamping.judofyr.net/) tries to target the latter, while Philippe targeted the former (http://rubycamping.monnet-usa.com/). Both sites serves a purpose and I believe both are equally important. -- Here's what I propose: We split the site into two parts. We turn what I've created into a wiki. Everyone are welcome to edit and add their own content. Then we take Philippe's ideas/design/site and turn it into ruby-camping.com or whywentcamping.com or whatnot. It probably doesn't need to be more than a single page. What'd ya think? // Magnus Holm ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Wiki vs homepage
Another passing thought: It'd be very much in the spirit of freeform fun little hacks if the camping website included a section of user created apps. They would need to be moderated somehow, unless someone were to set up a try-rubyish highly sandboxed environment to run them. It just seems like there'd be no better way to show what Camping is all about than to have it's very own website full of fun little examples of camping apps, with a way to see the source code of each right in there. If you guys had something like that, i'd love to contribute some quirky little multiplayer games, and an extremely simple chat thing. :) What with rack mounts, this should be easy, right? Why did say at art code that he didn't really care if the code editor part of HetyH was really good - what mattered was the sharing. The forum. The code messaging system. The apps which could talk to each other over the web through the various APIs. That was the important part of hackety hack. I think that's the important part of camping as well. The main reason I use Camping over Sinatra and the likes is the way it feels so warm and fuzzy, and I know if I have any troubles, I get to come talk to all you awesome people. :) If we had the sandboxed thing, it'd be fairly trivial to include a little cli app in the camping gem to upload the app in to a whyism or hetyh or whatever account, where it could sit in a little bin of recent uploads, and be attached to forum posts, or shared out like tinyurls. The most important part of all that is kids. Kids don't have web servers. It's all well and good to have camping ourselves, but if we're to think for one minute that we're helping kids learn ruby (which after all, was _why's mission), we've got to be offering some fairly easy way for them to host this stuff. Does anyone know much about sandboxing? Anyone know if it'd be particularly difficult to do things like monkeypatch the IO class to effectively chroot and secure a camping app? Can we disable `system calls` too? What's involved in making something like that viable? Hosts like Dreamhost seem to already be making use of Passenger to dynamically allocate ruby processes to apps, so they can be booted up when requested and shut down after they idle for a minute. :) — Jenna Fox http://creativepony.com/ ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: using reststop with tilt
Got a chance to work on this this morning. First patch worked fine, no problem. The second wasn't working for me until I remembered you need to separate out a method's name as its own argument when passing it to another method. So, from my example above, you need to do this: render :_button, R(SomeController), 'Some Controller' The comma after _button is the key. Anyway, they both worked for me, thanks Magnus. Dave On Fri, Jul 9, 2010 at 9:47 PM, David Susco dsu...@gmail.com wrote: Thanks Magnus, those changes make sense to me. I can test them out no problem, just not until Monday. I'll send out another e-mail then. Thanks, Dave On Fri, Jul 9, 2010 at 5:30 PM, Philippe Monnet r...@monnet-usa.com wrote: Yes I think the first patch makes sense to filter out partials from the process of applying the layout. For the second patch now I get why Dave's parameters were not being used. So now your change would send *a . Cool. Dave do you want to try that out? And then Magnus can go ahead and apply it and maybe also to update the official gem. On 7/9/2010 2:20 PM, Magnus Holm wrote: Should we apply a patch like this? diff --git a/lib/camping-unabridged.rb b/lib/camping-unabridged.rb index 636ad6f..f3195b3 100644 --- a/lib/camping-unabridged.rb +++ b/lib/camping-unabridged.rb @@ -272,7 +272,7 @@ module Camping def render(v, o={}, b) if t = lookup(v) s = (t == true) ? mab{ send(v, b) } : t.render(self, o[:locals] || {}, b) - s = render(L, o.merge(L = false)) { s } if o[L] != false lookup(L) + s = render(L, o.merge(L = false)) { s } if v.to_s[0] != ?_ o[L] != false lookup(L) s else raise Can't find template #{v} Also, currently you can pass arguments to `render`. What about this? diff --git a/lib/camping-unabridged.rb b/lib/camping-unabridged.rb index 636ad6f..c262757 100644 --- a/lib/camping-unabridged.rb +++ b/lib/camping-unabridged.rb @@ -269,9 +269,10 @@ module Camping # end # end # - def render(v, o={}, b) + def render(v, *a, b) if t = lookup(v) - s = (t == true) ? mab{ send(v, b) } : t.render(self, o[:locals] || {}, b) + o = a[0] || {} + s = (t == true) ? mab{ send(v, *a, b) } : t.render(self, o[:locals] || {}, b) s = render(L, o.merge(L = false)) { s } if o[L] != false lookup(L) s else // Magnus Holm On Fri, Jul 9, 2010 at 19:12, David Susco dsu...@gmail.com wrote: I do have the latest reststop gem, but the problem occurs when I'm *not* using reststop. The regular camping render method does not check for the _, where as the reststop render does. Line 166 is reststop is working, but there's no equivalent logic (that I can see) in camping render. I've tried calling partials in haml like this without any luck: =render :_button R(SomeController) 'Some Controller' =render _button R(SomeController) 'Some Controller' Dave On Fri, Jul 9, 2010 at 12:09 PM, Philippe Monnet r...@monnet-usa.com wrote: For issue #1: I think I added the change on line 166( when committing my last changes for gem 0.5.3) to check for partials in the normal flow of restop_render. Could you verify you have the latest? For issue #2: what does your %=render ... % code looks like? Is only the name of the partial inside the quotes (e.g. %=render _mypartial 123 'arg2' % )? If so the Camping render should be only performing the lookup on the partial name (the v argument) and send the other arguments along. On 7/9/2010 9:14 AM, David Susco wrote: FYI, when not using reststop, calling render :_some_partial from a template will automatically wrap the partial in the layout. I think this is because the render method automatically wraps a view in the layout if the layout exists, rather than checking if the first character is an underscore and then wrapping the view in the layout if this is not the case (like the basic_render method from reststop). Another thing that is not possibly when using Tilt (whether using reststop or not) is calling a partial that takes arguments. For instance, I have a Markaby partial for a button: def _button href, text='Cancel' a.button text, :href=href end I can call that from other Markaby views with: _button R(SomeController), 'Some Controller' But I can't call render on that method because the camping lookup method will try to turn the entire render argument into a symbol. It's trying to lookup a method _button R(SomeController), 'Some Controller' rather than a method _button with the arguments R(SomeController), 'Some Controller'. Hopefully that was clear enough. Dave On Fri, Jul 9, 2010 at 9:10 AM, David Susco dsu...@gmail.com wrote: Arg, I new it would be something simple. Thanks. Dave On Thu, Jul 8, 2010 at 10:54 PM, Philippe Monnet r...@monnet-usa.com wrote: David, If you're using Tilt, to make partials work in ERB or HAML you
Re: using reststop with tilt
Arg, I new it would be something simple. Thanks. Dave On Thu, Jul 8, 2010 at 10:54 PM, Philippe Monnet r...@monnet-usa.com wrote: David, If you're using Tilt, to make partials work in ERB or HAML you would need to explicitly call render with the name of the partial. So for example, in ERB: %=render _mypartial % Philippe (@techarch) On 7/8/2010 2:19 PM, David Susco wrote: Thanks Philippe, it's working great. Has anyone gotten partials to work with Tilt? Dave On Wed, Jul 7, 2010 at 9:58 PM, Philippe Monnet r...@monnet-usa.com wrote: I fixed the issue in the basic_render method. At the time I worked on RESTstop I had done the minimum needed to make it work with the new version of Camping. And when Tilt support was added I did not fully retrofit the code to make it work with Tilt templates. Problem corrected! Thanks David for helping us make the implementation more robust. I have also published a new 0.5.3 version of the gem. Philippe (@techarch) On 7/6/2010 10:07 PM, Philippe Monnet wrote: Hi David, I will look into this (probably this week-end though) - as I actually did not try Tilt at the same time as RESTstop. On 7/6/2010 7:45 AM, David Susco wrote: Still fooling around with this, no luck yet. Found some other things though. It seems I need to fully qualify controllers as arguments for URL and R methods when using Tilt (this is irrespective of whether I'm using reststop or not). Is there anything I can do to get around this? Also, is there anyway to call partials (markaby or other template files) from a template file? Dave On Wed, Jun 30, 2010 at 9:46 AM, David Susco dsu...@gmail.com wrote: I'm trying to use the new Tilt integration with reststop. All the aliases and whatnot under Implementing your own service (http://wiki.github.com/camping/reststop/) are there and :views has been set in the options hash. I tried creating sub-directories in the views directory (html, HTML) but I still couldn't get it to work. I can get my haml template to display if I get rid of the alias for reststop_render. All the other render calls to markaby still work when I do this too. However, I'm assuming I'm loosing the second argument for render in reststop when I do this. Am I missing some other setting/configuration option to get this to work with the alias for reststop_render? -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Wiki vs homepage
I agree to the separation as well. A site that introduces camping with a simple example/tutorial and that links to a wiki (with more advanced stuff) and the mailing list is a good way to go about it. Dave On Thu, Jul 8, 2010 at 10:20 PM, Philippe Monnet r...@monnet-usa.com wrote: Yeah, I agree that it makes sense to have two sites, one to promote Camping and one to serve as the official reference. And a wiki would be very convenient for that. On 7/8/2010 1:55 PM, Magnus Holm wrote: Hey guys, Philippe had some interesting points about the website: 1. Keep the home page simple with all content fitting within 1280 x 1024 2. Use a catchy design (need some help here) 3. Accentuate that Camping is about Ruby (maybe also include the ruby logo somewhere) 4. Have a brief note about the connection to _why and a link to a page explaining the history of Camping with further links to _why's other sites 5. Encourage people to try it by capitalizing on some of Camping's strengths: - Fast to learn - requires only basic Ruby skills - Much simpler than Rails but more structure than Sinatra/Padrino - Lightning fast and memory efficient allowing fast and efficient sites - Can evolve from simple file to organized directory structure - Can layer in more features later using persistence and choice of view engines 6. How about using some kind of an animated (auto advancing) slideshow to highlight some of the benefits? See an example at: http://blog.monnet-usa.com/?p=276 7. How about a page on learning with a link to the book as well as a list of links for other tutorials or short explanations on key topics (e.g. how to do migrations, how to use include/extend, how to use different view engines, etc.)? 8. How about a page about plugins with some brief description of their intent? 9. I would love for us to include _why's cartoons in some of the sub pages ;-) Now, the more I look at this list (and my own thoughts about the new camping site) I realize that we're talking about two different things: * A site to attract new users * A site to inform regular users It looks like my attempt (http://whywentcamping.judofyr.net/) tries to target the latter, while Philippe targeted the former (http://rubycamping.monnet-usa.com/). Both sites serves a purpose and I believe both are equally important. -- Here's what I propose: We split the site into two parts. We turn what I've created into a wiki. Everyone are welcome to edit and add their own content. Then we take Philippe's ideas/design/site and turn it into ruby-camping.com or whywentcamping.com or whatnot. It probably doesn't need to be more than a single page. What'd ya think? // Magnus Holm ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: using reststop with tilt
FYI, when not using reststop, calling render :_some_partial from a template will automatically wrap the partial in the layout. I think this is because the render method automatically wraps a view in the layout if the layout exists, rather than checking if the first character is an underscore and then wrapping the view in the layout if this is not the case (like the basic_render method from reststop). Another thing that is not possibly when using Tilt (whether using reststop or not) is calling a partial that takes arguments. For instance, I have a Markaby partial for a button: def _button href, text='Cancel' a.button text, :href=href end I can call that from other Markaby views with: _button R(SomeController), 'Some Controller' But I can't call render on that method because the camping lookup method will try to turn the entire render argument into a symbol. It's trying to lookup a method _button R(SomeController), 'Some Controller' rather than a method _button with the arguments R(SomeController), 'Some Controller'. Hopefully that was clear enough. Dave On Fri, Jul 9, 2010 at 9:10 AM, David Susco dsu...@gmail.com wrote: Arg, I new it would be something simple. Thanks. Dave On Thu, Jul 8, 2010 at 10:54 PM, Philippe Monnet r...@monnet-usa.com wrote: David, If you're using Tilt, to make partials work in ERB or HAML you would need to explicitly call render with the name of the partial. So for example, in ERB: %=render _mypartial % Philippe (@techarch) On 7/8/2010 2:19 PM, David Susco wrote: Thanks Philippe, it's working great. Has anyone gotten partials to work with Tilt? Dave On Wed, Jul 7, 2010 at 9:58 PM, Philippe Monnet r...@monnet-usa.com wrote: I fixed the issue in the basic_render method. At the time I worked on RESTstop I had done the minimum needed to make it work with the new version of Camping. And when Tilt support was added I did not fully retrofit the code to make it work with Tilt templates. Problem corrected! Thanks David for helping us make the implementation more robust. I have also published a new 0.5.3 version of the gem. Philippe (@techarch) On 7/6/2010 10:07 PM, Philippe Monnet wrote: Hi David, I will look into this (probably this week-end though) - as I actually did not try Tilt at the same time as RESTstop. On 7/6/2010 7:45 AM, David Susco wrote: Still fooling around with this, no luck yet. Found some other things though. It seems I need to fully qualify controllers as arguments for URL and R methods when using Tilt (this is irrespective of whether I'm using reststop or not). Is there anything I can do to get around this? Also, is there anyway to call partials (markaby or other template files) from a template file? Dave On Wed, Jun 30, 2010 at 9:46 AM, David Susco dsu...@gmail.com wrote: I'm trying to use the new Tilt integration with reststop. All the aliases and whatnot under Implementing your own service (http://wiki.github.com/camping/reststop/) are there and :views has been set in the options hash. I tried creating sub-directories in the views directory (html, HTML) but I still couldn't get it to work. I can get my haml template to display if I get rid of the alias for reststop_render. All the other render calls to markaby still work when I do this too. However, I'm assuming I'm loosing the second argument for render in reststop when I do this. Am I missing some other setting/configuration option to get this to work with the alias for reststop_render? -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -- Dave -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: using reststop with tilt
I do have the latest reststop gem, but the problem occurs when I'm *not* using reststop. The regular camping render method does not check for the _, where as the reststop render does. Line 166 is reststop is working, but there's no equivalent logic (that I can see) in camping render. I've tried calling partials in haml like this without any luck: =render :_button R(SomeController) 'Some Controller' =render _button R(SomeController) 'Some Controller' Dave On Fri, Jul 9, 2010 at 12:09 PM, Philippe Monnet r...@monnet-usa.com wrote: For issue #1: I think I added the change on line 166( when committing my last changes for gem 0.5.3) to check for partials in the normal flow of restop_render. Could you verify you have the latest? For issue #2: what does your %=render ... % code looks like? Is only the name of the partial inside the quotes (e.g. %=render _mypartial 123 'arg2' % )? If so the Camping render should be only performing the lookup on the partial name (the v argument) and send the other arguments along. On 7/9/2010 9:14 AM, David Susco wrote: FYI, when not using reststop, calling render :_some_partial from a template will automatically wrap the partial in the layout. I think this is because the render method automatically wraps a view in the layout if the layout exists, rather than checking if the first character is an underscore and then wrapping the view in the layout if this is not the case (like the basic_render method from reststop). Another thing that is not possibly when using Tilt (whether using reststop or not) is calling a partial that takes arguments. For instance, I have a Markaby partial for a button: def _button href, text='Cancel' a.button text, :href=href end I can call that from other Markaby views with: _button R(SomeController), 'Some Controller' But I can't call render on that method because the camping lookup method will try to turn the entire render argument into a symbol. It's trying to lookup a method _button R(SomeController), 'Some Controller' rather than a method _button with the arguments R(SomeController), 'Some Controller'. Hopefully that was clear enough. Dave On Fri, Jul 9, 2010 at 9:10 AM, David Susco dsu...@gmail.com wrote: Arg, I new it would be something simple. Thanks. Dave On Thu, Jul 8, 2010 at 10:54 PM, Philippe Monnet r...@monnet-usa.com wrote: David, If you're using Tilt, to make partials work in ERB or HAML you would need to explicitly call render with the name of the partial. So for example, in ERB: %=render _mypartial % Philippe (@techarch) On 7/8/2010 2:19 PM, David Susco wrote: Thanks Philippe, it's working great. Has anyone gotten partials to work with Tilt? Dave On Wed, Jul 7, 2010 at 9:58 PM, Philippe Monnet r...@monnet-usa.com wrote: I fixed the issue in the basic_render method. At the time I worked on RESTstop I had done the minimum needed to make it work with the new version of Camping. And when Tilt support was added I did not fully retrofit the code to make it work with Tilt templates. Problem corrected! Thanks David for helping us make the implementation more robust. I have also published a new 0.5.3 version of the gem. Philippe (@techarch) On 7/6/2010 10:07 PM, Philippe Monnet wrote: Hi David, I will look into this (probably this week-end though) - as I actually did not try Tilt at the same time as RESTstop. On 7/6/2010 7:45 AM, David Susco wrote: Still fooling around with this, no luck yet. Found some other things though. It seems I need to fully qualify controllers as arguments for URL and R methods when using Tilt (this is irrespective of whether I'm using reststop or not). Is there anything I can do to get around this? Also, is there anyway to call partials (markaby or other template files) from a template file? Dave On Wed, Jun 30, 2010 at 9:46 AM, David Susco dsu...@gmail.com wrote: I'm trying to use the new Tilt integration with reststop. All the aliases and whatnot under Implementing your own service (http://wiki.github.com/camping/reststop/) are there and :views has been set in the options hash. I tried creating sub-directories in the views directory (html, HTML) but I still couldn't get it to work. I can get my haml template to display if I get rid of the alias for reststop_render. All the other render calls to markaby still work when I do this too. However, I'm assuming I'm loosing the second argument for render in reststop when I do this. Am I missing some other setting/configuration option to get this to work with the alias for reststop_render? -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: using reststop with tilt
Yes I think the first patch makes sense to filter out partials from the process of applying the layout. For the second patch now I get why Dave's parameters were not being used. So now your change would send *a . Cool. Dave do you want to try that out? And then Magnus can go ahead and apply it and maybe also to update the official gem. On 7/9/2010 2:20 PM, Magnus Holm wrote: Should we apply a patch like this? diff --git a/lib/camping-unabridged.rb b/lib/camping-unabridged.rb index 636ad6f..f3195b3 100644 --- a/lib/camping-unabridged.rb +++ b/lib/camping-unabridged.rb @@ -272,7 +272,7 @@ module Camping def render(v, o={},b) if t = lookup(v) s = (t == true) ? mab{ send(v,b) } : t.render(self, o[:locals] || {},b) -s = render(L, o.merge(L = false)) { s } if o[L] != false lookup(L) +s = render(L, o.merge(L = false)) { s } if v.to_s[0] != ?_ o[L] != false lookup(L) s else raise Can't find template #{v} Also, currently you can pass arguments to `render`. What about this? diff --git a/lib/camping-unabridged.rb b/lib/camping-unabridged.rb index 636ad6f..c262757 100644 --- a/lib/camping-unabridged.rb +++ b/lib/camping-unabridged.rb @@ -269,9 +269,10 @@ module Camping # end # end # -def render(v, o={},b) +def render(v, *a,b) if t = lookup(v) -s = (t == true) ? mab{ send(v,b) } : t.render(self, o[:locals] || {},b) +o = a[0] || {} +s = (t == true) ? mab{ send(v, *a,b) } : t.render(self, o[:locals] || {},b) s = render(L, o.merge(L = false)) { s } if o[L] != false lookup(L) s else // Magnus Holm On Fri, Jul 9, 2010 at 19:12, David Suscodsu...@gmail.com wrote: I do have the latest reststop gem, but the problem occurs when I'm *not* using reststop. The regular camping render method does not check for the _, where as the reststop render does. Line 166 is reststop is working, but there's no equivalent logic (that I can see) in camping render. I've tried calling partials in haml like this without any luck: =render :_button R(SomeController) 'Some Controller' =render _button R(SomeController) 'Some Controller' Dave On Fri, Jul 9, 2010 at 12:09 PM, Philippe Monnetr...@monnet-usa.com wrote: For issue #1: I think I added the change on line 166( when committing my last changes for gem 0.5.3) to check for partials in the normal flow of restop_render. Could you verify you have the latest? For issue #2: what does your%=render ... % code looks like? Is only the name of the partial inside the quotes (e.g.%=render _mypartial 123 'arg2' % )? If so the Camping render should be only performing the lookup on the partial name (the v argument) and send the other arguments along. On 7/9/2010 9:14 AM, David Susco wrote: FYI, when not using reststop, calling render :_some_partial from a template will automatically wrap the partial in the layout. I think this is because the render method automatically wraps a view in the layout if the layout exists, rather than checking if the first character is an underscore and then wrapping the view in the layout if this is not the case (like the basic_render method from reststop). Another thing that is not possibly when using Tilt (whether using reststop or not) is calling a partial that takes arguments. For instance, I have a Markaby partial for a button: def _button href, text='Cancel' a.button text, :href=href end I can call that from other Markaby views with: _button R(SomeController), 'Some Controller' But I can't call render on that method because the camping lookup method will try to turn the entire render argument into a symbol. It's trying to lookup a method _button R(SomeController), 'Some Controller' rather than a method _button with the arguments R(SomeController), 'Some Controller'. Hopefully that was clear enough. Dave On Fri, Jul 9, 2010 at 9:10 AM, David Suscodsu...@gmail.com wrote: Arg, I new it would be something simple. Thanks. Dave On Thu, Jul 8, 2010 at 10:54 PM, Philippe Monnetr...@monnet-usa.com wrote: David, If you're using Tilt, to make partials work in ERB or HAML you would need to explicitly call render with the name of the partial. So for example, in ERB: %=render _mypartial % Philippe (@techarch) On 7/8/2010 2:19 PM, David Susco wrote: Thanks Philippe, it's working great. Has anyone gotten partials to work with Tilt? Dave On Wed, Jul 7, 2010 at 9:58 PM, Philippe Monnetr...@monnet-usa.com wrote: I fixed the issue in the basic_render method. At the time I worked on RESTstop I had done the minimum needed to make it work with the new version of Camping. And when Tilt support was added I did not fully retrofit the code to make it work with Tilt templates. Problem corrected! Thanks David for helping us make the implementation more robust. I have also published a new 0.5.3 version of the gem. Philippe (@techarch) On 7/6/2010 10:07 PM,
Re: using reststop with tilt
Thanks Magnus, those changes make sense to me. I can test them out no problem, just not until Monday. I'll send out another e-mail then. Thanks, Dave On Fri, Jul 9, 2010 at 5:30 PM, Philippe Monnet r...@monnet-usa.com wrote: Yes I think the first patch makes sense to filter out partials from the process of applying the layout. For the second patch now I get why Dave's parameters were not being used. So now your change would send *a . Cool. Dave do you want to try that out? And then Magnus can go ahead and apply it and maybe also to update the official gem. On 7/9/2010 2:20 PM, Magnus Holm wrote: Should we apply a patch like this? diff --git a/lib/camping-unabridged.rb b/lib/camping-unabridged.rb index 636ad6f..f3195b3 100644 --- a/lib/camping-unabridged.rb +++ b/lib/camping-unabridged.rb @@ -272,7 +272,7 @@ module Camping def render(v, o={}, b) if t = lookup(v) s = (t == true) ? mab{ send(v, b) } : t.render(self, o[:locals] || {}, b) -s = render(L, o.merge(L = false)) { s } if o[L] != false lookup(L) +s = render(L, o.merge(L = false)) { s } if v.to_s[0] != ?_ o[L] != false lookup(L) s else raise Can't find template #{v} Also, currently you can pass arguments to `render`. What about this? diff --git a/lib/camping-unabridged.rb b/lib/camping-unabridged.rb index 636ad6f..c262757 100644 --- a/lib/camping-unabridged.rb +++ b/lib/camping-unabridged.rb @@ -269,9 +269,10 @@ module Camping # end # end # -def render(v, o={}, b) +def render(v, *a, b) if t = lookup(v) -s = (t == true) ? mab{ send(v, b) } : t.render(self, o[:locals] || {}, b) +o = a[0] || {} +s = (t == true) ? mab{ send(v, *a, b) } : t.render(self, o[:locals] || {}, b) s = render(L, o.merge(L = false)) { s } if o[L] != false lookup(L) s else // Magnus Holm On Fri, Jul 9, 2010 at 19:12, David Susco dsu...@gmail.com wrote: I do have the latest reststop gem, but the problem occurs when I'm *not* using reststop. The regular camping render method does not check for the _, where as the reststop render does. Line 166 is reststop is working, but there's no equivalent logic (that I can see) in camping render. I've tried calling partials in haml like this without any luck: =render :_button R(SomeController) 'Some Controller' =render _button R(SomeController) 'Some Controller' Dave On Fri, Jul 9, 2010 at 12:09 PM, Philippe Monnet r...@monnet-usa.com wrote: For issue #1: I think I added the change on line 166( when committing my last changes for gem 0.5.3) to check for partials in the normal flow of restop_render. Could you verify you have the latest? For issue #2: what does your %=render ... % code looks like? Is only the name of the partial inside the quotes (e.g. %=render _mypartial 123 'arg2' % )? If so the Camping render should be only performing the lookup on the partial name (the v argument) and send the other arguments along. On 7/9/2010 9:14 AM, David Susco wrote: FYI, when not using reststop, calling render :_some_partial from a template will automatically wrap the partial in the layout. I think this is because the render method automatically wraps a view in the layout if the layout exists, rather than checking if the first character is an underscore and then wrapping the view in the layout if this is not the case (like the basic_render method from reststop). Another thing that is not possibly when using Tilt (whether using reststop or not) is calling a partial that takes arguments. For instance, I have a Markaby partial for a button: def _button href, text='Cancel' a.button text, :href=href end I can call that from other Markaby views with: _button R(SomeController), 'Some Controller' But I can't call render on that method because the camping lookup method will try to turn the entire render argument into a symbol. It's trying to lookup a method _button R(SomeController), 'Some Controller' rather than a method _button with the arguments R(SomeController), 'Some Controller'. Hopefully that was clear enough. Dave On Fri, Jul 9, 2010 at 9:10 AM, David Susco dsu...@gmail.com wrote: Arg, I new it would be something simple. Thanks. Dave On Thu, Jul 8, 2010 at 10:54 PM, Philippe Monnet r...@monnet-usa.com wrote: David, If you're using Tilt, to make partials work in ERB or HAML you would need to explicitly call render with the name of the partial. So for example, in ERB: %=render _mypartial % Philippe (@techarch) On 7/8/2010 2:19 PM, David Susco wrote: Thanks Philippe, it's working great. Has anyone gotten partials to work with Tilt? Dave On Wed, Jul 7, 2010 at 9:58 PM, Philippe Monnet r...@monnet-usa.com wrote: I fixed the issue in the basic_render method. At the time I worked on RESTstop I had done the minimum needed to make it work with the new
API documentation good enough?
As you might know, I'm not using Camping on a regular basis, so I'm just wondering if the API documentation (http://camping.rubyforge.org/api.html) is good enough? If not, is it something we can improve by simply updating camping-unbridged.rb? If not, do we rather want something like this? http://www.sinatrarb.com/intro.html // Magnus Holm ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Wiki vs homepage
Hey guys, Philippe had some interesting points about the website: 1. Keep the home page simple with all content fitting within 1280 x 1024 2. Use a catchy design (need some help here) 3. Accentuate that Camping is about Ruby (maybe also include the ruby logo somewhere) 4. Have a brief note about the connection to _why and a link to a page explaining the history of Camping with further links to _why's other sites 5. Encourage people to try it by capitalizing on some of Camping's strengths: - Fast to learn - requires only basic Ruby skills - Much simpler than Rails but more structure than Sinatra/Padrino - Lightning fast and memory efficient allowing fast and efficient sites - Can evolve from simple file to organized directory structure - Can layer in more features later using persistence and choice of view engines 6. How about using some kind of an animated (auto advancing) slideshow to highlight some of the benefits? See an example at: http://blog.monnet-usa.com/?p=276 7. How about a page on learning with a link to the book as well as a list of links for other tutorials or short explanations on key topics (e.g. how to do migrations, how to use include/extend, how to use different view engines, etc.)? 8. How about a page about plugins with some brief description of their intent? 9. I would love for us to include _why's cartoons in some of the sub pages ;-) Now, the more I look at this list (and my own thoughts about the new camping site) I realize that we're talking about two different things: * A site to attract new users * A site to inform regular users It looks like my attempt (http://whywentcamping.judofyr.net/) tries to target the latter, while Philippe targeted the former (http://rubycamping.monnet-usa.com/). Both sites serves a purpose and I believe both are equally important. -- Here's what I propose: We split the site into two parts. We turn what I've created into a wiki. Everyone are welcome to edit and add their own content. Then we take Philippe's ideas/design/site and turn it into ruby-camping.com or whywentcamping.com or whatnot. It probably doesn't need to be more than a single page. What'd ya think? // Magnus Holm ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: using reststop with tilt
Thanks Philippe, it's working great. Has anyone gotten partials to work with Tilt? Dave On Wed, Jul 7, 2010 at 9:58 PM, Philippe Monnet r...@monnet-usa.com wrote: I fixed the issue in the basic_render method. At the time I worked on RESTstop I had done the minimum needed to make it work with the new version of Camping. And when Tilt support was added I did not fully retrofit the code to make it work with Tilt templates. Problem corrected! Thanks David for helping us make the implementation more robust. I have also published a new 0.5.3 version of the gem. Philippe (@techarch) On 7/6/2010 10:07 PM, Philippe Monnet wrote: Hi David, I will look into this (probably this week-end though) - as I actually did not try Tilt at the same time as RESTstop. On 7/6/2010 7:45 AM, David Susco wrote: Still fooling around with this, no luck yet. Found some other things though. It seems I need to fully qualify controllers as arguments for URL and R methods when using Tilt (this is irrespective of whether I'm using reststop or not). Is there anything I can do to get around this? Also, is there anyway to call partials (markaby or other template files) from a template file? Dave On Wed, Jun 30, 2010 at 9:46 AM, David Susco dsu...@gmail.com wrote: I'm trying to use the new Tilt integration with reststop. All the aliases and whatnot under Implementing your own service (http://wiki.github.com/camping/reststop/) are there and :views has been set in the options hash. I tried creating sub-directories in the views directory (html, HTML) but I still couldn't get it to work. I can get my haml template to display if I get rid of the alias for reststop_render. All the other render calls to markaby still work when I do this too. However, I'm assuming I'm loosing the second argument for render in reststop when I do this. Am I missing some other setting/configuration option to get this to work with the alias for reststop_render? -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Wiki vs homepage
Yeah, I agree that it makes sense to have two sites, one to promote Camping and one to serve as the official reference. And a wiki would be very convenient for that. On 7/8/2010 1:55 PM, Magnus Holm wrote: Hey guys, Philippe had some interesting points about the website: 1. Keep the home page simple with all content fitting within 1280 x 1024 2. Use a catchy design (need some help here) 3. Accentuate that Camping is about Ruby (maybe also include the ruby logo somewhere) 4. Have a brief note about the connection to _why and a link to a page explaining the history of Camping with further links to _why's other sites 5. Encourage people to try it by capitalizing on some of Camping's strengths: - Fast to learn - requires only basic Ruby skills - Much simpler than Rails but more structure than Sinatra/Padrino - Lightning fast and memory efficient allowing fast and efficient sites - Can evolve from simple file to organized directory structure - Can layer in more features later using persistence and choice of view engines 6. How about using some kind of an animated (auto advancing) slideshow to highlight some of the benefits? See an example at: http://blog.monnet-usa.com/?p=276 7. How about a page on learning with a link to the book as well as a list of links for other tutorials or short explanations on key topics (e.g. how to do migrations, how to use include/extend, how to use different view engines, etc.)? 8. How about a page about plugins with some brief description of their intent? 9. I would love for us to include _why's cartoons in some of the sub pages ;-) Now, the more I look at this list (and my own thoughts about the new camping site) I realize that we're talking about two different things: * A site to attract new users * A site to inform regular users It looks like my attempt (http://whywentcamping.judofyr.net/) tries to target the latter, while Philippe targeted the former (http://rubycamping.monnet-usa.com/). Both sites serves a purpose and I believe both are equally important. -- Here's what I propose: We split the site into two parts. We turn what I've created into a wiki. Everyone are welcome to edit and add their own content. Then we take Philippe's ideas/design/site and turn it into ruby-camping.com or whywentcamping.com or whatnot. It probably doesn't need to be more than a single page. What'd ya think? // Magnus Holm ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: API documentation good enough?
I think the api doc is pretty decent (I have read it many times) and I like the fact that it is easy to keep up-to-date based on the camping-unabridged.rb file. Also the book is a nice way to get started with Camping. We could then add more books based on more advanced topics like for example: 1. Migrations (past the initial one) 2. Controller filtering 3. Creating Markaby helpers 4. Using Tilt 5. Returning static content 6. Embedding CSS at the end of the file 7. Use of module_eval, extend, include 8. Extending Camping 9. Plugins Philippe (@techarch) On 7/8/2010 1:59 PM, Magnus Holm wrote: As you might know, I'm not using Camping on a regular basis, so I'm just wondering if the API documentation (http://camping.rubyforge.org/api.html) is good enough? If not, is it something we can improve by simply updating camping-unbridged.rb? If not, do we rather want something like this? http://www.sinatrarb.com/intro.html // Magnus Holm ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: using reststop with tilt
I fixed the issue in the basic_render method. At the time I worked on RESTstop I had done the minimum needed to make it work with the new version of Camping. And when Tilt support was added I did not fully retrofit the code to make it work with Tilt templates. Problem corrected! Thanks David for helping us make the implementation more robust. I have also published a new 0.5.3 version of the gem. Philippe (@techarch) On 7/6/2010 10:07 PM, Philippe Monnet wrote: Hi David, I will look into this (probably this week-end though) - as I actually did not try Tilt at the same time as RESTstop. On 7/6/2010 7:45 AM, David Susco wrote: Still fooling around with this, no luck yet. Found some other things though. It seems I need to fully qualify controllers as arguments for URL and R methods when using Tilt (this is irrespective of whether I'm using reststop or not). Is there anything I can do to get around this? Also, is there anyway to call partials (markaby or other template files) from a template file? Dave On Wed, Jun 30, 2010 at 9:46 AM, David Suscodsu...@gmail.com wrote: I'm trying to use the new Tilt integration with reststop. All the aliases and whatnot under Implementing your own service (http://wiki.github.com/camping/reststop/) are there and :views has been set in the options hash. I tried creating sub-directories in the views directory (html, HTML) but I still couldn't get it to work. I can get my haml template to display if I get rid of the alias for reststop_render. All the other render calls to markaby still work when I do this too. However, I'm assuming I'm loosing the second argument for render in reststop when I do this. Am I missing some other setting/configuration option to get this to work with the alias for reststop_render? -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: using reststop with tilt
Still fooling around with this, no luck yet. Found some other things though. It seems I need to fully qualify controllers as arguments for URL and R methods when using Tilt (this is irrespective of whether I'm using reststop or not). Is there anything I can do to get around this? Also, is there anyway to call partials (markaby or other template files) from a template file? Dave On Wed, Jun 30, 2010 at 9:46 AM, David Susco dsu...@gmail.com wrote: I'm trying to use the new Tilt integration with reststop. All the aliases and whatnot under Implementing your own service (http://wiki.github.com/camping/reststop/) are there and :views has been set in the options hash. I tried creating sub-directories in the views directory (html, HTML) but I still couldn't get it to work. I can get my haml template to display if I get rid of the alias for reststop_render. All the other render calls to markaby still work when I do this too. However, I'm assuming I'm loosing the second argument for render in reststop when I do this. Am I missing some other setting/configuration option to get this to work with the alias for reststop_render? -- Dave -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: using reststop with tilt
Hi David, I will look into this (probably this week-end though) - as I actually did not try Tilt at the same time as RESTstop. On 7/6/2010 7:45 AM, David Susco wrote: Still fooling around with this, no luck yet. Found some other things though. It seems I need to fully qualify controllers as arguments for URL and R methods when using Tilt (this is irrespective of whether I'm using reststop or not). Is there anything I can do to get around this? Also, is there anyway to call partials (markaby or other template files) from a template file? Dave On Wed, Jun 30, 2010 at 9:46 AM, David Suscodsu...@gmail.com wrote: I'm trying to use the new Tilt integration with reststop. All the aliases and whatnot under Implementing your own service (http://wiki.github.com/camping/reststop/) are there and :views has been set in the options hash. I tried creating sub-directories in the views directory (html, HTML) but I still couldn't get it to work. I can get my haml template to display if I get rid of the alias for reststop_render. All the other render calls to markaby still work when I do this too. However, I'm assuming I'm loosing the second argument for render in reststop when I do this. Am I missing some other setting/configuration option to get this to work with the alias for reststop_render? -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Camping 2.1 and whywentcamping.com
Still busy, so just a brief comment... Philippe: I think this is a lot of fun - the slideshow is the kind of minimal introduction that really works. Better as inspiration than as a working website, so perhaps a combination of these graphics with the 'classic plain green' style at http://whywentcamping.judofyr.net would be a good way forward? We're such a diverse bunch I can't imagine a total consensus on the Camping site, but I think http://github.com/camping/ whywentcamping.com/ needs to be the starting-point - content is king at this stage, so Magnus' issue about the reference needs addressing: --- The reference is currently missing. I'm not quite sure how we would implement it. I guess we want: * To be able to view the whole reference in a single page * To be able to link to a specific section of the reference * To be able to comment on a specific section. View Issue: http://github.com/camping/whywentcamping.com/issues#issue/3 The reference show/hide JQuery fails on my latest Firefox, but this should be simple to fix. Dave Everitt Just for fun and to keep creative juives flowing I mocked up one idea of layout including a resizable look and a slideshow to showcase key points about Camping. That slideshow is using straight HTML and Javascript. See http://rubycamping.monnet-usa.com/ ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Camping 2.1 and whywentcamping.com
Just for fun and to keep creative juives flowing I mocked up one idea of layout including a resizable look and a slideshow to showcase key points about Camping. That slideshow is using straight HTML and Javascript. See http://rubycamping.monnet-usa.com/ On 6/30/2010 8:21 AM, Philippe Monnet wrote: Sorry I actually meant to say that all key content and navigation should be visible in the top 1084 pixels (and maybe less). It's not so much that we can make the page longer but you loose visitor's attention span (see http://browsersize.googlelabs.com/). On 6/30/2010 7:46 AM, Magnus Holm wrote: On Wed, Jun 30, 2010 at 14:57, Philippe Monnetr...@monnet-usa.com wrote: Thanks Magnus! I love the idea of working on the web site for 2.1. I am still not crazy about the web site name though - as it is not easy for people to remember if they don't know the connection with _why. I personally would have preferred rubycamping.com or something linking Camping to Ruby somehow. But if everyone prefers that name I am fine with that. Sure, I don't care what's the domain name will be. A couple ideas for the site: Keep the home page simple with all content fitting within 1280 x 1024 I don't necessarily agree with this: users are used to scroll on the internet (e.g.http://vowsjs.org/) Use a catchy design (need some help here) Of course! Unfortunately, I can't really help here either. Accentuate that Camping is about Ruby (maybe also include the ruby logo somewhere) Agree. Have a brief note about the connection to _why and a link to a page explaining the history of Camping with further links to _why's other sites Agree. I feel these kind of pages should end up at the wiki (but we might want to move away from GitHub's wiki). Encourage people to try it by capitalizing on some of Camping's strengths: Fast to learn - requires only basic Ruby skills Much simpler than Rails but more structure than Sinatra/Padrino Lightning fast and memory efficient allowing fast and efficient sites Can evolve from simple file to organized directory structure Can layer in more features later using persistence and choice of view engines Totally agree! How about using some kind of an animated (auto advancing) slideshow to highlight some of the benefits? See an example at: http://blog.monnet-usa.com/?p=276 Interesting. We'll have to check that out. How about a page on learning with a link to the book as well as a list of links for other tutorials or short explanations on key topics (e.g. how to do migrations, how to use include/extend, how to use different view engines, etc.)? This should hopefully be a part of the reference section How about a page about plugins with some brief description of their intent? Wiki material? I would love for us to include _why's cartoons in some of the sub pages ;-) Agree. Who would be interested in working together on the site? I'm always interested, but I'm that good at design… Could we do a couple graphic mockups of the main page? How should we exchange them? Via the mailing list? Not sure… I am ready and excited to help with that. I think it would be great to launch the site in time for _Why Day (Aug 19th)! Philippe Also, I think we should store a lot of information on a wiki; Camping is after all a pretty much public project. I still think we should have a separate website though (which should both work as a place where you can find Camping-related resources AND where we advertise to new people). ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Camping 2.1 and whywentcamping.com
2010/7/4 Philippe Monnet r...@monnet-usa.com: Just for fun and to keep creative juives flowing I mocked up one idea of layout including a resizable look and a slideshow to showcase key points about Camping. That slideshow is using straight HTML and Javascript. See http://rubycamping.monnet-usa.com/ Try it at 1024x768. Just sayin'. Also the slideshow is too fast, actually I don't think that making it an automated slideshow is a good idea; let the viewer decide when to see next slide. Except for that, I'd say it looks good (I'm just a regular Camping user, not dev or anything). -- Matma Rex ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Camping 2.1 and whywentcamping.com
On 30 Jun 2010, at 13:57, Philippe Monnet wrote: Who would be interested in working together on the site? [briefly] I would. Busy today, will process latest emails and respond later :-) A great new step for Camping all round, though! Dave E ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Camping 2.1 and whywentcamping.com
Hey campers! I think it's about time to release Camping 2.1, which features: * Support for other template engines (Haml, ERB, etc) out of the box * No longer depends on ActiveRecord (this was a bug) * Camping.options is now a Hash where you can put all sorts of configuration stuff * Camping::Server now uses Rack::Server (got rid of some code) * See all changes here: http://github.com/camping/camping/compare/2.0...master -- There's still one thing I want to improve before we release 2.1 though, and that is the website. Currently it only redirects to the RDoc, but I believe we can do better. Checkout this: http://whywentcamping.judofyr.net/ (also see the GitHub repo for some more information: http://github.com/camping/whywentcamping.com) Better? Worse? You tell me :-) Have a look at the issues I'm aware of (http://github.com/camping/whywentcamping.com/issues) and please add your own too. // Magnus Holm ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Access to github.com/camping
Hey, I've converted the camping account into an organization (see http://github.com/blog/674-introducing-organizations), which means that it's a lot easier to manage it. There's currently two teams at the moment: Owners: These have full admin access (can create repos etc.) - Magnus - Philippe Developers: These can push to all the repos at github.com/camping - Magnus - Philippe - busbey - Dave Everitt - zuk - zimbatm I'm *very* open to add more users to the developers team. Just say what you intend to do (on the mailing list), and I'll add you. If you have a Camping related project which you would like to host under github.com/camping, just ask on the mailing list and we'll create a repo for you. (This should be added to the wiki in the near future) // Magnus Holm ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Camping 2.1 and whywentcamping.com
kylekyle and I have planned to use http://thelittlewheels.com/ as a showcase for camping stuff. probably even more confusing to new people than whywentcamping On Wed, Jun 30, 2010 at 13:57, Philippe Monnet r...@monnet-usa.com wrote: Thanks Magnus! I love the idea of working on the web site for 2.1. I am still not crazy about the web site name though - as it is not easy for people to remember if they don't know the connection with _why. I personally would have preferred rubycamping.com or something linking Camping to Ruby somehow. But if everyone prefers that name I am fine with that. A couple ideas for the site: Keep the home page simple with all content fitting within 1280 x 1024 Use a catchy design (need some help here) Accentuate that Camping is about Ruby (maybe also include the ruby logo somewhere) Have a brief note about the connection to _why and a link to a page explaining the history of Camping with further links to _why's other sites Encourage people to try it by capitalizing on some of Camping's strengths: Fast to learn - requires only basic Ruby skills Much simpler than Rails but more structure than Sinatra/Padrino Lightning fast and memory efficient allowing fast and efficient sites Can evolve from simple file to organized directory structure Can layer in more features later using persistence and choice of view engines How about using some kind of an animated (auto advancing) slideshow to highlight some of the benefits? See an example at: http://blog.monnet-usa.com/?p=276 How about a page on learning with a link to the book as well as a list of links for other tutorials or short explanations on key topics (e.g. how to do migrations, how to use include/extend, how to use different view engines, etc.)? How about a page about plugins with some brief description of their intent? I would love for us to include _why's cartoons in some of the sub pages ;-) Who would be interested in working together on the site? Could we do a couple graphic mockups of the main page? How should we exchange them? Via the mailing list? I am ready and excited to help with that. I think it would be great to launch the site in time for _Why Day (Aug 19th)! Philippe On 6/30/2010 5:08 AM, Magnus Holm wrote: Hey campers! I think it's about time to release Camping 2.1, which features: * Support for other template engines (Haml, ERB, etc) out of the box * No longer depends on ActiveRecord (this was a bug) * Camping.options is now a Hash where you can put all sorts of configuration stuff * Camping::Server now uses Rack::Server (got rid of some code) * See all changes here: http://github.com/camping/camping/compare/2.0...master -- There's still one thing I want to improve before we release 2.1 though, and that is the website. Currently it only redirects to the RDoc, but I believe we can do better. Checkout this: http://whywentcamping.judofyr.net/ (also see the GitHub repo for some more information: http://github.com/camping/whywentcamping.com) Better? Worse? You tell me :-) Have a look at the issues I'm aware of (http://github.com/camping/whywentcamping.com/issues) and please add your own too. // Magnus Holm ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -- Sean ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Camping 2.1 and whywentcamping.com
Awesome domain name! And as long as you include the image, it probably makes sense for new people too. You know, the password to the camping github account was actually littlewheels :-) // Magnus Holm On Wed, Jun 30, 2010 at 15:03, Sean Busbey s...@manvsbeard.com wrote: kylekyle and I have planned to use http://thelittlewheels.com/ as a showcase for camping stuff. probably even more confusing to new people than whywentcamping On Wed, Jun 30, 2010 at 13:57, Philippe Monnet r...@monnet-usa.com wrote: Thanks Magnus! I love the idea of working on the web site for 2.1. I am still not crazy about the web site name though - as it is not easy for people to remember if they don't know the connection with _why. I personally would have preferred rubycamping.com or something linking Camping to Ruby somehow. But if everyone prefers that name I am fine with that. A couple ideas for the site: Keep the home page simple with all content fitting within 1280 x 1024 Use a catchy design (need some help here) Accentuate that Camping is about Ruby (maybe also include the ruby logo somewhere) Have a brief note about the connection to _why and a link to a page explaining the history of Camping with further links to _why's other sites Encourage people to try it by capitalizing on some of Camping's strengths: Fast to learn - requires only basic Ruby skills Much simpler than Rails but more structure than Sinatra/Padrino Lightning fast and memory efficient allowing fast and efficient sites Can evolve from simple file to organized directory structure Can layer in more features later using persistence and choice of view engines How about using some kind of an animated (auto advancing) slideshow to highlight some of the benefits? See an example at: http://blog.monnet-usa.com/?p=276 How about a page on learning with a link to the book as well as a list of links for other tutorials or short explanations on key topics (e.g. how to do migrations, how to use include/extend, how to use different view engines, etc.)? How about a page about plugins with some brief description of their intent? I would love for us to include _why's cartoons in some of the sub pages ;-) Who would be interested in working together on the site? Could we do a couple graphic mockups of the main page? How should we exchange them? Via the mailing list? I am ready and excited to help with that. I think it would be great to launch the site in time for _Why Day (Aug 19th)! Philippe On 6/30/2010 5:08 AM, Magnus Holm wrote: Hey campers! I think it's about time to release Camping 2.1, which features: * Support for other template engines (Haml, ERB, etc) out of the box * No longer depends on ActiveRecord (this was a bug) * Camping.options is now a Hash where you can put all sorts of configuration stuff * Camping::Server now uses Rack::Server (got rid of some code) * See all changes here: http://github.com/camping/camping/compare/2.0...master -- There's still one thing I want to improve before we release 2.1 though, and that is the website. Currently it only redirects to the RDoc, but I believe we can do better. Checkout this: http://whywentcamping.judofyr.net/ (also see the GitHub repo for some more information: http://github.com/camping/whywentcamping.com) Better? Worse? You tell me :-) Have a look at the issues I'm aware of (http://github.com/camping/whywentcamping.com/issues) and please add your own too. // Magnus Holm ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -- Sean ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
using reststop with tilt
I'm trying to use the new Tilt integration with reststop. All the aliases and whatnot under Implementing your own service (http://wiki.github.com/camping/reststop/) are there and :views has been set in the options hash. I tried creating sub-directories in the views directory (html, HTML) but I still couldn't get it to work. I can get my haml template to display if I get rid of the alias for reststop_render. All the other render calls to markaby still work when I do this too. However, I'm assuming I'm loosing the second argument for render in reststop when I do this. Am I missing some other setting/configuration option to get this to work with the alias for reststop_render? -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
versioning alternatives
Has anyone had any experience with vestal_versions, has_versioning, or another similar gem with camping? I'm currently fooling around with vestal_versions ( :P ) trying to figure out how to create the version table. Apparently this is handled via a script/db migration in Rails, and without something similar to the handy create_versioned_table call that's in acts_as_versioned. -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: versioning alternatives
This seems to be the migration that vestal_versions generates: http://github.com/laserlemon/vestal_versions/blob/master/generators/vestal_versions/templates/migration.rb. I assume you can just copy that into your app (just replace ActiveRecord::Migration with V 1.1). // Magnus Holm On Tue, Jun 29, 2010 at 17:56, David Susco dsu...@gmail.com wrote: Has anyone had any experience with vestal_versions, has_versioning, or another similar gem with camping? I'm currently fooling around with vestal_versions ( :P ) trying to figure out how to create the version table. Apparently this is handled via a script/db migration in Rails, and without something similar to the handy create_versioned_table call that's in acts_as_versioned. -- Dave ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Relations on Camping
you need to add `has_many :people` to your Group class On 2010-06-25 4:03 AM, Raimon Fernandez co...@montx.com wrote: Hi, it's me again ... :-) I have one table called people and another one called groups. Each person from people belongs to ONE group. module List::Models class Person Base belongs_to :group end class Group Base end end When I get all persons from people, I expect, like in RoR, the access to related records, like: module List::Views def people(xml) xml.posts do @posts.each do |person| xml.person do xml.id(person.id) xml.name(person.name) xml.surname_01(person.surname_01) xml.surname_02(person.surname_02) xml.has_come(person.has_come) xml.group(person.group.name) # Here I'm asking for related information about the group name end end end end end and I'm getting = NoMethodError at /people/list undefined method `name' for nil:NilClass also, I'm trying to test it on Console: MacBook-ProII-2:Test montx$ camping -C list.rb ** Starting console Person.find(1) NameError: uninitialized constant Person from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:443:in `load_missing_constant' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in `const_missing' from (irb):1 but it seems that the model hasn't been loaded ... thanks again for your help, regards, r. ps. yes, I have in the db the relation between two tables: list_group_id in the list_people table. ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Relations on Camping
yes, you're right !! I've been caight by the pre-pend table name in the field name ... :-) thanks, r. On 25jun, 2010, at 13:33 , Philippe Monnet wrote: Raimon, I suspect that your relationship column (foreign key) should actually be called group_id not list_group_id like in: def self.up create_table :list_groups, :force = true do |t| t.string :name end create_table :list_people, :force = true do |t| t.integer :group_id, :null = false t.string :username end Philippe On 6/25/2010 2:39 AM, Raimon Fernandez wrote: Hi, it's me again ... :-) I have one table called people and another one called groups. Each person from people belongs to ONE group. module List::Models class Person Base belongs_to :group end class Group Base end end When I get all persons from people, I expect, like in RoR, the access to related records, like: module List::Views def people(xml) xml.posts do @posts.each do |person| xml.person do xml.id(person.id) xml.name(person.name) xml.surname_01(person.surname_01) xml.surname_02(person.surname_02) xml.has_come(person.has_come) xml.group(person.group.name) # Here I'm asking for related information about the group name end end end end end and I'm getting = NoMethodError at /people/list undefined method `name' for nil:NilClass also, I'm trying to test it on Console: MacBook-ProII-2:Test montx$ camping -C list.rb ** Starting console Person.find(1) NameError: uninitialized constant Person from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:443:in `load_missing_constant' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in `const_missing' from (irb):1 but it seems that the model hasn't been loaded ... thanks again for your help, regards, r. ps. yes, I have in the db the relation between two tables: list_group_id in the list_people table. ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Updated version of RESTstop and RESTr plus bonus blog post
Added to the Github Camping wiki (with your growing number of links...) - guides these are really useful! - Dave Everitt I also ended up writing a blog post on how to implement REST services with RESTstop. See http://bit.ly/tareststop ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Updated version of RESTstop and RESTr plus bonus blog post
P.S. really nice write up. I think you know more about Reststop now than I do :) On Wed, Jun 23, 2010 at 9:27 AM, Matt Zukowski m...@roughest.net wrote: Awesome! Nice to see restr getting used. I always thought it was a better solution than rest-client, but I guess I'm biased :) On Wed, Jun 23, 2010 at 9:11 AM, Philippe Monnet r...@monnet-usa.comwrote: After last week's thread with Raimon, I made a couple changes to RESTstop and RESTr (added JSON support). Both GitHub and RubyGems are up-to-date now. I also ended up writing a blog post on how to implement REST services with RESTstop. See http://bit.ly/tareststop - Philippe (@techarch) ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Speed issue
Hi Magnus, On 21jun, 2010, at 21:40 , Magnus Holm wrote: Yep, The reloader (located in camping/reloader.rb) watches a file and then reloads the server whenever the file changes. It's what makes it possible to just run `camping app.rb` and always have the latest version served. if I start with camping list.rb and enter this url http://127.0.0.1:3301/people/list and I hit the reload continuosly, you will see how if 'freezes' ... if I start with camping -s thin list.rb and enter this url http://127.0.0.1:3301/people/list and I hit the reload continuosly, it's always fast and responsive I can't reproduce it at my machine at the moment :( Could you send me an example app which has the speed issues on your machine? Where I can send a .db also ? I can put the code in the pastie but the database ? It has some rows that I fetch ... thanks, regards, r. // Magnus Holm On Mon, Jun 21, 2010 at 16:10, Raimon Fernandez co...@montx.com wrote: On 21jun, 2010, at 13:49 , Magnus Holm wrote: Okay, I was just wondering since if you run the app with the thin command, you won't get the reloader. So apparently the issue exists only with the reloader+Mongrel... What's the reloader ? When I make some changes in the app.rb file ? thanks, regards. r. On Monday, June 21, 2010, Raimon Fernandez co...@montx.com wrote: On 21jun, 2010, at 12:56 , Magnus Holm wrote: What if you run Thin with `camping -s thin app.rb`? Do you have the speed issue then? No, with Thin I don't have the speed issue ... thanks, r. Thanks, Magnus On Monday, June 21, 2010, Raimon Fernandez co...@montx.com wrote: On 20jun, 2010, at 23:38 , Raimon Fernandez wrote: On 18jun, 2010, at 15:34 , Magnus Holm wrote: Oh, and I also have the speed issue! That's definitely a bug. I'll have a look at it later... I'm making some progress with Camping and well, it's impressive, really :-) Wich version can I use that has not the bug for speed issue ? I would like to do some demo and I prefer to avoid this bug ... :-) Just observed that when I run camping with Thin I'm not getting the speed issue, only with Mongrel ... thanks, r. ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -- // Magnus Holm ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -- // Magnus Holm ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Speed issue
On 20jun, 2010, at 23:38 , Raimon Fernandez wrote: On 18jun, 2010, at 15:34 , Magnus Holm wrote: Oh, and I also have the speed issue! That's definitely a bug. I'll have a look at it later... I'm making some progress with Camping and well, it's impressive, really :-) Wich version can I use that has not the bug for speed issue ? I would like to do some demo and I prefer to avoid this bug ... :-) Just observed that when I run camping with Thin I'm not getting the speed issue, only with Mongrel ... thanks, r. ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Speed issue
Okay, I was just wondering since if you run the app with the thin command, you won't get the reloader. So apparently the issue exists only with the reloader+Mongrel... On Monday, June 21, 2010, Raimon Fernandez co...@montx.com wrote: On 21jun, 2010, at 12:56 , Magnus Holm wrote: What if you run Thin with `camping -s thin app.rb`? Do you have the speed issue then? No, with Thin I don't have the speed issue ... thanks, r. Thanks, Magnus On Monday, June 21, 2010, Raimon Fernandez co...@montx.com wrote: On 20jun, 2010, at 23:38 , Raimon Fernandez wrote: On 18jun, 2010, at 15:34 , Magnus Holm wrote: Oh, and I also have the speed issue! That's definitely a bug. I'll have a look at it later... I'm making some progress with Camping and well, it's impressive, really :-) Wich version can I use that has not the bug for speed issue ? I would like to do some demo and I prefer to avoid this bug ... :-) Just observed that when I run camping with Thin I'm not getting the speed issue, only with Mongrel ... thanks, r. ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -- // Magnus Holm ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -- // Magnus Holm ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: Speed issue
On 18jun, 2010, at 15:34 , Magnus Holm wrote: Oh, and I also have the speed issue! That's definitely a bug. I'll have a look at it later... I'm making some progress with Camping and well, it's impressive, really :-) Wich version can I use that has not the bug for speed issue ? I would like to do some demo and I prefer to avoid this bug ... :-) thanks! regards, r. ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: First time on Camping
Hi all, On 18jun, 2010, at 17:51 , Magnus Holm wrote: This shouldn't be a problem, because that's the way to add non-ASCII characters to XML documents. A proper XML parser should handle it... But in this case, it's an ASCII á, well, the extended ASCII, and all .xml files that I've created never added this encoded, always the char itself, like à á ç ñ I'm using the TBMXML parser http://www.tbxml.co.uk/TBXML/TBXML_Free.html And because the xml file has the encoding=UTF-8 I suppose that those chars can be added as they are without encoding. And also I'm using other C libraries in other projects that they do not escape those chars ... Thanks! regards, r. // Magnus Holm (from my phone) On Friday, June 18, 2010, Raimon Fernandez co...@montx.com wrote: Hi again, I know this is more related to builder than to camping, but not sure where to ask for it ... :-) My app receives .xml file from some different sources, and all of them, except the camping one, are formatted like this: ?xml version=1.0 encoding=UTF-8? person nameJim Fernández/name phone555-1234/phone /person but camping is formatting like this: ?xml version=1.0 encoding=UTF-8? person nameJim Fern#225;ndez/name phone555-1234/phone /person The main difference is the encoding for some chars: á = #225; I can't find in builder how to write values without escaping them ... thanks, r. On 17jun, 2010, at 21:04 , Magnus Holm wrote: And if you want this XML: ?xml version=1.0 encoding=UTF-8? posts post titleHiya/title contentHey/content /post /posts You have this view: module App::Views def posts(xml) xml.posts do @posts.each do |post| xml.post do xml.title(post.title) xml.content(post.content) end end end end end ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -- // Magnus Holm ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: First time on Camping
I think the problem is that Builder don't know that you're using UTF-8, so it's just doing the safest thing and just escapes everything. But this shouldn't really be a problem, since the parser should handle it and treat every #225; as á. // Magnus Holm On Sat, Jun 19, 2010 at 15:53, Raimon Fernandez co...@montx.com wrote: Hi all, On 18jun, 2010, at 17:51 , Magnus Holm wrote: This shouldn't be a problem, because that's the way to add non-ASCII characters to XML documents. A proper XML parser should handle it... But in this case, it's an ASCII á, well, the extended ASCII, and all .xml files that I've created never added this encoded, always the char itself, like à á ç ñ I'm using the TBMXML parser http://www.tbxml.co.uk/TBXML/TBXML_Free.html And because the xml file has the encoding=UTF-8 I suppose that those chars can be added as they are without encoding. And also I'm using other C libraries in other projects that they do not escape those chars ... Thanks! regards, r. // Magnus Holm (from my phone) On Friday, June 18, 2010, Raimon Fernandez co...@montx.com wrote: Hi again, I know this is more related to builder than to camping, but not sure where to ask for it ... :-) My app receives .xml file from some different sources, and all of them, except the camping one, are formatted like this: ?xml version=1.0 encoding=UTF-8? person nameJim Fernández/name phone555-1234/phone /person but camping is formatting like this: ?xml version=1.0 encoding=UTF-8? person nameJim Fern#225;ndez/name phone555-1234/phone /person The main difference is the encoding for some chars: á = #225; I can't find in builder how to write values without escaping them ... thanks, r. On 17jun, 2010, at 21:04 , Magnus Holm wrote: And if you want this XML: ?xml version=1.0 encoding=UTF-8? posts post titleHiya/title contentHey/content /post /posts You have this view: module App::Views def posts(xml) xml.posts do �...@posts.each do |post| xml.post do xml.title(post.title) xml.content(post.content) end end end end end ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list -- // Magnus Holm ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: First time on Camping
Hi Magnus, On 17jun, 2010, at 21:04 , Magnus Holm wrote: Hey Raimon, I see that you've been experimenting with Camping and Reststop lately, and just thought I should chime in a bit. You definitely don't *need* Reststop in order to achieve what you want, so it might be a good idea to just leave Reststop until it gets a little more robust. Let's see how we can tackle your problem with Camping only: Thanks for your code. It's true that if I can do what I want with fewer tools/gems, it's a better starter, and once I'm confident I can go further. That's (hopefully) the simplest way to generate XML with Camping. yes! You still need to create a model to store/retrieve the data. Before we can help you here, we need to know a few things: Is it going to fetch data from a specific place, or should it create its own database (from scratch)? Any specific database you want to use? Not sure yet, but maybe Sqlite or PostgreSQL. Normally I use PostgreSQL for all of my RoR projects, but in this case Sqlite would be simpler. The initial data will come from some xml files but I can update the database from another file with Ruby code. In some examples of Camping they just created the database but I couldn't find where they are storing it ... So, the best option is to provide to Camping an existing SQLite database. Here's a Pastie with all the code: http://pastie.org/1008983 (Should work on any version of Camping). thanks, it works and it's very simple :-) Now I'm playing with your code and examples, thanks again! regards, raimon ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: First time on Camping
Rubygems.org was playing up recently (gems.rubyforge.org forwards to it - see previous posts), and this looks like the same issue... Dave E. Something's not right with your rubygems install maybe try `gem update --system` first? ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: First time on Camping
On 17jun, 2010, at 21:04 , Magnus Holm wrote: That's (hopefully) the simplest way to generate XML with Camping. You still need to create a model to store/retrieve the data. Before we can help you here, we need to know a few things: Is it going to fetch data from a specific place, or should it create its own database (from scratch)? Any specific database you want to use? Here's a Pastie with all the code: http://pastie.org/1008983 (Should work on any version of Camping). I'm trying to adapt your pastie to use a sqlite databse, but I'm having some errors that I can't see ... Here's a Pastie with all code: http://pastie.org/1009797 I'm just trying to create with code a simple table called Persons with some fields but ... :-) Also, I can't find where is creating the database ... thanks, regards, r. ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: First time on Camping
Yeah, people always get a little confused because you don't need to define your database when you're using bin/camping (it has a default SQLite database at ~/.camping.db). I also see that there's some old, database code here; we definitely need to update our documentation (yes, I'm working on it!) First of all, the table name should be list_people (since people is the plural to person and the table names are always in lowercase), but you should rather do `create_table Person.table_name` and `drop_table Person.table_name` because then you don't need to think about it at all :-) Secondly, you only need this in order to create the database: def List.create List::Models.create_schema end Then it will use a SQLite database at ~/.camping.db (as long as you start it with `camping list.rb`). This is perfect for just testing things out (you can also run `camping -C list.rb` to get an IRB console). Please note that if you only run `camping list.rb`, you'll have to load the page in the browser before the migrations run. If you want to use a specific database, you can add this: def List.create List::Models::Base.establish_connection( :adapter = postgresql, :username = root, :password = toor, :database = list ) List::Models.create_schema end Or you might want to add the information in a database.yml file: --- adapter: postgresql username: root password: toor database: list And then rather do: require 'yaml' def List.create List::Models::Base.establish_connection(YAML.load(File.read(database.yml))) List::Models.create_schema end Please note that if you connect to a database which already has the tables, DON'T run `List::Models.create_schema` as this will probably delete the whole database. General rule: you only need migrations to setup the database. -- And thirdly: Yes, we are aware of that the migration support isn't very nice. In the future we hope to have something like: module List::Models class Person t.string :name end end def List.create List::Models.setup! end Until then, you'll have to stick with the current solution :-) // Magnus Holm On Fri, Jun 18, 2010 at 11:09, Raimon Fernandez co...@montx.com wrote: On 17jun, 2010, at 21:04 , Magnus Holm wrote: That's (hopefully) the simplest way to generate XML with Camping. You still need to create a model to store/retrieve the data. Before we can help you here, we need to know a few things: Is it going to fetch data from a specific place, or should it create its own database (from scratch)? Any specific database you want to use? Here's a Pastie with all the code: http://pastie.org/1008983 (Should work on any version of Camping). I'm trying to adapt your pastie to use a sqlite databse, but I'm having some errors that I can't see ... Here's a Pastie with all code: http://pastie.org/1009797 I'm just trying to create with code a simple table called Persons with some fields but ... :-) Also, I can't find where is creating the database ... thanks, regards, r. ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: First time on Camping
buf, now I'm lost ... :-)) no, really, thanks for that info, now I have working as I want ... :-) I've tested and created a new databse, and is working also. I've created a new sqlite3 from terminal and filled-up with some data and now I can use this databse from Camping, cool! And, caping is serving the data with .xml format and I can get it from my devices, cool! I'm going to play more with thise, sure I'll come back with more questions ... :-) ah, I always use Thin with Nginx for my RoR instead of Mongrel, I suppose there would be no problem with camping ? and speed: normally it's all very fast, but sometimes, it takes a little bit (3 or more seconds) to respond camping, and I'm not doing nothing serious at all, just the example from pastie. is because I'm using the development mode instead of production, like in RoR ? thanks again ! regards, r. On 18jun, 2010, at 12:33 , Magnus Holm wrote: Yeah, people always get a little confused because you don't need to define your database when you're using bin/camping (it has a default SQLite database at ~/.camping.db). I also see that there's some old, database code here; we definitely need to update our documentation (yes, I'm working on it!) First of all, the table name should be list_people (since people is the plural to person and the table names are always in lowercase), but you should rather do `create_table Person.table_name` and `drop_table Person.table_name` because then you don't need to think about it at all :-) Secondly, you only need this in order to create the database: def List.create List::Models.create_schema end Then it will use a SQLite database at ~/.camping.db (as long as you start it with `camping list.rb`). This is perfect for just testing things out (you can also run `camping -C list.rb` to get an IRB console). Please note that if you only run `camping list.rb`, you'll have to load the page in the browser before the migrations run. If you want to use a specific database, you can add this: def List.create List::Models::Base.establish_connection( :adapter = postgresql, :username = root, :password = toor, :database = list ) List::Models.create_schema end Or you might want to add the information in a database.yml file: --- adapter: postgresql username: root password: toor database: list And then rather do: require 'yaml' def List.create List::Models::Base.establish_connection(YAML.load(File.read(database.yml))) List::Models.create_schema end Please note that if you connect to a database which already has the tables, DON'T run `List::Models.create_schema` as this will probably delete the whole database. General rule: you only need migrations to setup the database. -- And thirdly: Yes, we are aware of that the migration support isn't very nice. In the future we hope to have something like: module List::Models class Person t.string :name end end def List.create List::Models.setup! end Until then, you'll have to stick with the current solution :-) // Magnus Holm On Fri, Jun 18, 2010 at 11:09, Raimon Fernandez co...@montx.com wrote: On 17jun, 2010, at 21:04 , Magnus Holm wrote: That's (hopefully) the simplest way to generate XML with Camping. You still need to create a model to store/retrieve the data. Before we can help you here, we need to know a few things: Is it going to fetch data from a specific place, or should it create its own database (from scratch)? Any specific database you want to use? Here's a Pastie with all the code: http://pastie.org/1008983 (Should work on any version of Camping). I'm trying to adapt your pastie to use a sqlite databse, but I'm having some errors that I can't see ... Here's a Pastie with all code: http://pastie.org/1009797 I'm just trying to create with code a simple table called Persons with some fields but ... :-) Also, I can't find where is creating the database ... thanks, regards, r. ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list
Re: First time on Camping
Raimon a few things you probably already know but... just in case! 1. because of the preceding '.' in '.camping.db' you'll need to use ls - al to see the file listed (in the ~ home dir) in your file system. 2. In Magnus' example settings (database = list) you can also add a path to your database as well as its name (unless something's changed since I last did it!) e.g.: database = ./data/mydata.db 3. The Firefox SQLite Manager is handy for errr.. managing your SQLite database: https://addons.mozilla.org/en-US/firefox/addon/5817/ Note: with SQLite you cannot change column names once they're in the database (unless anyone knows better?). Dave E. Yeah, people always get a little confused because you don't need to define your database when you're using bin/camping (it has a default SQLite database at ~/.camping.db). ___ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list