Short Ruby Newsletter

Share this post

Short Ruby News - Edition #27

newsletter.shortruby.com

Short Ruby News - Edition #27

Briefly about everything happening in Ruby world - week 4 of 2023

Lucian Ghinda
Jan 30
3
Share this post

Short Ruby News - Edition #27

newsletter.shortruby.com

Jump directly to a section:

๐Ÿ‘ย Our Community

๐Ÿ‘‰ย All about Code and Ruby

๐Ÿงฐย Gems, Libraries, and Updates

๐Ÿคย Related (but not Ruby-specific)

More content: ๐ŸŽฅ ๐ŸŽง ๐Ÿ—žย (articles, podcasts, videos, and newsletters)


You can support keeping this newsletter free and sustainable for ~1.5$ per week (actually 6.5$/month) if you can afford it:

Support the newsletter for 1.5$/week

Read Why subscribe to a paid plan for a longer explanation.


๐Ÿ‘ Our Community

๐Ÿ‘ I was invited to the Rubber Duck Dev Show to talk about Short Ruby Newsletter.

source: Rubber Duck Dev Show - episode 71

๐ŸŽง Listen to the conversation on The Rubber Duck Dev Show - episode 71

๐Ÿ‘ Noel Rappin shared they published an update for Programming Ruby 5th edition:

Source: @noelrap@ruby.social

๐Ÿ‘ Brighton Ruby Conference shared buying tickets are available now:

Source: @brightonruby@ruby.social

๐Ÿ‘ Mario shared a new conference Helvetic Ruby in Switzerland in Europe:

Source: @marioschuettel@ruby.social

Follow @helvetic_ruby@ruby.social to receive updates about the conference.

๐Ÿ‘ Aaron Patterson started a Ruby Glossary:

Source: @tenderlove@mastodon.social

๐Ÿ‘ The Rubber Duck Dev Showย stated that Rails 7.1 would be a giant leap:

Source:ย @duckiedevshow

Add to this something that Andrew Culver shared previously:

Source: @andrewculver

Or this perspective shared by Cezar Halmagean:

Source:ย @chalmagean

๐Ÿ‘‰ All about Code and Ruby

๐Ÿ‘‰ Joel Drapper started a conversation by asking:

Source: @joeldrapper@ruby.social

He shared more details about the problem he was trying to solve:

Source: @joeldrapper@ruby.social

And then Benoit Daloze answered with:

Source: @eregon@ruby.social

If you are interested in this, you should read the entire conversation (elk.zone link)

๐Ÿ‘‰ Tom Stuart shared a piece of code showing a Zeitwerk fork created by Chris Salzberg that can do autoload in namespaces:

Source: @tom@ruby.social

Ryan Davis replied with an example showing how to use Kernel#load to achieve something similar:

Source: @zenspider@ruby.social

๐Ÿ‘‰ Joel Drapper shared why it is good to have a `call` method because it plays nice with procs, lambdas, and methods:

Source: @joeldrapper@ruby.social

๐Ÿ‘‰ Pascal Lalibertรฉ shared a funny take about the Nil object in Ruby:

Source: @pascallaliberte@ruby.social

๐Ÿ‘‰ Aaron Patterson shared they implemented Red Black Tree in Ruby, making use of pattern matching:

Source: @tenderlove@mastodon.social

Here are two short snippets from the code gist he shared:

Source: gist.github.com/tenderlove
Source: gist.github.com/tenderlove

๐Ÿ‘‰ Joel Drapper shared a downside of using string-based templating:

He also replied with two possible solutions:

Source: joeldrapper@ruby.social

๐Ÿ‘‰ Tom Stuart shared a worry about missing default implementation for Object#deconstruct_keys:

Source: @tom@ruby.social

He linked to a discussion (now closed) on the Ruby tracker

๐Ÿ‘‰ Simon George shared a code sample about using to_proc to map a list of data with objects:

Source: @sfcgeorge@ruby.social

deSilva replied with an alternative:

Source: @aesthetikx@ruby.social

๐Ÿ‘‰ Denis Defreyne shared a take about simple Service Objects that can be replaced with just a method:

Source: @denis@ruby.social

๐Ÿ‘‰ Paul Mucur shared a code sample showing how they used pattern matching:

Source: @mudge@ruby.social

๐Ÿ‘‰ Lucian Ghinda started a discussion on ruby.social and twitter about using `and`:

Source: @lucian@ruby.social

There are a lot of nice replies and proposals on both threads. Here are some of them:

Source: @ada_shen@hachyderm.io
Source: @ada_shen@hachyderm.io
Source: @gregnavis

On the same topic about using `and` and `or` in control flow and see some helpful code samples, here are two resources to read:

  • Unban and and or control flow operators PR by Victor Shepelev in Ruby-style-guide

  • This blog post from Victor Shepelev about Good Ruby Idiom: and/or operators

๐Ÿ‘‰ Lucian Ghinda shared a code sample showing that endless methods donโ€™t work with `and`:

Source: @lucianghinda

๐Ÿ‘‰Dorianย shared a short code sample showing how to reset loaded records from the association:

Source: @dorianmariefr

๐Ÿ‘‰Josef Strzibnyย sharedย a short code sample and explanation about changing the ActiveRecord group when needed:

Source:ย @strzibnyj

๐Ÿ‘‰ Jorge Manrubia shared some code snippets from Hey where he implemented memoization:

Source: @jorgemanru

In the same conversation Xavier Noria shares a link to a minitest-focus code where they implemented `focus` keyword as a kind of โ€œdecoratorโ€ that can be defined above the method to be focused:

Source: seattlerb/minitest-focus

With this, the following code will work:

Source: settlerb/minitest-focus

๐Ÿ‘‰Eric Berryย shared a code sample that helps access instances of models for development purposes:

Source:ย @coderberry

๐Ÿ‘‰Josef Strzibnyย shared a thread about how to work with localization in Ruby on Rails:

Source:ย @strzibnyj

๐Ÿ‘‰Janko Marohniฤ‡ย shared an essential perspective about Devise

Source:ย @jankomarohnic

He then added a link to a podcast with the previous Devise maintainer:

Source: @jankomarohnic

On the other side, there is a tweet from Carlos Antonio (one of the Heartcombo maintainers) sharing this:

Source: @cantoniodasilva

In case you are looking for alternatives there were shared the following:

  • rodauth-rails by Janko Marohnic

  • authentication-zero by Lazaro Nixon

  • rails-authentication-from-scratch guide by Steve Polito

๐Ÿ‘‰ ใƒใ‚ณใƒšใƒƒใ‚ฏใƒใ‚คใƒˆย shared how to think about the performance of iterating over objects in Ruby:

Source:ย @nateberkopec_ja

๐Ÿ‘‰ Steve Politoย shared that Rails provides a way to eager load an association while limiting its result set:

Source:ย @stevepolitodsgn

๐Ÿ‘‰ Wiktor Plaga shared a piece of code showing how to use Symbol#with

Source: /u/wplaga

๐Ÿ‘‰ Alohamori shared in a comment on Reddit some code samples about using implicit parameters and rightward assignment:

source: /u/Alohamori

If you have read so far and you like the content, maybe you take into consideration sharing this and subscribing:


๐Ÿงฐ Gems, Libraries, and Updates

๐Ÿงฐ Caleb Hearth published a new gem called mentionable that will implement Webmention (โ€œWebmention is a simple way to notify any URL when you mention it on your siteโ€):

Source: calebhearth/mentionable

You can see an example of how to use it in the article he published This Gem is Mentionable

๐Ÿงฐ Joel Drapper announced a new release of Phlex.fun version 1.2. Read the highlights of this release

๐Ÿงฐ Bozhidar Batsovย announced they released a new version of Rubocop:ย Release RuboCop 1.44 ยท rubocop/rubocop

๐Ÿงฐ Greg Navisย announcedย their gem now reached version 1.0.0 gregnavis/transient_record

๐Ÿงฐ Marco Rothย shared a new npm package called current.js that works well with Rails Current Attributes

Source:ย @marcoroth_

๐Ÿงฐ Samuel Williamsย shared that the latest release of webrick supports full bidirectional streaming:ย Better support for connection upgrade and bi-directional streaming

๐Ÿงฐ Ruby Lib Huntย sharedย the open-source repository for OpenStreetMap Website

๐Ÿงฐ Hearcombo shared they released version 5.2.0 for SimpleForm gem with support for Rails 7 and Ruby 3.2

๐Ÿงฐ Karol Bฤ…k announced they made public the repository for shinygems.dev which can be found at kukicola/shiny_gems - it is a Hanami 2 app.

๐Ÿค Related (but not Ruby-specific)

๐Ÿค Andreas Klinger shared a lovely quote about new ideas:

Source:ย @andreasklinger

