Jake Trent

Tag: Ruby

Ruby CLI Options Parsing

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.

Read more

Set Cookie on Rack Mock Request

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.

Read more

Permit Array in Rails Strong Parameters

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.

Read more

Exercism Review

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.

Read more

Debug Ruby and Rails

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.

Read more