Nearby In Open Source

Mike Burns

We have a weekly blog post on the state of our gems, which we affectionately call “This Week in Open Source”. My favorite part about it (the reason I started it!) is that we get to thank the contributors publicly and officially.

Today I’d like to expand the thanks just a tiny bit: I’d like to thank people who are building on top of our open source work, extending it beyond our dreams. While I’m at it, I’d also like to highlight some of the non-thoughtbot open source work we build. I call this … Nearby in Open Source.


Matthew O'Riordan (mattheworiordan) built on top of capybara-webkit to give the world capybara-screenshot. It’s pretty slick: any time you have a capybara test failure, it saves a screenshot of the headless browser.

Installation is simple; toss this in your app’s Gemfile:

group :test do
  gem 'capybara-screenshot'

… and that’s it. It saves screenshots away in tmp/capybara. The simplicity is beautiful.

So give it a try and maybe send him a pull request or a follow.


Jesse Storimer (jstorimer), from all the way up in Ottawa, figured out how to process Paperclip attachments in the background using DelayedJob or Resque. He packaged it all together as delayed_paperclip, and it’s the way to go for delaying Paperclip processing. It even works with S3.

It’s a little trickier than capybara-screenshot to get running, due to the nature of the beast. But it’s also well-documented in the README.

In your Gemfile add delayed_paperclip:

gem 'paperclip'
gem 'delayed_paperclip'
gem 'resque'

You must also have Resque (or DJ) configured and running properly.

To have things function more smoothly you should add an attachment_processing boolean to your database table. Like this:

./script/rails g migration add_avatar_processing_to_users avatar_processing:boolean

In your model you need to explicitly state that the attachment is to be processed in the background:

class User < ActiveRecord::Base
  has_attached_file :avatar, :styles => { :medium => "300x300>", :thumb => "100x100>" }

  process_in_background :avatar

And there you go; background processing for your Paperclip uploads. Thanks, Jesse!


Speaking of Paperclip, Michael van Rooijen (meskyanichi) of The Netherlands figured out how to use MongoDB to store file upload data. He’s named this solution mongoid-paperclip.

The set up is straight-forward. In your Gemfile:

gem 'mongoid-paperclip', :require => 'mongoid_paperclip'

And in your model, where normally you would use has_attached_file, instead use has_mongoid_attached_file:

class User
  include Mongoid::Document
  include Mongoid::Paperclip

  has_mongoid_attached_file :avatar

We hack code too

Speaking of having things to share, we coders at thoughtbot are also coders outside of thoughtbot. Here’s a quicker summary of some sweet hacks we’ve rocked:

Nick Quaranto

Nick is qrush on GitHub. Follow him if you like these things:

A bunch of tips for using git.
Some central storage Web site for gems. [You might have heard of it](
A sample Web site, mixing Rails with high_voltage. He wrote a blog post about this.
A tool to help score a game of Carcassonne.

Jason Morrison

Jason is jasonm on GitHub. Maybe these tickle your fancy:

Sample apps:

A spike of a WebSockets-based, instant feedback, Rails and Backbone app.
A chat app showing how to mix Backbone, Cucumber, and Jasmine.


A talk on mixing Backbone and Rails, delivered at NH.rb and Boston.rb last month.
A talk on using Backbone, delivered at the [Boston Frontend Developers]( meetup.

Ben Orenstein

Ben is the amusingly-named r00k on GitHub. Two things in the past month, both related to his mouth:

Notes from his talk on Vim for Rails, which he gave both at RailsConf 2010 and at the first Boston Vim meetup.
The Web site for the quartet in which he sings.

Chad Pytel

Chad, or cpytel as we like to call him, had one talk-related repo last month:

A talk on Backbone delivered at the Future of Web Apps in London.

Gabe Berke-Williams

Gabe, with his long name and all, can be followed as gabebw on GitHub. Here’s some chat-related stuff he’s done in the past month:

An Adium log parser.
A tool for importing pidgin logs into Adium.
Natural language processing simulator for things that Reddit finds funny.
A proxy server to make Campfire understand images that don’t end in `.jpg`, specifically targetting

Harold Giménez

Harold, hgimenez on GitHub:

A talk on using Redis, amusingly titled “Redis: Nimble Data Bacon”, presented at PG West 2011.
A classic Rails gem for truncating a piece of HTML. (I also wrote this a bunch of years back!)
A sample app, serving as a gentle introduction to test-driven development.

Mike Burns

I can be found on GitHub as mike-burns. Some things I’m excited about:

An abstraction of the Rails presenter pattern, in a non-intrusive, object-oriented manner.
Those methods that should have existed on Ruby’s `Method` object.

… And More

Those are the gems that metaphorically came across my metaphorical desk over the past literal month. Do you have any to share? Any you’ve written?