Niels Stevens – 3 December 2013
227 words in about 1 minute
We, at Kabisa, can proudly announce we have open sourced 2 gems!
We developed these gems as part of one of our latests projects for a partner in logistics sector.
Container Number Validator
The first gem extends the currently available Rails validations. Our container validator allows you to validate input to see if it’s a correct Container Number. We followed the specification according this ISO standard: ISO 6346.
By simply adding the gem to your Gemfile, you can use the validation as follows:
1 2 3 Class Container validates :container_no, container_number: true end
For more information you can check the source at Github
Our logistics partner makes heavy use of the UN/Locode standard. To provide a simple way of searching valid locode’s we first made use of the locode gem. We created some extension for the original gem. But after using the gem on staging and production environments we noticed it consumed a lot of memory.
Therefore we created a new gem un_locode. Not relying on loading all locode’s into memory but using a sqlite database to manage all posible locode’s, gave us a lot more flexibility and performance.
We provided several ways to lookup locode’s, but this is a small example:
1 2 UnLocode::Locode.find_by_fuzzy_name('Göte') Check the github repo for more information.
You can find more information about the UN/Locode standard on Wikipedia