A CustomInk Technology Blog

Instrumenting Your Code With ActiveSupport Notifications

Posted on

Moving past the supernatural ability to garner information from the log! Have you ever wondered how tools like New Relic are able to gain valuable metrics to your Rails application’s internals? Or maybe you are interested in learning how to write your own libraries and gems so they can be instrumented using those same techniques? Once again the answer is to look deep into the Rails source code – and the answer is ActiveSupport::Notifications. A simple and powerful instrumentation API for Ruby available in Rails v3.0 and upward.

Welcome Ryan Billings!

Posted on

Ryan Billings

Ryan joins CustomInk as a software engineer. He recently added features that allow our staff to quickly cancel and refund orders on Booster.

We’re fans of lean product development, so it’s not uncommon to deploy features with simple implementations in order to quickly learn about our customers. Alas, there comes a time to pay the piper: the manual order cancelation process we got by with was becoming a burden.

Just as important, we realized that our financial data model no longer reflected our reality; a refactor was in order. Ever the consummate team player, Ryan worked with engineers and stakeholders to design a better data model. Through a series of deploys, he updated the system with no downtime or impact on customers or client applications.

Finally, Ryan made quick work of the actual cancel feature, a good sign that we had refactored correctly.

Welcome to the team, Ryan! We’re glad you’re here.

Welcome Lisa Pourkhomami!

Posted on

Lisa Pourkhomami

Lisa joins CustomInk as a software engineer. She recently completed integrating payment processing into our new cart for CustomInk Campaigns, a huge upgrade in our user experience.

We are organized into small fire teams, each with a product manager, user experience designer, and a handful of software engineers. We succeed when we work together, balancing getting it done and getting it right. Lucky for Danger Squad!, Lisa brings an awesome mix of pragmatism and attention to detail to the team.

She also brings a broad skill set, which is great because we tackle projects at every level of the stack. Sometimes it’s a responsive customer experience, other times it’s extracting a new web service. And it’s always measured and analyzed in frightening detail.

Welcome to the team, Lisa. We’re looking forward to great things!

Bootstrap Your Next Project With the HolyGrailHarness

Posted on

The HolyGrailHarness is a curated Rails application prototype that focuses on simple test patterns for Ruby & JavaScript!

Unlike normal Rails Application Templates or more modern Rails application generators like Rails Composer, the HolyGrailHarness is a basic Rails application that can be considered a prototype and customized via a simple setup script. It is also somewhat opinionated in that it promotes simple and powerful testing choices and focuses on using Ruby 1.9 and up, MiniTest::Spec, Capybara, Poltergeist/PhantomJS, and Konacha. More details on each component and what HolyGrailHarness provides are below.

The HolyGrailHarness is perfect for any of the following:

  • Bootstrapping your next Rails application.
  • Learning and promoting MiniTest::Spec
  • Modern JavaScript testing setups.
  • Teaching Rails and/or JavaScript at your next meetup.

/etc/hosts Management With Chef

Posted on

We recently ran into a situation where we needed to use Chef Search to modify our /etc/hosts file dynamically on each Chef run. Originally seeming to be a relatively simple task, managing the hosts file with Chef rose some interesting challenges. While there are a few existing community-maintained /etc/hosts management cookbooks out there, none of them suited our needs. We wanted a highly customizable, easily expandable, simple, LWRP that was idempotent.

In this post, I will discuss creating your own LWRP, as well as some of the challenges faced while writing this LWRP. There will also be links to the community LWRP that we’ve created.

Testing Chef Cookbooks

Posted on

Throughout my internship at CustomInk, I’ve put a significant focus on Chef cookbook testing. At the time of this writing, there are a few solutions for testing cookbooks - ChefSpec, cucumber-chef, minitest-chef-handler, and rspec-chef – and they each have their own distinct advantages. At the very least, you should run knife cookbook test and foodcritic against all your cookbooks. Nathen Harvey covered this in his MVT: knife test and TravisCI blog post.

At CustomInk, we test using ChefSpec. Additionally, we use some home-grown gems such as fauxhai and Strainer to make testing easier.

Easily Test Your DNS

Posted on

At CustomInk, we recently made the switch to a new DNS provider. During the switch, we mass-imported records from our existing provider to our new provider. Did we get them all? Are they live yet? The immediate solution was to open up the terminal and fire off cURL requests, but there had to be a better way…

In this post/tutorial, I will show you how I created a test suite for our DNS records using RSpec. The solution is amazingly simple, and your specs will only be about 7 lines of code!