Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

Chad Woolley

Posts By

Automating Bundler In Your Deploy

If you are using Bundler to lock and package your gem dependencies in your app (which you should), here's some tips on making everything automatic in your Capistrano deploy.

Refer to the Bundler Documentation for instructions on how to use Bundler to properly package your gems and check everything in.

Once this is done, however, you still must ensure that two things are done on every machine to which you will deploy:

  1. Bundler is installed
  2. You run 'bundle install' on every deploy to install the packaged gems on the local machine (and compile any gems with native dependencies)

Here's the Capistrano magic to accomplish these two tasks automatically on every deploy:

before "deploy:bundle_install", "deploy:install_bundler"
after "deploy:update_code", "deploy:bundle_install"

namespace :deploy do
  desc "installs Bundler if it is not already installed"
  task :install_bundler, :roles => :app do
    sudo "sh -c 'if [ -z `which bundle` ]; then echo Installing Bundler; sudo gem install bundler; fi'"

  desc "run 'bundle install' to install Bundler's packaged gems for the current deploy"
  task :bundle_install, :roles => :app do
    run "cd #{release_path} && bundle install"

Oh, and for you GemInstaller users out there - here's an easy way to generate a Bundler Gemfile from your geminstaller.yml config:

geminstaller --bundler-export > Gemfile

You'll probably still need some tweaks, but this will get you started. Just make sure you upgrade to GemInstaller 0.5.5 first (0.5.4 forgot to put the 'source' line in the Gemfile).

Happy Bundling! -- Chad

P.S. There is a similar article here, which includes tasks to symlink your .bundle dir into the Capistrano shared directory, but my deploy was pretty fast anyway, so I didn't worry about it. YMMV.

Read More

[ANN] GemInstaller 0.5.3 Released

This fixes several bugs that people have complained about for quite a while. Please let me know if anything is broken.

GemInstaller 0.5.3 has been released!



  • 0.5.3 / 2009-08-25
  • Many long overdue bugfixes and patches, see for details.
  • Thanks to Greg Fitzgerald, Britt Crawford, John Trupiano, Gabriel Gironda, and Eric Hodel for patches and assistance.
  • Issues with case statement under Ruby 1.9
  • GemInstaller cannot distinguish between gems that have the ame name but capitalized differently.
  • add ./ci as default location for config file
  • Disable GemInstaller install in default rails preinitializer.rb, but fork if it is used
  • autogem() fails when run for newly-installed gem
  • Sometimes installing fails due to RubyGems cache not being cleared between multiple API calls


Automated Gem installation, activation, and much more!


GemInstaller provides automated installation, loading and activation of RubyGems. It uses a simple YAML config file to:

  • Automatically install the correct versions of all required gems wherever your app runs.
  • Automatically ensure installed gems and versions are consistent across multiple applications, machines, platforms, and environments
  • Automatically activate correct versions of gems on the ruby load path when your app runs ('require_gem'/'gem')
  • Automatically reinstall missing dependency gems (built in to RubyGems > 1.0)
  • Automatically detect correct platform to install for multi-platform gems (built in to RubyGems > 1.0)
  • Print YAML for "rogue gems" which are not specified in the current config, to easily bootstrap your config file, or find gems that were manually installed without GemInstaller.
  • Allow for common configs to be reused across projects or environments by supporting multiple config files, including common config file snippets, and defaults with overrides.
  • Allow for dynamic selection of gems, versions, and platforms to be used based on environment vars or any other logic.
  • Avoid the "works on demo, breaks on production" syndrome
  • Find lost socks.

Quick Start



  • [sudo] gem install geminstaller

Read More

The Great Ruby IDE Smackdown of '09

In a recent thread on the East Bay Ruby Meetup list, several people chimed in with Ruby IDE suggestions. I suggested RubyMine, which we use at Pivotal. Several people mentioned NetBeans and Aptana RadRails, so I decided to have a little contest.

Now, if I am going to work in an IDE and sacrifice the speed of a text editor, I want to see it work for me ('cuz RubyMine can chew through all your CPU and RAM and then some faster than you can say Moore's Law). That means understanding Ruby, and using that information to save me some significant thinking and work.

I don't mean code-generation macros or dumb context-aware keyword-completion, I mean something useful like knowing where my classes and methods are. In my book, that leaves out Emacs, Vi, and even TextMate, regardless of their other merits (sorry people, I like text editors too, but I'm making up this test - flame away, the comments section is below).

So, here's the smackdown scenario:

  • Download the latest NetBeans, RadRails and RubyMine.
  • Open a Ruby project, this example is one of mine (I wrote this three years ago to learn Ruby, so don't make fun of me for doing dumb stuff...)
  • Test the ability of the IDE to navigate through Ruby language constructs. This should be easy, it is a command-line app using a Dependency Injection architecture, no metaprogramming curveballs!
    • Open the root Ruby class for the project (lib/geminstaller.rb)
    • Pick a variable (app in self.install)
    • Try to work back to the class declaration (GemInstaller::Application) using IDE navigation (Command-click in all the IDEs, although sometimes they ignore you)

Result? RubyMine succeeded, NetBeans and RadRails failed miserably. Here's what happened in each:


  1. Click create_application class method reference in app = create_application. NetBeans takes me to the method declaration in same class.
  2. Click the app method in

FAIL! ANGRY BEEP! app is an attr_accessor on another class, NetBeans can't find it.


  1. Click create_application class method reference in app = create_application. RadRails takes me to the method declaration in same class.
  2. Click app method in RadRails takes me to the attr_accessor on the Registry class (without a prompt, and highlighting the symbol, which is even better than RubyMine).
  3. Click (and F3) on the :app symbol argument to attr_accessor.

FAIL! ANGRY BEEP! RadRails can't figure out the symbol parameter to attr_accessor. It says "Current text selection does not resolve to a Ruby element".


  1. Click create_application class method reference in app = create_application. RubyMine takes me to the method declaration in same class.
  2. Click app method in RubyMine pops up a dialog asking if I mean the attr_accessor on the Registry class, or the local variable I'm declaring. That's rather silly, I admit, but the point is it followed the reference to another class.
  3. Click on the attr_accessor choice. RubyMine takes me to the attr_accessor line in Registry.
  4. Click on the :app symbol argument to attr_accessor. RubyMine takes me to the point where the @app instance variable is initialized.
  5. Click on the Application class name in the constructor invocation. RubyMine pops up a dialog asking if I mean the Application class in my application, or two other Application classes that happen to be in my Ruby installation. This is also a silly question - it should have known the correct choice because of my namespacing, but it still found the class.
  6. Click on the GemInstaller:Application choice. RubyMine takes me to the class declaration.

SUCCESS! RubyMine drilled all the way to the class declaration, even through an attr_accessor, albeit with a couple of stupid questions.


I personally think this is a Big Deal. In the past, I've mocked Ruby IDE functionality as a poor simulacrum of the vast power in Java IDEs. When using Eclipse in Java, I could perform epic refactorings, extracting superclasses and adding parameters to method signatures; refactoring scores of classes across multiple projects in a few mighty keystrokes. Yes, I'm fully aware that this is because Ruby is a dynamic language, but that doesn't make me miss a real refactoring IDE any less, and others have long lamented these shortcomings, as well.

So, for years, even though I'd always indulge my pairs if they wanted to use an IDE, I've done all my personal hacking with a fast, lightweight text editor and command line tools. To me, the benefits of a memory- and processor-sucking IDE with tons of unnecessary, unconfigurable, resource-eating tiny-ass-fonts and chrome did not justify giving up the speed and responsiveness of a great text editor.

However, RubyMine can now navigate code for me. I don't have to think and manually find that class, RubyMine knows where it is. Granted, that ain't no Extract Superclass, but it saves me a lot of thought and time, both of which are increasingly rare commodities for me.

To be fair, this is really just a problem related to parsing and interpreting attr_accessor declarations, and I expect that NetBeans and RadRails will pass this test as well in another release or two. That's all great news, because it means that Ruby IDEs are finally, slowly, coming of age. I think I'll still be waiting a long time for an automated Modify Method Signature refactoring, though...

Read More

"open_gem" Gem Plugin

From the Too Useful Not to Blog Department:

open_gem from Adam Sanderson is a new RubyGems Plugin to automatically open a gem's source in your favorite $EDITOR.

gem update --system
sudo gem install open_gem
export EDITOR=mate
gem open rails

NOTE: If you have RubyGems 1.1 or 1.2, 'gem update --system' may not work. See the RubyGems Release Notes for more info.

Read More

GoGaRuCo '09 – Relational Modeling Framework – Nathan Sobo

Relational Modeling Framework - Nathan Sobo


GoGaRuCo '09 - Relational Modeling Framework - Nathan Sobo

Video of interaction model that drove thinking

Grockit - it is all common - pushing events collaboratively. This is harder than asynchronous model.

Client needs to respond to to the server in an asynchrounous manner.

All rendering occurs in the browser modifying the DOM as needed.

How do you model this? With a relational model. They build a relational model in the browser.

It is good because you don't need pointers, you just use foreign keys and scalar values. Really flat, really easy to serialize and move across the wire.

However, it is difficult to work with. Things are indexed by id, etc.


Lots of live coding. See the video (up soon) at

New project is "June" - based on Unison, but Unison is being deprecated.

The most primitive object in June is the set

System for working things in the browser.

It behaves as you would expect any relational model. Support add/remove etc. Example has User, Pet, and Species. Updating Tuples. Testing with Screwunit

Can have events on sets (i.e. on_insert, on_remove, on_update )

GoGaRuCo '09 - Relational Modeling Framework - Nathan Sobo

Events have other stateful information passed through a hash in changed attributes for each event.

on_update(function(model, changed_attributes) {
  if ( {
    print( + " was renamed to " + );

Also has join model:

var stephs_species = stephs_pets.join(Species).on(Pet.species_id.eq(;

Also has has_many, and others will be implemented too.

Nathan can live code very well. He is writing a lot of really cool code and talking about it at the same time. Like this:

relates_to_many("pet_species", function() {
  return this.pets_relation

Can also remotely access the entire server-side database (don't worry, there will be a security model):

var remote = June.remote("/domain");

However, you can't pull the whole database down to the browser. So, you can get a subset of the data that the client requests.

Security: Only give the browser access to things the user is authorized to see. Every Tuple acts as it's own database.

Objects that have specific permissions only receive tuples and events that pertain to them.

Read More

GoGaRuCo '09 – Arduino is Rails for hardware hacking – Greg Borenstein

Arduino is Rails for hardware hacking - Greg Borenstein


Greg Borenstein

GoGaRuCo '09 - Arduino is Rails for hardware hacking - Greg Borenstein

Obligatory safety talk

Electrical engineering is for experts!

Physical computing is for everyone!

  • Artists!
  • Idealists - Fab labs in India
  • Hackers - Cockroach driven robot. Cockroach runs, spins ball, drives robot

Physical computing is programming for stuff read inputs from your surroundings and modify them based on logic


Open source hardware and software project that makes physical computing really easy


  • Program via USB
  • power via 9v
  • 14 digital i/o pins
  • AVR microcontroller
  • 6 analog i/o pins

Most of the API is for sensing and controlling the physical world.

HELLO WORLD - make an LED blink on and off

class HelloWorld < ArduinoSketch
  output_pin 13, :as => led

  def loop

GoGaRuCo '09 - Arduino is Rails for hardware hacking - Greg Borenstein

RAD is Ruby Arduino Development

In a hardware demo, everyone is required to go "Oooooooooooh" (even if it doesn't work)

rad command generates a project directories

You can buy an Arduino board for ~$30 from Make or a Dorkboard for ~$6

Bell rings as a post commit-hook for git

.git/hooks/post-commit require 'bell.rb' Bell.ring exit 0

Demo Reason + Archeopteryx playing a drum

GoGaRuCo '09 - Arduino is Rails for hardware hacking - Greg Borenstein

  • Play midi via Reason
  • Playing same midi through arduino, a motor, a drumstick and a snare drum

Archeopteryx: code describes patterns with channels, and randomness.

Reason sends midi to Tascam midi device, Tascam sends to Arduino, which turns solenoid attached to drumstick.

Physical computing is for everyone, if you've ever wanted to make your code interact with the world, now you can.

Q: Can you use this to play rockband?
A: Yes. You can use a photoresistor to detect notes coming across the line.

Q: Are there latency problems with midi playback?
A: The clockspeed of the arduino is fast enough to keep up with the playback.

Read More

GoGaRuCo '09 – Raffles!

Lots of nice prizes. Some people weren't there. They lost!

GoGaRuCo '09 - Raffles

Zach won an iPhone!

GoGaRuCo '09 - Raffles

Read More

GoGaRuCo '09 – Webrat: Rails Acceptance Testing Evolved – Bryan Helmkamp

Webrat: Rails Acceptance Testing Evolved - Bryan Helmkamp


Bryan Helmkamp ( more about him ). He works at WePlay. He is the co-author of "The RSpec Book"


Audience Poll: How many people know and use webrat (50%+ using, 25% using)

Webrat is an awesome tool everyone should use, but it doesn't run on the iPhone, not written in Scala, and there is no Pr0n.

GoGaRuCo '09 - Webrat: Rails Acceptance Testing Evolved - Bryan Helmkamp

Beer Disclaimer

If you have questions that aren't answered, find him for a beer after the conference


Writing a rails integration test how we test websites, traditional methods are brittle and tedious.

Webrat code is more readable than traditionally written integration tests

It behaves like a browser:

  • "visit" method - the equivalent typing in a URL to the browser.
  • "click_link" - like clicking a link (duh)
  • "fill_in" - fills in a field
  • "assert_contain" - perform assertions

Uses nokogiri to parse the response HTML and run assertions on it.

How to use it?

config.gem "webrat", :version => ">= 0.4.4"

Webrat.configure do |config|
  config.mode = :rails

Webrat's Core API

  • visit
  • click_link
  • fill_in
  • check and uncheck
  • choose
  • select
  • attach_file
  • click_button

Webrat works with RSpec, Shoulda and Cucumber Webrat and cucumber do not have to be used together. You can use Webrat with whatever testing framework you want to use. Webrat also works with Rails, Sinatra and Merb.

Webrat can do input matching to labels. Webrat encourages you to put good labels on your form fields.

GoGaRuCo '09 - Webrat: Rails Acceptance Testing Evolved - Bryan Helmkamp

Webrat verifies HTTP Status codes for you behind the scenes.

  • Automatically makes sure you don't get 500 HTTP server errors.
  • Also ensures that fields exist

Verify HTML content

response.should contain("Hello, world!")
response.should have_selector("li", :class => "new", :count => 2)
response.should_not have_xpath(".//meta[@name='robots']")

response.should have_selector("#album li:nth-child(3)") do |li|
  li.should have_selector("img", :src => photo_path(@photo))
  li.should contain("Vacation Photo")

When things go wrong Webrat uses '''save_and_open_page''' and writes out the current response body and brings up the page.

Webrat Adapters

  • Rails
  • Merb
  • Sinatra
  • Selenium
  • Mechanize (can use to scrape other websites i.e. google)

Evil plot is to write adapters so he can test everything at once.


Webrat started as an alternative to selenium, but it now includes a selenium adapter. Bryan suggests not using selenium whenever possible. You should start with the traditional webrat mode and not the selenium mode. Unfortunately, it's the only way to test a real browser, such as javascript.

# selenium doesn't support transactional fixtures
class ActiveSupport::TestCase
  self.use_transactional_fixtures = false

setup do |session|
  session_host "localhost:3000"

Webrat.configure do |config|
  config.mode = :selenium

Webrat talks to the selenium client gem to talk to the Selenium RC server which then drives a browser (IE, safari, and/or firefox).

Sometimes you'll need to an action differently when a browser is actually present. These commands let you write code for a specific context: webrat.simulate - traditional webrat simulation mode webrate.automate - drive a real browser

# is not run in normal webrat mode
  webrat.automate do

# is not run in selenium webrat mode
webrat.simulate do

The 'selenium' object is exposed from the selenium client gem. You can use it directly within your tests.

Automating a real web browser is SLOW

One more thing...

rack::test - gives you a quick way to generate requests to any rack enabled application Makes it easy to test complicated routing of requests through rack apps. For example, a rails metal that routes to a sinatra app.

Rack::Test API

get post, put, delete head request ...


  • Q: How do you deal with links with the same names?
  • A: Webrat has a method called "within" which allows you to scope your selectors to be inside an HTML tag.

  • Q: Does it have support for checking HTML validity?

  • A: No, that is outside of the scope of core webrat. However, we have talked about the ability to capture

  • Q: Where does the output of save_and_open_page go?

  • A: Into Rails' tmp directory

  • Q: Selenium client has some interesting screen grab is that being exposed?

  • A: Webrat has that in Selenium mode now.

Read More

GoGaRuCo '09 – Using Shoes to create better iPhone apps – Tim Elliott

Using Shoes to Have Fun - Tim Elliott


He rode his bicycle from Chico. He works at Trevidia, and is a Rails developer


GoGaRuCo '09 - Tim Elliott


The highlight is the fun that he has found by programming in Shoes. This was originally a talk about iPhone, but he wanted to put more fun into it.

why the lucky stiff wrote a comic about Shoes. In 2003, why wrote a blog post called "The Little Coder's Predicament". It is a call to arms for all programmers, beginning and expert, to have more fun.

Such as the old Commodore 64 program, written in BASIC: 10 PRINT "TIM RULES" 20 GOTO 10

You could do really fun things really easily, even if you didn't own a C64!

However, Ruby is harder for kids (especially on windows) to get started with:

  • Ruby one click installer
  • RubyGems
  • Sqlite

    rails cat_app script/generate etc...

That lets you "make a cat", but not too exciting for kids. Involves too many other languages (HTML, CSS, Javascript). They want cats to jump around the screen and do cool stuff.


  • One installer
  • draw and animate

Shoes is not a Gem

Couldn't use a standard ruby distro, had to install a new one, but this is because shoes is not geared towards developers, but people who are installing for the first time.

GoGaRuCo '09 - Tim Elliott

Shoes is a GUI toolkit that embeds Ruby. It includes a packager and a few gems.

Very flexible but understandable layout engine.

Example of Shoes: do stack do para 'wanna click a button?' button('sure') { alert 'woot' } end end

"Stacks" and "Flows". You can do simple or complex layouts using these two principles.

Flows act like left floated html elements.

Everything is wrapped in a block, and does a class eval.

You can put your own classes outside the app block and use them inside, but there's a gotcha. Once you use classes from outside the app block, the class eval doesn't work, but there is a workaround.

Shoes keeps an array in the form of an in-memory stack that remembers everything. So when you start putting controls in, Shoes knows where to put them. it is always tracking which container you are in, so you can get an idea of where everything shows up.

Also watch out for long-running tasks at the OS level, this can kill the app performance (due to green threads).

Demo of Shoes:

Drawing some ovals

Shoes online manual

Shoes itself comes with online documentation when you install it, which has a nice search tool and examples.

Shoes is also good for rapid prototyping, such as desktop apps or iPhone apps. The advantage is that you get to do it all in Ruby.

Sharing with friends

It is easy to share. If you are running shoes, you can use a packager that comes with it to create an executable installer which runs on Windows, Linux, or OSX.

It will be small, a few meg, and still under ten even if you use video.

You can use ruby-debug to interactively debug.

`Shoes.setup do gem 'ruby-debug' end

require 'ruby-debug' do debugger end ` Shoes has a gem installer gui and will install gems includes in the Shoes setup block, this gets included in the package.

It includes native HTTP download libraries for all platforms, because ruby http lib is slow and for other issues.

In the git distro, it includes "bloopsiphone" which lets you create Atari-like sounds and noises, and it also has an easy API.

Be creative and have fun, make robot apps, make the robots eat each other. This is a great way to connect your passion with non-programmers, because everyone likes robots eating other robots.

Q: You mentioned development for the iPhone can you go into more detail? A: You can't run ruby on the iPhone yet but its still useful for prototyping.

Read More

GoGaRuCo '09 – Meta Meta – LiveBlogging the LiveBlogging – Coda/SubEtha

For the second day of GoGaRuCo, my fellow Pivots David Stevenson, Zach Brock, and Ryan Dy are helping out with the live-blogging duties (Tom Sawyer says live blogging is SOO FUN!).

We are ALL writing the blog posts collaboratively, using the Coda editor which is based on the SubEthaEngine:

GoGaRuCo '09 - MetaMeta - LiveBlogging the LiveBlogging - Coda/SubEtha

Read More