I needed to decode HTML entities in Ruby this morning. Surprisingly, I couldn’t find an obvious way to do it in the existing libraries, although it must be a fairly common requirement.

Should you need to do the same thing, you can save yourself a whole half an hour, and download my implementation instead.