ruby
Fixing Thor’s CLI Quirks
I’ve been wanting to build a CLI in Ruby, and Thor is the obvious library to use. But Thor has some weird behaviors that were driving me crazy. Here’s what I found, and how I extended Thor to fix it.
rails
Speed up your default Rake task with the multitask -m
option
I recently discovered that Rake has the ability to run tasks in parallel. For Rails projects with many test and linting tasks, this can be a huge time-saver.
ruby
The Hidden Complexities of Running Shell Commands in Ruby
Did you know that system
supports the equivalent of > dev/null
output redirection? And that backticks raise an exception when a command isn’t found, but system
does not? Let’s go on a deep dive into the Ruby standard library!
rails
Safe redirects in Rails 7
Enforcing canonical URLs by redirecting to params
is not safe and may raise an exception. Use strong params with allow_other_host: false
for security.
mattbrictson/rails-template
App template for Rails 7 projects; best practices for TDD, security, deployment, and developer productivity. Now with optional Vite integration! ⚡️
mattbrictson/tomo
A friendly CLI for deploying Rails apps ✨