A feature for an internal Ruby project here at Quick Left necessitated parsing the domain from a URL. This seems like a problem for which there must already exist a solution, but it surprisingly turns out that there is no available solution for this seemingly simple task.
Building your first Ruby gem may seem like a daunting task, but it’s actually not so bad. It’s quite rewarding to not only release a gem, but to see its download count climb as others put your hard work to good use, and even still as others offer to contribute new features and bug fixes to your very own gem. And thanks to RubyGems.org and Bundler, the process of creating, releasing, and implementing gems couldn’t be easier.
About two weeks ago, I released a new Ruby gem into the wild named ruby-measurement. (Unfortunately, measurement was already taken.) It serves as a means of parsing human-readable text into a quantity and unit, which can then be used for converting among units and other mathematical operations. Let’s take a simple string like “4 1/2[…]
This is just a short post since I haven’t updated my blog in quite some time. I recently spent some time trying to find a Ruby gem that will search/lookup products on Amazon. My searches only yielded the Peddler and Vacuum gems, both of which I found difficult to use. This prompted me to build[…]
I’ve been spending my free hours lately working on a realtime multiplayer game. In building the game, I decided to build the front-end using Ruby on Rails with the actual game implemented using Node.js, specifically using Socket.IO. One of the first major challenges I encountered with this approach is the need to share session data[…]
Just today, I ran into a situation where I wanted to modify the output generated by Formtastic while building an input element. In this particular scenario, the input field was a file input in which the user is expected to upload an image (PNG, JPG, or GIF). The customization I wanted was the ability to[…]
This past week, I released my first ever Ruby gem: multiple_table_inheritance. Multiple Table Inheritance is an ActiveRecord plugin designed for Rails 3.0+ designed to make table-level inheritance easier than ever. Imagine you have an application that needs to maintain a list of employees. You’ll probably start out with a few columns including first name, last[…]
With users uploading personal photos, especially ones coming their phones that capture landscape photos in portrait mode and vice versa, one of the things I wanted to integrate into Black Book Singles is the ability to rotate photos. Since I’m using the Paperclip gem, this should be relatively easy to achieve through a custom attachment[…]