Sneaky Abstractions

Subscribe to my Feed, follow me on , recommend me on Working With Rails or see my code on GitHub

Barby 0.1.1

Posted on April 25, 2008 14:35 Tagged with barby, barcodes, ruby, gem.

Update: Just released 0.1.2, which includes a CairoOutputter written by Kouhei Sutou. It uses Cairo to generate SVG, PDF, PS and PNG.

I just released a minor update to the Barby gem. It’ll probably take a few hours before it’s available from the gem servers, but you can always get it from GitHub

The release includes some minor fixes and a new outputter class which uses the “png” gem (can’t find any description of it on the internets, but you can install it with gem install png).

You can use the new outputter just by requiring the file. It will register the to_png method like RmagickOutputter.

require 'barby'
require 'barby/outputter/png_outputter'

puts Barby::Code128B.new('HUMBABA').to_png

It’s not really much faster than RMagick, but I guess some people will prefer it as it’s more lightweight and doesn’t leak memory like RMagick does ;)

Super Disco Breakin