Mathieu Martin

Programblings

Rambling about programming and life as a programmer - by Mathieu Martin

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.

restoring lost commits

So, you just did a git reset --hard HEAD^ and threw out your last commit. Well, it turns out you really did need those changes. You’ll never be able to implement that algorithm that perfectly twice, so you need it back. Don’t fear, git should still have your commit. When you do a reset, the commit you threw out goes to a “dangling” state. It’s still in git’s datastore, waiting for the next garbage collection to clean it up. So unless you’ve ran a git gc since you tossed it, you should be in the clear to restore it.

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.

Syndicate content