This week I learned

Excerpts from my development journal

Week 27 published

bundle add

This week I stumbled upon the bundle add command. Byebug’s README helpfully suggests to add the gem to the Gemfile by running:

bundle add byebug --group "development, test"

I think it is a great use case for this command. Temporarily adding a debugger is something I often need to do on projects that don’t have one listed in the Gemfile. It looks like in a future version of bundler we will also be able to remove gems via bundle remove. In this context, it is also worth mentioning bundle init, which helps you start a new project with a fresh Gemfile.

Viewing WebSocket traffic with Charles

Charles is an amazingly useful tool that has saved my bacon in many different situations: regular proxying, reverse proxying, URL rewriting, DNS spoofing … This time I used it to view WebSocket traffic because it wasn’t showing up in the browser’s inspector window for some reason. The easiest way to find WebSockets from the list of connections is to enter ws:// in the Filter text field (or look for connections with the 101 status code). Viewing web socket traffic with Charles describes the process in more detail.

Screenshot of Charles showing WebSocket traffic