Camping 1.4 Released
Posted by Daniel Butler Fri, 14 Apr 2006 15:28:00 GMT
Camping is a micro—nay! nano— development framework for web-connected applications, like blogs, to do lists, or other teeny utilities. Version 1.4 is out, and why the lucky stiff nourishes our collective intellect with this:

So enigmatic, yet so beautiful. We’ve come a long way from CGI.
require 'camping'
Camping.goes :Blog
module Blog::Models
class Post < Base; belongs_to :user; end
class Comment < Base; belongs_to :user; end
class User < Base; end
end
module Blog::Controllers
class Index < R '/'
def get
@posts = Post.find :all
render :index
end
end
end
module Blog::Views
def layout
html do
body do
self << yield
end
end
end
def index
for post in @posts
h1 post.title
end
end
end
if __FILE__ == $0
Blog::Models::Base.establish_connection :adapter => 'sqlite3',
:database => 'blog3.db'
Blog::Models::Base.logger = Logger.new('camping.log')
puts Blog.run
end
