News

Fantastic global methods in Ruby and where to find them
Many languages allow defining methods globally, which makes them available everywhere. Ruby is not different: you can define a method on the “top–level” and it behave like a global one. However, everything in Ruby is class, which means that these ...

Spin up your Hanami apps easily with Hanamismith | Hanami Mastery
I was always a fan of having an easy way to spin up scaffold rails applications with a single console command. For people like me, who test out every week a new idea, getting rid of all the manual work related to the repeatable configuration can m...




Comments for Ruby Code (Usage, Single, and Multi-Line)
Comments in your Ruby code are notes and annotations meant to be read by other programmers. The comments themselves are ignored by the Ruby interpreter, so the text inside the comments isn't subject to any restrictions.It's usually good form to pu...

Leverage Regular Instance Variable to Resolve Thread-Safety Issue on Rails ActiveRecord model
Owing to the superpowers of the Rails ActiveRecord module, developers can sometimes forget that, under the hood, our AR models are just regular Ruby objects. This allows us to make use of standard instance variables on the objects to adapt their b...

Advanced CLI tools with Ruby and dry-cli! | Hanami Mastery
Recently I watched an amazing tutorial from GoRails, made by Collin Jilbert, about writing simple ruby scripts for console tools.It was a great introduction to CLI in Ruby, and it inspired me to write a follow-up on this topic because I also use r...

Evaluating More Coverage in Ruby 3.2 - Kevin Murphy
As I mentioned in my prior post, Ruby 3.2.0 has some changes to the Coverage module. Now the module can measure the coverage of a Ruby expression in a string passed to the eval method.This is important because of templates. ERB, when we ask for th...

Gemfile of dreams: the libraries we use to build Rails apps
From time immemorial, the Evil Martians team has worked on dozens of Ruby on Rails projects every year. Naturally, this process involves a lot of Ruby gems. Some reflect our desire to be cutting-edge and to use modern tools (or build our own!) Oth...