πŸ‘‹ Short Ruby News - edition #23

Briefly about everything in Ruby world

This edition was created with the help of Adrian Marin from Avo for Ruby on Rails (a friendly full-featured Rails admin panel) and Jakob CosoroabΔƒ.

You can jump directly to one of the following sections if you like:

πŸ‘ Our Community

More content: πŸŽ₯ 🎧 πŸ—ž (articles, podcasts, videos, slides, and newsletters)

πŸ‘ Our Community

πŸ‘ Yukihiro Matz shared a link to the YJIT Benchmarks website:

πŸ‘ Mark Mayo announced they are willing to support a Rails dev to implement some auth improvements for Mastodon:

πŸ‘ Le Wagon MontrΓ©al shared an online free event they are organizing about Landing your first rails job - with Joe Masilotti

πŸ‘ Ayush launched the full book The Rails and Hotwire Codex

πŸ‘‰Ruby For All asked the community some questions and it would be great if we can help them and answer them:

πŸ‘ Rails Girls The Netherlands announced they are organising a new edition of Rails Girls NL

πŸ‘ Brandon Weaver announced voting on rubylearning.dev to choose the next course:

πŸ‘‰ All about Code and Ruby

πŸ‘‰ Nate Hopkins shared a Replit to play with toggle reflex behavior Replit

Here's a simple replit demo where you can try out the `toggle` Reflex Behavior and its devtool. Let me know if it's working for you and what your first impressions are.

πŸ‘‰ Emmanuel Hayford shared a Rails 7.1 tip for keeping log files from taking over disk space:

Rails logs files are unchecked: they can grow to whatever size imaginable. Not anymore, there's a new config option in Rails to keep log files from taking over disk space!

πŸ‘‰ Stan Lo shared the difference between REPL and a debugger:

πŸ‘‰ Greg Navis shared a code sample showing how to build URI in Ruby:

If you want to change the protocol, you need to use a different class. For example, to change to HTTPS use URI::HTTPS. It's NOT only a matter of the scheme in the URI (the part before ://), but also default port numbers.

πŸ‘‰ Kirill Shevchenko shared a code sample showing how to use Rails explain to debug slow queries:

The first thing that comes to mind when we talk about debugging slow SQL is EXPLAIN query. It's a great way to get a detailed breakdown of a database query. ActiveRecord provides an explain method that you can simply add to the end of your query to debug it.

πŸ‘‰ Scott Watermasyk shared why Phlex.fun could be a good choice:

πŸ‘‰ Emmanuel Hayford shared a Rails command to show unused routes (coming in Rails 7.1):

πŸ‘‰ Postmodern started a good discussion about where we can use Ruby for rapid prototyping:

There is a good discussion about how to distribute Ruby as a step for use in other areas (like CLI apps, for example).

πŸ‘‰ Greg Navis shared an example of using whitespace and comments inside the Regexp:

⚠️ Don't use that regexp to validate emails. It's only a contrived example. Compare the before and after for the regexp: it's longer, but also easier to parse (for humans) and there are comments explaining the intent behind it It gets even better on more complex regexps!

It seems like the proposed change will be:

You can read the discussion about this feature in the Ruby issue tracker

πŸ‘‰JoΓ«l Quenneville shared a nice piece of code showing the readability of case instead of nested ifs:

πŸ‘‰ Greg Navis shared aRails tip to use invert_where

πŸ‘‰Kirill Shevchenko shared a code sample showing how to use TracePoint to track the code call stack:

πŸ‘‰Greg Navis shared a thread exploring various query performance in Rails:

πŸ‘‰ Andrew Atkinson asked about what PostgreSQL topics are missing:

There are a lot of good replies. Andrew summarized them in an article on their blog:

πŸ‘‰Jeremy Smith shared a piece of code about how to remove Active Storage attachments:

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

🧰 Gems, Libraries, and Updates

🧰 Brad Gessler shared the release of Sitepress 4.0. You can see how this is used to power Joe Masilotti blog in this Github repo

🧰 Joel Drapper shared a new release of literal_enums 2.0

🧰 Seth shared a new gem called fruit_juice:

FruitJuice is a job enqueuing adapter for the mosquito background job processor written in Crystal. If you're here to find out how to enqueue background jobs from Ruby/Rails and have them processed in Crystal, you've come to the right place!

🧰 Greg Molnar published a new gem called prepper:

Prepper is a simple server provisioning tool, built on top of SSHKit. You can use it to script your server build process.

🧰 Janko MarohniΔ‡ shared that rodauth-rail will support tailwind:

🀝 Related (but not Ruby-specific)

🀝 Drew Bragg shared a piece of learning about design decisions:

Sometimes we made the best design decision we could at the time, with the information we had, and only now realize it was wrong and that's ok. The key is to owe it and correct the direction of your code. Not support it with more bad decisions out of fear of being "wrong".

🀝Ryan Bates shared a metaphor about building software:

Software development is like casting a 3D object onto a 2D plain. Attempting to model every aspect of a complex domain can become a mess. First choose an angle and build a beautiful representation of the domain that is intentionally limited for the software medium.

🀝Dan Koe shared a nice image showing the difference between focused work and distracted work:

4 hours of focused work is better than 8 hours of distracted work. My 10 commandments of The 4 Hour Workday

🀝 Miron Marczuk shared a thread about how to grow to senior level:

There are a lot of good points in the thread. I am adding here only two of them that talks about senior skills:

🀝 Jason Swett shared an advice to focus on environment:

🀝 Nate Hopkins shared a nice way of looking at Best Practices:

🀝 Nate Berkopec shared a piece of wisdom about processes and failure:

"Someone made a mistake" is not a root cause. "This process allowed this person to make a mistake" is a root cause.

More content: πŸŽ₯ 🎧 πŸ—ž

Slides

Yukihiro Matz shared the slides from Noah Gibbs presentation at RubyConfTh: YJIT Resources

Newsletter

πŸ—ž Women on Rails published a new edition of their International Newsletter #41

πŸ—ž Ruby Radar published a new edition: Ruby Radar #81

πŸ—žοΈ Ruby Weekly published a new edition: Ten days till Ruby 3.2..

πŸ—žοΈ Ruby LibHunt published a new edition of the Awesome Ruby Newsletter

Podcasts

Videos

πŸŽ₯ CJ Avilla shared a series of videos solving Advent of Code 2022 with Ruby:

You can check the entire list in the videos section on his website

πŸŽ₯ Avdi Grimm shared the first episode of RubyTapas Binary Literals in Ruby

Articles

Jason Charnes shared a new article they wrote about Rails’ safety mechanisms

Adrian Marin shared an article about how to Sort a Ruby array

Kevin Newton continued to write Advent of YARV:

Scott Watermasysk shared a short article about Rails and Docker

Ryan Garver shared an article written by Avdi Grimm about Mastodon: Zero to Green Tests Locally

Reply

or to participate.