Articles on Ruby

Black computer keyboard
Albert Yi

Albert Yi

Take Command of Your Ruby Code with the Command Pattern

It’s no secret that Ruby trivializes many classic design patterns. What might take 30 lines in Java can often be a one-liner in Ruby. But there’s more to learning a design pattern than reading some pseudo code about Widgets and AbstractFlyweightDecoratorFactory classes. The Command pattern is an abstraction that will be familiar to most experienced

Alice Wenner

Alice Wenner

Why You Shouldn’t Sleep on Ruby on Rails in 2022

First released to the public in 2004, Ruby on Rails is an open source web-application framework written in the Ruby programming language. We sat down with Carbon Five Director of Engineering Matt Brictson to discuss all things Ruby on Rails, including the benefits of using Rails versus an all-Javascript stack, what’s in store for the

Bobby Matson

Bobby Matson

Building a LeapMotion DrumSet in Ruby

I love playing around with the LeapMotion. It is a wonderful little piece of technology, has great documentation, and is way ahead of its time. More specifically, I’m interested in its potential to communicate with MIDI, the protocol which allows software to translate musical data. A quick aside: My background is in music, having played

Christian Nelson

Christian Nelson

Raygun: Generating Rails Apps for the Last Year

It was about a year ago that we first announced Raygun, our Rails applications generator. Since then, many apps have been zapped into existence, both internally at Carbon Five and in the wild. Raygun evolved over the year; it does more of some things and less of others. Let’s see what Raygun does and what

Erin Swenson-Healey

Erin Swenson-Healey

Applying Functional Programming Principles To Your Rails Codebase

All the programmers around me seem to have very strong opinions about functional programming. The Internet certainly loves to talk about it. Some of the concepts are interesting – but many of them (at first) don’t seem to apply for those of us writing database-fronting web applications. What can we apply from a world in

Jonah Williams

Jonah Williams

Writing Deterministic & Performant Specs with Capybara

Acceptance tests are a great tool for guiding [outside in testing] and defining application behavior. Unfortunately they are also notoriously slow and often brittle. At Carbon Five we usually use Capybara to drive our acceptance tests (either directly in RSpec feature specs or within Cucumber steps) so let’s explore some ways we might accidentally write

Travis Herrick

Travis Herrick

Sinatra Best Practices: Part Two

In Sinatra Best Practices: Part One we saw how to break up your Sinatra application into smaller bite-size pieces. Today, we’re going to explore testing, which will also compel us to address environment configuration.

Purple pattern
Erin Swenson-Healey

Erin Swenson-Healey

Sinatra Best Practices: Part One

While Sinatra’s one-file approach may work well for your one-off, smaller application – it can quickly become a mess as you add on multiple routes, route-handlers, helpers, and configuration. So what’s a programmer to do? In reading Sinatra’s documentation I’ve found a few morsels that have enabled us to split our otherwise-monolithic (I realize this

Jared Carroll

Jared Carroll

Integrating 3rd-Party APIs: Listen to Your Tests

When integrating 3rd-party APIs, it’s important to listen to your tests. The most common design relies on tests that directly mock the 3rd-party API. These tests are brittle, but are often acceptable because, well, they work. A better approach is to take the time to design an app-specific interface to wrap the 3rd-party API. The

Jared Carroll

Jared Carroll

Keeping Domain Models Cohesive with Collaborators

As an application matures, classes begin to take on more and more responsibilities. Eventually a class’s main responsibility starts to become obscured. You can prevent overwhelming your classes by introducing collaborators to help them fulfill their responsibilities. In this post, we’ll look at an example of using a collaborator to prevent non-domain responsibilities from creeping