Snippets #73

My design skills suck. Maybe something to try and improve on for this year.

Snippets #72

Finally got an issue with my integration tests sorted!

  • Sinatra Pages - An extension for Sinatra that automatically renders pages in your views folder. Very handy for static pages!
  • Bloodhound - A new gem from Nicolás Sanguinetti to convert key value strings to proper hashes.
  • Scrooge - Another new one from Nicolás Sanguinetti. Easy persistence of monetary values in your database without the pain of floating point math.

Filed Under // Gems Sinatra Snippets

Snippets #68

Why is it always so hard to get back into a routine after a holiday?
  1. I Did It My Way - A project to create a Sinatra project every 2 months using a cookbook recipe guide. Looking forward to this!
  2. Learning The Craft - An oldie, but I hadn't read it before. Great advice for those starting out or stuck in a rut (like me!).

Filed Under // Sinatra Snippets

Snippets #57

Finally got back to do doing some Rails coding last night! Hoping to catch up on some Rails goodies over the next few weeks and post my findings here.
  1. Nestor: A Butler for your tests - A new continuous testing server for Rails.
  2. Metaprogramming in Ruby: It's all about self - A great breakdown of metaprogramming in Ruby. It's this side of Ruby that has always puzzled me.
  3. Sinatra from Rails - A Rails plugin that will convert your application to a Sinatra application. Handy if you have created a small Rails application that has only one or two resources, and would be more suited to Sinatra.

Filed Under // Sinatra Snippets Testing

Snippets #49

  1. Sinatra at Boston.rb (part 3) - The third part of the series has been posted on the Thoughtbot blog.
  2. Radiant 0.9.0 RC1 - The popular Rails CMS is now available as a release candidate for the upcoming 0.9 release.

Filed Under // CMS Conferences Sinatra Snippets

Snippets #43

  1. Using Sinatra to Provide a Web Interface for a Gem - Over at About.com, there's a nice tutorial on creating a whois and network tracer using Sinatra.
  2. Simplifying your Ruby on Rails code: Presenter pattern, cells plugin - This is a good example of taking a complex section of your Rails application and refactoring it down to something simpler.

Filed Under // Rails Sinatra Snippets

Snippets #42

  1. rewteet - This is a Sinatra application template that allows you to build a key-based aggregator application for Twitter. If your also curious about how some Sinatra applications are set up with regards to things like testing, then this is a great application to delve into.
  2. dotiw - A plugin for Rails that provides more accurate distance of time in words.
  3. Planting the seeds - Robby Russell has a great article covering the new seed data feature in Rails.

Filed Under // Plugins Rails Sinatra Snippets

Snippets #39

  1. Ruby Version Manager: Easily Multiple Ruby Versions At Once - An amazing and simple way of switching between different version of Ruby.
  2. Using Searchlogic to combine named scopes with 'OR' - Searchlogic gets a new feature to combine named scopes.
  3. Shotgun - Automatically reloads your Rack or Sinatra application on each request. I tried this out last night while working on a Sinatra application and it worked a treat.

Filed Under // Rack Sinatra Snippets

Twitter Dash: My First Sinatra Project

It finally happened. My first Sinatra app is up on Github.

Twitter Dash is a dashboard of your Twitter activity over the last 30 days. Originally I wanted to work with Sinatra on something but I also wanted to look at building something with the Twitter API and the Google Charts API. Mashing these together I came up with the idea of a simple dashboard for my Twitter activities.

Twitter Dash tracks activities like the number tweets with links and hashtags in them as well as the number of tweets, friends and followers you have over the last 30 days.

It was definitely a learning experience, and I noticed a few things that I would need to change when I work on future Sinatra projects:
  • Testing - I didn't write a single test for this and maybe I should have, but this was just about hacking on an application to understand the basics of Sinatra. However, now that Twitter Dash is at a stage where it does what I want it too, I'm going to focus my next Sinatra project on learning how to test internally using Test/Unit to begin with and then move onto something like RSpec or Cucumber.
  • Version Control - I left my commits for too long in between updates. This is something that will come with using bdd/tdd in my next project. Once you get a feature working, you can check it in with a nice commit message and then start on the next one.
For the moment Twitter Dash is going to be an ongoing project that I can use to try out different features from Sinatra as well as having something functional to work with.

Filed Under // Sinatra

Snippets #37

  1. Multiple Sinatra .90 applications in one process - This is an interesting idea. Definitely going to follow this one through with a project of my own.
  2. Installing RMagick on Mac OS X - I've always stayed away from RMagick in the past, but these steps have got me interested in trying out RMagick.

Filed Under // Sinatra Snippets