๐Ÿค Dave Paolaย shared a thread about hiring juniors:

Source:ย @dpaola2

You should read the thread. Here is one thing I selected from it:

Source: @dpaola2

๐Ÿค Rose Wย shared great advice about pursuing objectives:

Source:ย @rose_w

๐Ÿค Greg Brockmanย shared an insight about velocity:

Source:ย @gdb

More content: ๐ŸŽฅ ๐ŸŽง ๐Ÿ—ž

Newsletters

๐Ÿ—ž Joe Masilotti published a new edition of Hotwire dev newsletter - edition 21

๐Ÿ—žGreg Molnarย shared a new edition of This Week in Rails is out:ย New AssumeSSL middleware, raise on missing translations everywhere, and more

๐Ÿ—ž๏ธย Ruby Weeklyย published a new edition:ย Packing a Ruby 3.1 app into an executable

๐Ÿ—ž๏ธย Ruby LibHuntย published a new edition of theย Awesome Ruby Newsletter

๐Ÿ—ž Ruby Radar published a new edition Ruby Radar #87 - Brighton on the Horizon

Podcasts

๐ŸŽง Andy Croll published a new episode of Chats in the Cupboard: Back into People Management

๐ŸŽง FullStack Ruby published a new episode about Hotwiring Multi-Platform Rails Apps with Ayush Newatia

๐ŸŽง Brittany Martinย shared a special episode of The Ruby on Rails Podcast with the entire Hanami team: Rubyconf @ Home: Hanami Core Team

๐ŸŽง Jason Swettย published a new episodeย 172 - Collin Jilbert, Developer at GoRails - The Code with Jason Podcast

๐ŸŽง Ruby For Allย published a new episode aboutย Common Pitfalls for Junior Ruby on Rails Developers | Ruby for All | Episode 27

Videos

Talks

๐Ÿ“ฝ๏ธ Jason Swettย published two episodes from Code with Jason meetup:

  • Member Code Review (2023-01-19)

  • How to keep Rails controllers organised (2023-01-26)

๐Ÿ“ฝ๏ธ Drifting Rubyย shared their video version ofย This Week in Rails - Jan 27th, 2023

Screencasts

๐ŸŽฅ Hanami Mastery published a new screencast about HTML from markdown made simple!

๐ŸŽฅ Drifting Rubyย published a new episodeย Episode 385 - Zipping Files | Drifting Ruby

๐ŸŽฅ Deaninย published a new video aboutย ChatGPT Helped Me Make An OpenAI | Ruby On Rails 7 Tutorial

๐ŸŽฅ Matt Swansonย shared a video on Twitter about how to build a tiny Rails helper to display Twitter-style metrics like "1.2K โค๏ธ" or "12.7K followers"

๐ŸŽฅ Cezar Halmageanย shared a quick video on Twitter showing a quick vim + rubocop tip.

๐ŸŽฅ Janko Marohnic shared a live stream showing how to integrate WebAuthn into Rails with Rodauth

๐ŸŽฅ Deaninย published a new episode aboutย This New Devise API Gem Makes User Auth So Simple! | Ruby On Rails 7 Tutorial

Articles

Whatโ€™s new

Emmanuel Hayford published the 3rd part of his series about Ruby on Rails 7.1: An Overview Of Ruby on Rails 7.1 Features. Part III.

How-Tos

  • Hunter Johnson published an article about What are Materialized Views? A 5-Minute Introduction

  • Caleb Hearth published an article showing how to use mentionable gem to get mentions from web: This Gem is Mentionable

  • Rails Linksย shared an article about how to configureย Dokku: the best way to host personal projects

  • Julija Alieckajaย published an article aboutย Unleashing the Power of Fibers for Background Jobs

  • The Ruby Devย shared an article aboutย Creating a secure API architecture in Rails with few example

Deep Dives

  • Jake Zimmerman published an article about Problems typing equality in Ruby

  • Davide Santangeloย sharedย an article about My Adventure With Async Ruby

More general

  • Steve Sewell published an article about Optimal Images in HTML


Thanks for reading Short Ruby Newsletter! If you enjoyed this and want to receive the newsletter weekly in your inbox, consider subscribing:

Share this post

Short Ruby News - Edition #27

newsletter.shortruby.com
Previous
Next
Comments
TopNewCommunity

No posts

Ready for more?

ยฉ 2023 Lucian Ghinda
Privacy โˆ™ Terms โˆ™ Collection notice
Start WritingGet the app
Substackย is the home for great writing