23.Jul.2007
Ruby on Rails is a great framework for the development of web applications. But there are some projects where you just don’t need all it’s power and features. However, you probably don’t like to through way some aspects. Fortunately, there’s an alternative.
Camping was developed by _why and it’s a microframework, in this case literally, since the code is meant not to overpass 4KB. It also uses Rails’ ActiveRecord, markaby and metaid. Its meant for small and simple projects, where you still don’t want to loose the MVC structure. To show you for what this framework is meant, where’s a short log from the #camping IRC channel:
20:11 <goalie> can camping do e-commerce?
20:11 <_why> no, use rails
20:11 <RangerCliff> heh wtf?
20:13 <goalie> it’s just a small store, we only have two products
20:13 <goalie> root beer lip balm and cream soda lip balm
20:13 _why contemplates
20:14 <goalie> mail-order only
20:14 <_why> now you’re talking!!
You are advised to keep you application code in just one file, although you can also use a simple directory structure and separate files for models, controllers and views. Now I’ll show some basic examples.
module Blog::Modelsclass Post < Base; belongs_to :user; endclass Comment < Base; belongs_to :user; endclass User < Base; endendhtml dobody doh1 'Hello World'endendclass Posts < R '/posts/(\d+)'And you can still require any helper from Rails, for example, and include it on your application module.
To learn more about Camping, check out _why’s blog, the documentation or this short introduction. The author goes by the nickname of _why (could find it’s real name anywhere)and it’s one of the most popular and respected ruby hackers. He also created Hackety Hack to enable easy web developing to amateurs and hobbyists, wrote a very peculiar book (although it’s still not finished) teaching Ruby – Why’s (Poignant) Guide To Ruby – and developed or helped developing a large number of ruby libraries and plugins.
I’ve played a bit with the framework and immediately got drown to it’s beauty (biased analysis). But, although it worked fined on the my computer. I could get it running on my Dreamhost account. The instructions demand that you add some code to the Apache scripts, which I don’t have access on a shared hosting account. I’ve tried following some fcgi scripts I found on my searches and I’ve already asked for help on the Camping mailing list to sort out the errors that occurred. As soon as I’ll get something up and running, I probably show it over here and maybe paste some beautiful code.
If you enjoyed this post, consider subscribing to my RSS Feed
3 Comments
Leave a Comment
Follow this post comments with this RSS feed.Latest Comments
"Parece fixe :) Bjs*"
mia / 21.Mar.2008 at 07:46pm
"You just have to login on TwitterN..."
sérgio santos / 31.Jan.2008 at 06:43pm
"Could byou please provide with inf..."
akouskouris / 31.Jan.2008 at 12:10pm
"Please give me exact the steps usi..."
andrew / 31.Jan.2008 at 10:02am
"Boa ideia. Parece porreiro"
nuno / 27.Jan.2008 at 01:55am
Projects
About
books
bookmarks
music 
twitter 
photos
Recent links
Tags
about me ajax architecture books browser business coding communities del.icio.us design development document economy environment event games graphics gtd gui industry information innovation linux lms magazines marketing markup media microformats mobile moo movies music open source os photos processing programming project rails robot ruby search semantics social software stream19 take off tips tools twitter twitternotes university video web apps webservices wifi xml
back to top
Sérgio Santos | Creative Commons | micro theme by seaofclouds, and powered with Mephisto