Tutorials


Testing anti-pattern: accessing private properties - Code with Jason
The point of private properties on an object, like private methods and private instance variables, is so you know what you can safely refactor without having to worry that you’re going to mess up some external client that uses that object.Ruby pro...

A trick for invariant generics in Sorbet – Jake Zimmerman
There’s a neat trick for using generic methods to get around some of the limitations that invariant type members in generic classes carry.The problem I’m trying to solve:Sometimes my generic class (say, Box) needs a type_member (say, Elem) to be i...

Why Ruby’s Timeout is dangerous (and Thread.raise is terrifying)
This is already documented in Timeout: Ruby’s most dangerous API. And normally I don’t like making blanket statements about language features. But I had a bad day at work because of this issue. So today, we’re talking about Timeout! :)First! What ...





Bundler Auto-Install Just Got A Whole Lot Better - RubyGems Blog
Working in a large monolith with many engineers, you never fail to get a flurry of changes everytime you pull from main. Then you have the typical ritual of running bundle install and, if you’re on a Rails application, rails db:prepare. Sometimes,...

Ruby function design and other stuff I like ranting about - DEV Community
Why? If the posts title looks weird: it is. This is a small rant about code-functionality... Tagged with ruby, watercoolerI was talking to a coworker about getting the numerical value of a character, like you can in Java, because a char stores t...