Contributions
Article
Rails 8 has introduced a generator for adding basic authentication code to Rails apps. I took it for a spin and found out it doesn't generate a registration page! [Read more about my impressions of the Rails authentication generator and notes on adding a registrations endpoint](https://nithinbekal.com/posts/rails-8-auth/).
Tutorial
Last week, I came across a few small improvements that I could make to the Ruby docs. In the past, I’ve found the idea of contributing to the Ruby repo quite daunting, but I found that it’s actually pretty straightforward. Here’s a quick how-to about how to get started with contributing to Ruby documentation.
Article
Ruby’s NotImplementedError exception is often used as a placeholder in abstract classes for methods that should be implemented by subclasses. But did you know that this is not how this exception class was intended to be used?
Article
Here’s a little Ruby puzzle. Imagine you have a Value class that wraps a number, and implements numeric operations. How would you go about implementing the class in a way that lets you do something like 2 + Value.new(3) and returns Value.new(5)? Read on to find out.
Article
We’re only a week away from a new release of Ruby. Here’s a look at what to expect from Ruby 3.3.
Article
In Ruby, method names can be suffixed with !. These are often called “bang” methods. This is used to indicate that it is a dangerous counterpart of the non-bang version of the method.
I had always thought of “dangerous” to mean that the method mutates the underlying object and returns that object. However, these methods can differ from their non-bang versions in other subtle ways, which surprised me recently.
I had always thought of “dangerous” to mean that the method mutates the underlying object and returns that object. However, these methods can differ from their non-bang versions in other subtle ways, which surprised me recently.
Tutorial
Does Ruby have something similar to Jupyter notebooks? Turns out that you can just use Jupyter notebooks with Ruby if you setup the iruby kernel. This kernel is available as a gem, and the setup is really simple.
Tutorial
Sorbet is a static type checker for Ruby. In this post, we will walk though how we can add sorbet to a new Rails app. Along the way, we will also see a few examples of how sorbet can help you identify and fix bugs in your code.