Announcing Nondestructive Migrations version 1.0

Now with full test coverage using MiniTest.

Rubygems link:

Github Link:

A few things I learned here along the way:

MiniTest has not replaced TestUnit for the hard-core Rails developer. MiniTest worked great fro this, except Rails version 4.0.x, 3.1.x and 3.2.x needs “minitest-rails”, “~> 1.0”. I tried testing with Rspec but since Rails itself is tested with Minitest this was actually easier (since I needed access to some special tests written inside of Railtie)

I used a fantastic tool called Appraisal to run my tests suite against several different versions of Rails (3.1, 3.2, 4.0, 4.1, and 4.2). Getting this set up with a little bit of work, but well worth it. You can configure Travis CI to work seamlessly with Appraisal, so you can run your Gem against different versions of Ruby, Rails, and three different databases (SQLite, MySQL, and Postgres). See the .travis.yml and Appraisals inside the gem code for details.

When writing a Gem, you’ll want to explicitly include all your files in the files setting inside the Gemspec (example). This is important, and if you fail to do this those files will work when the Gem is loaded via git: or path: but not when it is pulled from RubyGems.

Rubygems forces you to publish explicit version numbers on your gems. You cannot overwrite an existing version number, but you are allowed to “yank” a version down to remove it from Rubygems.


Little Trick To Get all the Methods You Can Call on a Ruby Object

This is a useful little trick to get all the methods that you can call on any Ruby object. This is extremely helpful when poking around someone else’s code (like Gem code) that is poorly documented.


This will return a long list of methods that you can call on the object. That list will include all the methods on all the superclasses of the object, including the Object object methods (the grandaddy of all objects). That’s often not very useful, so you can filter out the superclasses’s methods and only look at the methods associated with the subclass using:


The pull request where CoffeeScript become the default in Rails

If you happen to be bored today and want to read something funny, the pull request where CoffeeScript become the default in Rails always cracks me up.

See also:


How to Install an Older Version of Rails

Learned something on the Rails-talk list today that blew me away.

You can install an older version of rails using this syntax:

rails _4.0.8_ new appname

(Where “4.0.8” is the version you want and “appname” is the name of your new rails app.)

Yes, you actually type those underscores around the version number. By the way, if you don’t have that version installed (it installs via bundler), bundler will tell you it can’t find the gem. In that case, you’ll want to do gem install rails -v 4.0.8 and then re-run the command above.

This is a :thumbs down: for Rails documentation. This little trick isn’t even documented when I get the manual page for the rails new command (rails new -h)



Facebook Chrome Extension to do Mass Inviting to Facebook Events

Facebook Friend Inviter


Telling Safari NOT to re-open all the windows from my last session

Every restart your Mac and have it boot up only to open all the last Safari windows you had just opened? This feature – introduced a few operating systems ago – is something I personally don’t like at all. Perhaps I’m a “power user” but I often find that I open so many browser windows in the course of my work that I don’t really want them to all re-open

Ostensibly, Safari appears to have a preference to turn this off or on, here:

However in my version of Safari (7.0.6 on Mac OS X 10.9.5), this preference appears to not actually work at all. (annoying)

So here’s how to go into your system defaults and turn it off for real:

defaults write NSQuitAlwaysKeepsWindows -bool false


Heroku Why Oh Why?!?

Heroku you now have SIX different versions of top-level navigation across your website(s)

Who in the world told you that was a good idea?

Programming – Make a digital dashboard for you office

Here’s a new open source project from GroupOn for the creation of digital dashboards. Looks pretty cool.


Prettify your ‘Alert’ box in Javascript

Really nice replacement for Javascript’s ‘alert’ dialog box.

Check out the website: