Watch Ruby as it parses your code

In this post we'll use a little-known command line flag to spy on Ruby as it parses our code.

Spying on running Ruby processes

Did you know that it's possible to log all method calls as they occur in a running process in real time? How about injecting code to be executed inside of a running process? You can – via the magic of the rbtrace gem.

Lexical scoping and Ruby class variables

In this post we'll discuss some non-obvious behavior of class variables and show how it's all the fault of lexical scoping.

Slicing and Dicing Ruby Enumerables

Have you ever needed to group items in an array, or lines in a file? In this post we'll discuss a few often-overlooked Enumerable methods that let you do just that.

Using splats to build up and tear apart arrays in Ruby

The humble splat operator (`*`) is one of those features of Ruby that just gets more interesting the more you look at it. In this post we'll talk about how you can construct and manipulate arrays with splats.

How Ruby Interprets and Runs Your Programs

In this post we'll follow the journey of a simple program as it's lexed, parsed and compiled into bytecode. We'll use the tools that Ruby gives us to spy on the interpreter every step of the way.

Understanding `self` in Ruby

A lot of problems faced by beginning Rubyists are caused by not understanding `self`. In this post we'll take a deep dive into `self` under conditions both common and uncommon.

Cool Ruby Regex Tricks

Ruby supports using regex in lots of interesting ways that go beyond the basic `String#match` method. In this post I cover a few of my favorites.

Using conditionals inside Ruby regular expressions

In this post, we'll dive into regex conditionals and discuss how to work around the limitations in Ruby's implementation of them

Benchmarking Ruby Refinements

Are refinements slow? I wrote a few benchmarks to find out. The answer was surprising.