Hello, Sinatra

Hello, Sinatra

My post earlier was about porting my blog to Adva CMS. It has a lot of really nice features that I don’t need. I actually don’t need translation feature for my blog. I don’t even need Wordpress. And not even Rails for my purpose. I am venturing into Ruby development, not Rails development. After some digging on Github, I came across “Scanty,” a very simple blog application that’s nearly nothing. It’s up to the developer to extend, hack and modify everything as needed. It was built on Sinatra Framework, yet a another framework for building Ruby apps. Sinatra does not have too many built-in helpers that come with Rails but it does have everything you need to build a web application. The RSpec framework (for Behaviour-driven development) for instance can still be used with Sinatra. RSpec is framework-agnostic and there are several ruby gems out there that are not Rails-centric.

Losing the bloat

Taking out what I don’t need, my blog seems to make me happier now. It only has two database tables as compared to my previous Drupal blog which had 86 tables and was way slower than this blog that uses Sinatra. I am a minimalist and my philosophy is “simplify and live a life of abundance” which is actually a Bo Sanchez book. Happy to stay with a Sinatra site, extend features and improve on interface later. Discard what you don’t need. You won’t have them when you’re six feet under anyway.

Barely started writing anything in Sinatra but I think I will use this for an interesting project. Would probably use Sinatra or Rails 3 more often than any other framework in the future. Rails 3 philosophy is same as Merb and Sinatra philosohpy. It’s “have it your way” and “framework agnosticism.” You’ll read more about the philosophies behind the framework in progress on other blogs.

Losing the tattoo

So this will make me less confined to Rails, ActiveRecord and the usual stuff that I use because of their popularity and community support. It feels more like taking a walk after long hours of just sitting around actually. While treading the road to “Programming Nirvana”, I saw that a guy was happy with a “Sequel” shirt on him and there was a falling sign saying “All roads to lead to Rails.” I know I’ve got to watch out for those kind of things which could harm me along the way. I came across a web development company that only did “one thing” and only focused on one language (and zero frameworks) primarily. It’s a proprietary language (something like HotFission) which seemed to be the antithesis of Ruby. If a start-up founder/CTO only knew one language and had no experience with other languages or frameworks, it can be dangerous for the company if he chooses to use that solely or exclusively like a brand tattooed in his forehead.

Gaining energy Installing Sinatra

sudo gem install sinatra

On **frank.rb((:

require 'rubygems'
require 'sinatra'
get '/frank' do
  "... there are no words left to speak. You're just so good to be true... 
   Can't take my eyes off of you... "
end

To set the stage…

ruby frank.rb