Ruby For Good

This weekend I had the pleasure of co-hosting Ruby For Good, a conference that brings programmers together to work on projects for a variety of charities and non-profit organizations. This year, adorable kittens were involved.

Read More

Bundler Inline Gemfile Dependencies

If you haven't noticed, the Bundler team has been on a tear lately. It's hard to keep up with the pace of the 1.10.x releases. Along with improvements, they have been adding features. One that you might have missed is the new bundler/inline and it's gemfile method. Bundler Inline allows you declare your gem dependencies "inline" instead of a Gemfile. This is perfect for single file scripts. Everything can be contained in a single file, no Gemfile, no bundle install,...

Read More

Colorized SQL Log Backport for ActiveRecord

One of the new features of Rails 5 will be granular SQL logging so you can easily see SELECT, INSERT, UPDATE, DELETE, and TRANSACTION statements in your log. For example: But why let Rails 5 have all the fun? Today I created a gem that allows you to leverage this feature now. The gem is currently compatible and tested for Rails 3.2 to 4.2. Get it here and happy logging!

Read More

I have the PR!

We recently implemented a stronger, more active, pull request culture at CustomInk, as part of our deploy process. As you may already know, a pull request is a feature on Github that broadcasts to others that you would like to have your changes merged into an upstream project. [note: Turns out it's built into git itself http://git-scm.com/docs/git-request-pull]. We find that it's great for learning what other engineering teams are working on. It's also a great opportunity to share knowledge.

Read More

Rails Multi-Database Best Practices Roundup

Since landing my first job programming with Ruby, most Rails applications I have worked with have managed two or more database connections. Often times these connections are both readable and writable. Collectively they represent a comprehensive business domain. Today I would like to cover everything I know about this topic, without going into the bike shed of micro services or schema management gems. The goal is simple! To give you the tools you need to keep your application running smoothly...

Read More

Ruby's Private is for Methods Only

The other day I saw a pull request, on a Rails project, that declared a private inner class. Having my fair share of experience with Java, I am very familiar with the construct. Essentially, you declare one class inside of another class and declare it as private. This is often done to clean up your internal data structures and hide the implementation details from others. I couldn't recall ever seeing this in Ruby before, so it gave me pause. As...

Read More

Ruby Pretzel Colons

The Ruby Pretzel Colon is one of my favorite idioms. But it's salty goodness can be an acquired taste for new Ruby programmers. There seems to be an aversion to it's apparent magic. It is an unusual syntax. But it is easy to understand if you break it down into it's parts.

Read More