#​630 — November 24, 2022

Read on the Web 🇺🇦

Sorry for the attention grabbing subject but on this day of Thanksgiving for many, we also give thanks for a busy week of Ruby releases, from an all new JRuby to Hanami 2.0, plus improvements to good old irb

The fun doesn't stop there – we have an interview with the Pickaxe's new author. Who's that? Read on to find out.. 😉
__
Your editor, Peter Cooper

Together with  pgAnalyze

Ruby Weekly

Hanami 2.0: The Better, Faster, Stronger Web Framework — I love seeing new takes on classic concepts especially when they're actively maintained and used. Hanami is a great example and 2.0 represents a lot of work. We get a ‘blazing fast’ new router, improved app structure, type-safe app settings, and more. Want to give it a spin? Enjoy the v2 Getting Started guide.

Tim Riley

❓ If you're wondering "yes, but why should I use Hanami?" hold that thought – we've got something for you next week ;-)

Free eBook: Advanced Database Programming with Rails and Postgres — Learn about subqueries, materialized views, and custom data types in Postgres and Rails. We walk through realistic real-life examples, translating first into SQL, and then into Rails code. Every example comes with source code so you can follow along.

pganalyze sponsor

JRuby 9.4 Released, Now with Ruby 3.1 Compatibility — An understated release post for a huge release. The popular JVM-based implementation leaps up to supporting all of Ruby 3.1’s features (except ractors and the IO/lock/fiber scheduler interface). This means JRuby can now run Rails 7.

The JRuby Team

Ruby Concurrency is Hard or 'How I Became a Rails Contributor' — Concurrency is hard, but luckily the author is both brave and smart. He found an issue affecting the use of Concurrent::Hash and Concurrent::Map and came up with a fix for several popular gems (that’s true concurrency, I guess) including those in Rails. A neat story.

Maciej Mensfeld

Improving Your Rails and Ruby Versioning and Gemfile Policy — The effects of having a solid versioning policy can spread far and wide, not just to users of your projects, but to your own peace of mind. It takes work but David outlines basic steps for good versioning hygiene here.

David Bryant Copeland

QUICK BITS

Ruby 3.2's New Data Class Explained — The post accidentally says ‘Ruby 3.1’ but you’ll need to wait till Xmas Day for this feature for representing simple immutable value objects (think Struct but immutable and with several added niceties).

Swaathi Kakarla

System Notifications with Noticed and CableReady in Rails — The author of Advanced CableReady walks through how to add database, browser, email, and other notifications to a Rails app to inform users of events in real time.

Julian Rubisch

Fixed Price Monthly Code Maintenance and Upgrades for Rails Apps

reinteractive Pty Ltd sponsor

Scaling Mastodon in the Face of a Twitter Exodus — How a Mastodon (which is a Rails app) server coped with the onrush of new users in the #TwitterMigration. It boiled down to a lot of Sidekiq and database configuration that will show you a way to handle scale with Sidekiq.

Leonora Tindall

How to Ignore RuboCop Changes in git blame — You can hide refactoring commits by using .git-blame-ignore-revs

Caleb Hearth

Verifying Content-Security Policy with Selenium and Cuprite

Pawel Pacana

Shortcut Brings Product and Engineering Together. Try It for Free

Shortcut (formerly Clubhouse.io) sponsor

🛠 Code & Tools

IRB V1.5.0 Released — Ruby’s stalwart interactive REPL is always there for you and it continues to improve, too. v1.5 introduces two new commands: edit opens the file defining the thing you specify, debug runs ruby/debug from your current binding.irb breakpoint. GitHub repo.

Stan Lo on Twitter

Magnus 0.4: Ruby Bindings for Rust — If you’ve been stepping a toe into the Rusty waters, why not use it to work with Ruby? With Magnus you can write Ruby extensions in Rust or even call Ruby code from Rust itself.

Mat Sadler

og:image as a Service — Check how you can set up stunning link previews automatically on mugshotbot.com.

Mugshot Bot sponsor

The 'Pickaxe', as it's affectionately called due to the cover image, is easily the best known pure Ruby book, and probably the best selling too.

The first edition came out in 2001 as a joint effort between Dave Thomas and Andy Hunt. Future editions saw Chad Fowler come on board as co-author. A fifth edition, targeting Ruby 3.2, is now in beta form and set for final publication in 2023. We caught up with new lead author, Noel Rappin:

The 'Pickaxe' is one of the classic Ruby books and well known as a collaboration between Dave Thomas, Andy Hunt and Chad Fowler. You're now the leading author. How did that change come about?

The short version is that I asked Pragmatic about it. One of my roles at my current job is running Ruby onboarding, and when I recommended further resources, it was frustrating to keep saying "Programming Ruby is a great book but it's a little out of date".

I asked Pragmatic if they had any plans for a new version, and if not, if I could help. The CEO of the Pragmatic Press went back to the existing authors – I don't know the details of those conversations – and eventually they said they had no plans for an update but asked me to write a proposal for what a new version would entail. I did this and then there was some back and forth which eventually resulted in us signing a contract and getting started!

1.9/2.0 to 3.2 is a huge jump between editions. What's new this time taround?

Dave, Andy, and Chad wrote a great book, and the goal of this edition is to continue being a great book ten years later.

In general, the new parts of the book are related to:

  • New features, all the way up to the latest Ruby 3.2 features
  • New tooling, there's a focus on a different mix of prominent third-party tools
  • Different expectations for the experiences readers are likely to have had, so a lot of references to Perl and C++ were replaced with references to Python and JavaScript
  • Nine more years of understanding how Ruby devs use Ruby, which prompted some changes in what is considered foundational and belongs in the tutorial section and what is considered reference

With a couple of exceptions, the book doesn't specify when features were added (I find that gets confusing), so all the Ruby 3 stuff is there, but it doesn't have a "what's new in Ruby" kind of extra prominence.

How did it work having Dave Thomas as a co-author?

Dave has been in more of an advisory role (especially on the logistics, there's a lot of Ruby code that he wrote which supports the book's generation). He's given me clearance to make the changes that I think are necessary.

Are you planning to write any more books, or if not, what topic do you think could entice you back one day?

I always say each book is going to be my last. But I've taken on a second role as Ruby series editor for Pragmatic, so I'm helping other people who want to write about Ruby create their pitches. People should definitely reach out to me if they have a Ruby book idea.

Noel has a personal site at noelrappin.com, tweets @noelrap, and wants you to know that Programming Ruby 3.2 is currently on Thanksgiving sale (in beta form) with 40% off if you use the code turkeysale2022 by November 29.

🐦 SEEN ON THE TWITTERS

If you like all things Ruby on Twitter, the Short Ruby newsletter (no relation) has a lot more where that came from.

Jobs

Find Ruby Jobs Through Hired — Create a profile on Hired to connect with hiring managers at growing startups and Fortune 500 companies. It's free for job-seekers.
Hired

Senior Ruby Developer — Join a dynamic and collaborative team working remotely (EST) or hybrid (Montreal-based startup).
Potloc