Rootin Tootin 0.3.0 Release

I just released Rootin Tootin 0.3.0. In case you don’t know what it is: Rootin Tootin is a fast RESTful web server and framework written in D. It is designed to scale well by default, while still providing a developer experience similar to Ruby on Rails.

I don’t want to transpose the changelog here. You can view that at your leisure. Instead here are my highlights. Firstly, you can now use the link_to function in views to generate links. It will automatically add the .html to the end if needed. Secondly, and most awesomely: it now works properly with REST and Active Resource. You can even use the rails active resource, and python active resource to talk to it:

Lets start by creatnig a simple web app to talk too:

rootintootin name:users port:3000 db_user:root db_password:letmein
cd journal
./gen recreate database
./gen create noun singular:user plural:users
./gen create scaffold note name:string email:string
./gen migrate
./run

Now lets try talking to it, with the rails active resource:

#!/usr/bin/env ruby
 
require 'rubygems'
require 'active_resource'
 
class User < ActiveResource::Base
	self.site = "http://localhost:3000"
end
 
# create
user = User.new
user.name = "mr possum"
user.email = "possum@gmail.com"
user.save
 
# update
User.find(:all).each do |user|
	user.name = "awesome possum"
	user.save
end
 
# delete
user = User.find(:first)
user.destroy
 
# read
User.find(:all).each do |user|
	puts "name #{user.name} email #{user.email}"
end

If you are feeling more dangerous, you can try the python active resource version:

#!/usr/bin/env python
 
from pyactiveresource.activeresource import ActiveResource
 
class User(ActiveResource):
	_site = "http://localhost:3000"
 
# create
user = User()
user.name = "mr possum"
user.email = "possum@gmail.com"
user.save()
 
# update
for user in User.find():
	user.name = "awesome possum"
	user.save
 
# delete
user = User.find_first()
user.destroy()
 
# read
for user in User.find():
	print "name {0} email {1}".format(user.name, user.email)

So neat. This is just a small sample of what you can do. But there are still many essential features that need to be added. Not to mention html 5 goodness, like websocks and access control.

I’ll try and add a video walk-through of a basic app later. Bye Bye for now.

0 comments ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment