Feed items

A new Ruby and Rails blog is born

I haven’t been blogging much lately. I’ve been too busy with some vacation time and, of course, work.

This is going to change, but it’s not all going to happen on Programblings.

It’s been a long time coming, but
giraffesoft finally has a blog. We’re going to kickstart our blog with a week of open source releases.

Rubinius for the Layman, Part 3 - Try Rubinius in 20 minutes

I guess we’ve all heard
last week’s sad news about Engine Yard
diminishing the awesome support they’ve given the Rubinius project.

git-config has autocomplete?

Seen on a git 1.6.0.4 installation (dunno about previous versions), installed through MacPorts
1 with the
+bash_completion option.

Installing ruby 1.9preview1 on OS X Leopard

Tonight I’m trying conciseness.

Editor’s note: I failed.

git_remote_branch is github-agnostic

Josh Knowles recently suggested that maybe I could merge grb’s functionality to the github gem.

Both gems being command-line tools that help you use Git in a friendlier manner, the question makes a lot of sense. It makes so much sense in fact, that I decided to blog about it. A post about it will scale much better to answer other users who may potentially ask the same question.

git_remote_branch 0.3 - Awesomeness for the masses

Awesomeness for the masses

git_remote_branch 0.3 has been released!

Previous releases were pretty much only usable by rubyists on OS X.

Works on my machine logo

Installing gems with command-line interfaces on Ubuntu 8.10

To install any ruby gem which has a command-line interface on Ubuntu 8.10, you have to add a path to your PATH environment variable. In your .bashrc file, add the following line:

export PATH=$PATH:/var/lib/gems/1.8/bin

Also worth noting is the fact that the default ruby interpreter on 8.10 is back to the 1.8 branch: it’s 1.8.7 (1.9 was the default on 8.04 iirc). 1.9  also be installed right besides 1.8.

Two Shoulda best practices

In praise of Shoulda macros

Shoulda contexts let you to share setup code between different tests. This is for me one of Shoulda’s most attractive features.

When you combine this with the technique of defining your own macros to encapsulate assertions or setups that come up often, you end up with seriously DRY and readable tests.

I see a few different kinds of Shoulda macros:

Assertion macros

Assertions macros often begin with should_. They encapsulate one or a few assertions.

This should_raise an exception

If you use Shoulda and, like me, you hate Test::Unit’s assert_raise(), I may have something of interest for you.

Why the hate?

Well, assert_raise accepts an *args list of exception types.

If you don’t pass any, you get some nonsense because an empty array doesn’t jive with the exception raised by your block. Useful. So if you don’t care what exception is raised, assert_raise isn’t gonna help you.

Git global ignores

I don’t know about you, but for me, using git is so low-friction that I use it basically for everything where I may need a powerful undo button. In other words, I don’t use it only for team software development projects.