Menu Sidebar

Avdi Grimm

Hacker; code documentarian.

Boolean Externalities

The other night I spent a long time trying to figure out why an acceptance test was failing. Eventually I tracked it down to the fact that a particular predicate method was returning false, when I expected it to be returning true.

Ultimately I would find that the test failure pointed back to a legitimate oversight in my code. But I wasn’t there yet. First I had to work my way back to the source of the unexpected false.

Read More

How to use Ruby’s English and/or operators without going nuts

Years ago I wrote about Ruby’s English and/or operators and why they are the way they are. I’ve never been completely happy with how I made my case in that article, and more recently I took another whack at it in a RubyTapas episode. However, until now that episode hasn’t been available to the general public. Today that changes; I’ve made the episode freely available and you can watch it right here.

Read More

Where do ideas come from?

Someone wrote in asking:

you always have ideas… How do you generate ideas to build something?

Which is a great opportunity to pontificate. (I swear, I did not make this question up!)

Let’s get this out of the way: I am the wrong person to ask. I am not an effective “idea guy”. I’m white, male, I was born in the USA, I’m 34 years old, and I’ve been writing software since I was in my teens. If I were any good at ideas, I’d be a millionaire by now.

So you probably shouldn’t listen to a word I say. But I’m going to say it anyway, because there’s nothing quite so much fun as making up answers to the big questions.

Read More

Zero to Smoke Test with Sinatra

The other day I put an app in production with (gasp) no automated tests. I’m careful to say no automated tests, because of course I had been testing it manually throughout the ~12 hours it took me to write the initial version of the app. In lieu of tests, I made sure to log copious amounts of information, which I then collected from my deployed app into Papertrail.

For a single day’s work this was acceptable. But I knew that once I had a version in production, pushing out even the smallest, seemingly benign change would be an extremely dicey proposition without some automated regression tests in place.

Read More

New book! Birthday sale!

TL;DR: New book project, The Rake Field Manual. Today only, buy early access to it at half-price ($12.50) with coupon code HAPPY0X22. Or get any of my other books and videos at half price with code BDAY0X22. Or get your first three months of RubyTapas for the price of one by signing up using this link.

Hi folks! It’s that time of year again. The time of year when I celebrate another revolution around the sun by announcing new projects and putting everything on sale!

Oh, and drinking lots of beer and playing Badminton all afternoon, but sadly our yard isn’t big enough to invite you all over for that part.

The Rake Field Manual

First off! It’s been way too long since I started a new project. I’ve mentioned it once or twice on Twitter, but today I’m officially announcing my new book project, The Rake Field Manual.

Some of you may have seen the video/blog post series I released about advanced Rake. In the past year as I have transitioned my digital bookbinding toolchain over from GNU Make to Rake, I’ve learned a lot about the power and flexibility of the Rake build tool. Of course I had used Rake for many years in conjunction with various Ruby projects. But as it turns out, I had barely scratched the surface of what it is capable of.

So in this book I’m going to share what I’ve learned, and no doubt learn even more along the way. It will be laid out in a “cookbook” style, each short chapter addressing a real-world automation problem with a practical Rake solution. However, I don’t want the book to only be applicable to people who are already familiar with Rake. So I will be structuring the recipes in such a way that if you read it from the beginning, you’ll get a solid Rake tutorial starting with basic principles.

Here’s are some example chapters:

I also believe that Rake is applicable far beyond automating just Ruby project builds. In order to give the book the widest potential audience, I’ll be constraining most examples to use a small subset of Ruby 1.9 features. In addition, in the finished product I’ll include an appendix containing a brief introduction to just enough Ruby to understand the examples in the book.

I’m not announcing a timeline for this book; it’ll be done when it’s done. A lot of that will hinge on the feedback I get from readers. And that’s where you come in.

As a self-publishing author, I don’t get publisher advances to cover the cost of writing a book. Instead, in the past I’ve pre-sold my books while they were in an early state, both to get reader feedback and to fund the writing process.

I’m doing that again with The Rake Field Manual, but this time I’ll be collaborating with early readers more closely than ever before. Early buyers of this book will receive immediate access to the working Github repo where I’m writing it. There, you’ll be able to see the daily changes as I make them, report errata, and file issues requesting coverage of topics that are important to you. More than any other book I’ve written, the direction of this one will be guided by the input of my readers.

Oh yeah, one other thing: I’ve decided to donate 10% of the proceeds from this book to the Weirich Fund, in honor of the man who gave us Rake (and so much besides).

Every year I throw a big sale on my birthday, and this year is no exception. Today only, you can purchase early access to The Rake Field Manual as I write it at half price, only $12.50. Just use coupon code HAPPY0X22 when you check out.

So if you want to support my work, give me a sweet birthday present, support a good cause, help guide the evolution of my new book, and get a great deal, buy it now!

Buy The Rake Field Manual

Sale on other products

What about the rest of my books and videos, like Confident Ruby, Exceptional Ruby, and The Making of They are all on sale too! For one day, take 50% off of anything in my store using the coupon code: BDAY0X22 (note that this is a different code).

One more thing: if you’re not already a RubyTapas subscriber, today only you can get your first three months for the price of one by signing up using this link:

Thanks for all the business over the years! Happy hacking!

Newer Posts
Older Posts

Virtuous Code

"The three virtues of a programmer: laziness, impatience, and hubris" — Larry Wall

Books and Screencasts

RubyTapas Screencasts

RubyTapas Screencasts

Small plates of gourmet Ruby code.

Confident Ruby

Confident Ruby cover

32 Patterns for joyful coding.

The Making of

Confident Ruby cover

Watch me build an app in Sinatra and Rails

Objects on Rails

Objects on Rails

A developer notebook on applying classic Object-Oriented principles to Ruby on Rails projects.

Exceptional Ruby

Exceptional Ruby

The definitive guide to exceptions and failure handling in Ruby.