Menu Sidebar
Menu

Ruby

Dotenv for multiple environments

Lately I’ve been handling configuration entirely through environment variables for my apps, as the 12 Factor App recommends, and I can’t recommend this approach enough. As a constraint it helps me think about what parts of a given app actually need to vary from environment to environment, as opposed to what parts could potentially vary. The app I’m working […]

Exception Causes in Ruby 2.1

Sometimes when rescuing an exception in Ruby, it’s useful to handle the error scenario by raising another, different exception. As an example, we may want to add domain-specific failure information before passing the error on to client code. begin # … rescue KeyError raise MyLib::Error, “Bad key: #{key}. Valid keys are: #{valid_keys}” end The trouble […]

Newer Posts
Older Posts

Virtuous Code

"The three virtues of a programmer: laziness, impatience, and hubris" — Larry Wall

Books and Screencasts

RubyTapas Screencasts

RubyTapas Screencasts

Small plates of gourmet Ruby code.

Confident Ruby

Confident Ruby cover

32 Patterns for joyful coding.

The Making of Cowsays.com

Confident Ruby cover

Watch me build an app in Sinatra and Rails

Objects on Rails

Objects on Rails

A developer notebook on applying classic Object-Oriented principles to Ruby on Rails projects.

Exceptional Ruby

Exceptional Ruby

The definitive guide to exceptions and failure handling in Ruby.

Archives

Categories