Tag: Ruby

Ruby’s stdlib never ceases to amaze. If you’re making a CLI tool in Ruby, your efforts are made more straightforward by the existence of the OptionParser class. Use it, and let happiness fill your heart.

Rack apps are generally straightforward to test because of their very basic public interface. But where do we put specific things, in this case, a cookie for the request, on that env argument it takes? Here’s one way.

Rails 4 introduced the pattern of strong parameters at the controller layer. As a best practice, you will explicitly list the parameters that an endpoint should accept in payloads. Arrays are specified just slightly different.

Exercism.io is a fantastic site and tool that provides a wealth of daily code exercises. If you want to learn to be better in a language, it’s a great resource to do exercises and receive feedback.

Have you ever wished you could save a gem to your Gemfile straight from the command line? I wish Rubygems had this built in, but it’s easy to add. After all, there’s a gem for that.

Interactive debugging can sometimes be faster and more effective in helping you code than a puts statement. It’s easy to get interactive debugging in Ruby or on Rails with the help of a nice gem.