Barrage Of New Gems23 Oct 2008
Working for a company that sits in the middle of a supply chain, we deal with a significant volume of data.
Inbound we have things like customer orders, new product data, invoices and purchase order status reports from suppliers.
Outbound we have things like purchase orders going to our suppliers, order confirmations, invoices and new product data going to our customers.
Most of this is electronic and automatic, and is therefore highly dependent on industry standardised identifiers. In Australia, products are usually identified with an EAN-13, but some of our US based suppliers are still using UPC-12.
To deal with all these IDs in my ruby code, I’ve put together some very simple little gems for recognising and validating the various numbers I encounter.
gem install ean13 gem install upc gem install san gem install abn
They’re all single file, single class libraries with similar looking APIs, and operate in a similar way to the ISTC gem I talk about here.
Nothing groundbreaking or exciting, but useful little libraries when you need to decipher what sort of identifier a number is, and for validating fields in your models.