Short Ruby Newsletter

Share this post

πŸ‘‹ Short Ruby News - Edition #43

newsletter.shortruby.com

πŸ‘‹ Short Ruby News - Edition #43

Discover the world of Ruby in this comprehensive newsletter covering week 20 of 2023. Find code samples, community updates, gems, resources, and thought-provoking discussions.

Lucian Ghinda (from ShortRuby)
May 22, 2023
2
Share

You can 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, newsletters, and books).


  1. The newsletter is now back to one single email sent. Read here more about this decision. TLDR: both the poll results and the stats from the newsletter show that the two newsletter format was not working correctly, while the majority prefers one email. Thus this edition contains the More Content section inside this edition as before. I will continue to publish the expanded content edition only on the web.

  2. All images are clickable. You can click on the image if you want to read the original source (article, tweet, video…).


πŸ’Έ For only $1.5 per week (just $6.5 a month), you can become a paid subscriber and contribute to the success of the flourishing Ruby community we all adore!

Support the newsletter for ~1.5$/week


πŸ‘ Our Community

πŸ‘ Friendly.RbΒ announced a new speaker, see friendlyrb.com for more details

Source:Β @friendlyrb@ruby.social

πŸ‘ Dave CopelandΒ shared reasons why Rails and Ruby are great:

Source:Β @davetron5000@ruby.social

And here are what other people added:

Source:Β @bensheldon@ruby.social
Source:Β @meesterfox@ruby.social

πŸ‘ Ruby For GoodΒ announcedΒ that registrations are open for the event in July at rubyforgood.org/events

Source:Β @RubyforGood

πŸ‘ IanΒ announced an update for the Β alterisian.github.io/helloworld website:

Source:Β @alterisian

πŸ‘ Dave PaolaΒ shared feedback from a recent applicant:

Source:Β @dpaola2

Here are some of the replies:

Source:Β @MichaelDChaney
Source:Β @KenOsigie
Source:Β @rockatanescu
Source:Β @AmandaBPerino
Source:Β @kcdragon_

There are many replies to Dave's tweet that I recommend you read.

πŸ‘ On the same topic, GomezΒ shared about how they use Ruby on Rails at PlanetScale:

Source:Β @no_itsbackpack

πŸ‘‰ All about Code and Ruby

πŸ‘‰ wiki.nikiv.dev/programming-languages/ruby is an extensive wiki created by Nikita with many resources for learning or deep diving into Ruby. Here is a screenshot with just a tiny part of all the resources:

Source: https://wiki.nikiv.dev/programming-languages/ruby

There is a similar wiki about Rails maintained by the same author.

πŸ‘‰ Noah GibbsΒ shared about code and the choices we have to make between them.

Source:Β @codefolio@ruby.social

This triggered a lot of replies. Please read them directly, as there is a good but healthy debate.

Here are just some of the replies in a random order. This seems to me a sensible topic for our community, so please read the other replies for context:

Source:Β @codefolio@ruby.social
Source:Β @tenderlove@ruby.social
Source:Β @searls@ruby.social
Source:Β @joeldrapper@ruby.social
Source:Β @samsaffron@ruby.social (Link for ruby-syntax-tree)
Source:Β @Schneems@ruby.social

Other links mentioned in the replies: GoodCop and Relaxed Ruby Style.

πŸ‘‰ Paul MucurΒ shared a TIL aboutΒ create_or_find_by:

Source:Β @mudge@ruby.social

πŸ‘‰ Ben Sheldon (He/Him)Β shared two learning points about Regexp and a code sample showing Ruby 3.2 Regexp timeout:

Source:Β @bensheldon@ruby.social

πŸ‘‰BenoitΒ sharedΒ a code sample showing how to display PSQL style tables in Rails console. Check the gist at PSQL table in Rails console

Source:Β @benoit@ruby.social

πŸ‘‰ Brandon WeaverΒ asked a question about reducing the processing of requests for assets by Webmock with VCR:

Source:Β @baweaver@ruby.social

Olivier LacanΒ replied with the link toΒ Ignore Request for VCR. You might also want to read the analysis Brandon WeaverΒ added in this issue opened on webmock gem: Performance of `WebMock::Util::Headers.normalize_headers` Β· Issue #1027

πŸ‘‰Kay RhodesΒ shared a tip about how to fix a MySQL gem error:

Source:Β @masukomi@ruby.social

As a valued reader, your support is crucial for this publication to continue providing new posts. By becoming a subscriber, whether free or paid, you not only receive the ad-free version but also contribute to the sustainability of my work


πŸ‘‰ Takashi KokubunΒ shared what the current purpose of RJIT is:

Source:Β @k0kubun@ruby.social

πŸ‘‰ Prabin PoudelΒ shared about deployment options:

Source: @coolprobn

Among the replies:

  • Capistrano

  • Heroku

  • MRSK

  • Custom Bash scripts with Docker Swarm

  • Hatchbox

πŸ‘‰ Ruby CademyΒ shared a code sample showing how to use Object#tap (that Ruby 3.2 seems to be defined at Kernel#tap vs in Ruby 2.7 being at Object#tap):

Source:Β @RubyCademy

πŸ‘‰Alexandre RubanΒ asked a question about SRP on an Active Model has over 70 attributes:

Source:Β @alexandre_ruban

Matt SwansonΒ replied with:

Source:Β @_swanson

πŸ‘‰ Brad GesslerΒ shared a code sample showing a form builder:

Source:Β @bradgessler

πŸ‘‰ Adrian MarinΒ asked a question about integration StimulusReflex with Hotwire:

Source:Β @adrianthedev

Marco RothΒ clarified this:

Source:Β @marcoroth_

πŸ‘‰AhmedΒ shared a code sample showing how to use metaprogramming to define methods:

Source:Β @rockweII_

πŸ‘‰ Xavier NoriaΒ shared a code sample about the break keyword used in loops:

Source:Β @fxn

πŸ‘‰ Josef StrzibnyΒ shared a thread with gems recommendations:

Source:Β @strzibnyj

Here are the recommended gems:

  • vessel - β€œhigh-level web crawling framework”

  • mapkick - β€œCreate beautiful JavaScript maps with one line of Ruby. No more fighting with mapping libraries”

  • simple_calendar - β€œSimple Calendar is designed to do one thing well: render a calendar”

  • business_time - business hours math

  • heya - β€œHeya is a campaign mailer for Rails. Think of it like ActionMailer, but for timed email sequences. It can also perform other actions like sending a text message”

  • noticed - β€œNotifications for your Ruby on Rails app”

  • chartkick - β€œCreate beautiful JavaScript charts with one line of Ruby”

  • blind_index - β€œSecurely search encrypted database fields”

  • split - β€œSplit is a rack based A/B testing framework designed to work with Rails, Sinatra or any other rack based app”

  • store_attribute - β€œActiveRecord extension which adds typecasting to store accessors”

  • logidze - β€œLogidze provides tools for logging DB records changes when using PostgreSQL”

  • discard - β€œSoft deletes for ActiveRecord done right”

  • counter_culture - β€œTurbo-charged counter caches for your Rails app”

  • pretender - β€œAs an admin, there are times you want to see exactly what another user sees”

  • secure_headers - β€œThe gem will automatically apply several headers that are related to security”

  • ahoy - β€œSimple, powerful, first-party analytics for Rails”

  • blazer - β€œExplore your data with SQL. Easily create charts and dashboards, and share them with your team”

  • i18n-tasks - β€œi18n-tasks helps you find and manage missing and unused translations”

  • instant18n - β€œUse OpenAI's GPT large-language model to power internationalization of the text in your Rails application”

  • jsonb_accessor - β€œAdds typed jsonb backed fields as first class citizens to your ActiveRecord models”

  • invoice_printer - β€œSuper simple PDF invoicing.Β InvoicePrinter is a server, command line program and pure Ruby library to generate PDF invoices in no time. You can use Ruby or JSON as the invoice representation to build the final PDF”

πŸ‘‰ Brad GesslerΒ shared a thread about batch resource manipulation. Here are the first two tweets from the thread:

Source:Β @bradgessler
Source:Β @bradgessler

πŸ‘‰ CraigΒ shared a list of shortcuts they use when programming in Rails:

Source:Β @JalisoCSP

πŸ‘‰Colleen SchnettlerΒ asked for recommendations of Rails CMS:

Source:Β @leenyburger

Here are some of the recommendations:

  • Sitepress (Ruby)

  • Bridgetown (Ruby)

  • Avo (Ruby)

  • AlchemyCMS (Ruby)

  • Middleman (Ruby) - check out also this repo for Middleman 4 + Tailwind CSS

  • Jekyll (Ruby)

  • SpinalCMS (Ruby)

πŸ‘‰ Ruby CademyΒ shared a code sample about using Rails ActiveSupport::CurrentAttributes

Source:Β @RubyCademy

πŸ‘‰ Xavier NoriaΒ shared a thread about β€œreloading” naming:

Source:Β @fxn

He explain further about what happens in Ruby:

That indeed happens if you have reloading and eager loading enabled, a possible but rare combination.

In the app lazy loads, "reloading" only "unloads", really. That is the nuance. Unloaded classes are not loaded again during that operation.

You'll load what you use, on demand.

"Unloading" is also an abuse of language: Ruby has no way to unload code.

"Unloading" means `remove_const` autoloaded constants.

However, if the app is correct, the objects they stored will become unreachable and eventually GCed.

So, in that sense, this one is good enough.


🀞 I imagine that if you have read this so far, you find value in this newsletter.

This is a free publication that relies on the support of its readers. If you'd like to stay updated on new posts and help me continue my work, please consider subscribing for free or choosing a paid subscription.


🧰 Gems, Libraries, and Updates

🧰 Dmitry Tsepelev announced a new gem rubocop_director: Plan your refactorings properly

Source: https://github.com/DmitryTsepelev/rubocop_director

🧰 Dima Fatko announced a new gem pluck_in_batches: A faster alternative to the custom use of `in_batches` with `pluck`

Source:Β @fatkodima

🧰 Nick Schwaderer announced a new gem chat_gpt_error_handler:

Source: https://github.com/Schwad/chat_gpt_error_handler

🧰 Okura Masafumi launched a new gem okuramasafumi/niwa: New, Integrated, Working Annotations

Source:Β @okuramasafumi@ruby.social

🧰 Mike Dalessio announced the release of version 1.15.0 of nokogiri Read the release notes

Source: https://github.com/sparklemotion/nokogiri/releases/tag/v1.15.0

🧰 Mike Dalessio announced the release of version 1.6.3 of the sqlite3-ruby gem Read the release notes

🧰 PaweΕ‚ UrbanekΒ published a new gemΒ rails-brotli-cache: Rails cache using Brotli algorithm offers better compression and performance

Source: https://github.com/pawurb/rails-brotli-cache

🧰 Yuta Saito announced they release version 2.0.0 of ruby.wasm Read release notes

Source: https://github.com/ruby/ruby.wasm/releases/tag/2.0.0

🧰 Ivo Herweijer published a new benchmark for Roda that now includes Ruby 3.3 preview1:

Source: https://github.com/easydatawarehousing/ruby_measure_responsetime/blob/main/data/rodauth330preview/README.md

🧰 Atsushi Tatsuma published a new gem llama_cpp - provides Ruby bindings for the llama.cpp

Source: https://github.com/yoshoku/llama_cpp.rb

Please consider becoming a paid subscriber to support this newsletter for just $1.5/week ($6.5/month). Your contribution aids growth and maintains the quality of ShortRuby for everybody:

Support the newsletter for ~1.5$/week

If you consider upgrading and want more information, please read Why to subscribe to paid


🀝 Related (but not Ruby-specific)

🀝 Benoit shared an SQL to simulate a slow SQL update in PostgreSQL:

Source:Β @benoit@ruby.social

🀝 Nate Berkopec shared a reminder to check resources if they are over provisioned:

Source:Β @nateberkopec@ruby.social

🀝 Chris Wanstrath shared a thread about the early days of Github and keeping it profitable:

Source:Β @defunkt

More content: πŸ“š πŸ—ž 🎧 πŸŽ₯ ✍🏾

In case you want to read the More Content version with articles previews read it on web here

πŸ“š Books

πŸ“š Noel RappinΒ announced thatΒ Programming Ruby 3.2 (5th Edition) is now draft-complete

πŸ—ž Newsletters

πŸ—žοΈΒ Ruby WeeklyΒ published a new edition:Β Ruby 3.3 makes its first appearance

πŸ—žVipul A MΒ published a new edition ofΒ This Week in Rails about Rails World CFP, ActiveRecord.disconnect_all!, optimized where query and more!

πŸ—ž Greg MolnarΒ published a new edition of Rails TricksΒ about Shared examples with Minitest - Rails Tricks Issue 7

πŸ—žοΈΒ Ruby Libhunt published a new edition of Awesome Ruby Newsletter - Issue 365

πŸ—žοΈ Ruby Radar published a new edition about Spilling Beans

🎧 Podcasts

🎧Rooftop Ruby published a new episode about 13: Open Source and More With Marco Roth

🎧Code And The Coding Coders Who Code It published a new episode about Episode 21 - Nick Schwaderer

🎧 Indie Rails published a new episode about Pascal Laliberté - 6 things to avoid as a freelancer

🎧 Remote Ruby published a new episode about Railsconf Recap | Remote Ruby | Episode 229

🎧 Ruby Rogues published an episode with Brad Gessler about Building Rails Application with Phlex

πŸ“½οΈ πŸŽ₯ Videos

Talks

πŸ“½οΈ Yaroslav ShmarovΒ published their first episode of SupeChatΒ Amanda Perino from Rails Foundation about Rails World

πŸ“½οΈ The Rubber Duck Dev ShowΒ published a new episode aboutΒ Leveling Up For Juniors With CodeWithJulie

Screencasts

πŸŽ₯ Yaroslav ShmarovΒ published a new episode aboutΒ Rails 7 #133 API Pagination with Pagy

πŸŽ₯ Dave KimuraΒ published a new episode aboutΒ Tokenized Search

πŸŽ₯ DeaninΒ published new episodes about:

  • Flask on Rails | Python & Ruby on Rails 7 Tutorial

  • Speech Recognition in Ruby on Rails 7

✍🏾 Articles

What’s new

  • Samuel WilliamsΒ shared their slides from Ruby Conf AU: Asynchronous Rails

  • Big BinaryΒ published an article aboutΒ Rails 7.1 adds ActiveRecord::Base::normalizes. On the same topic Sampat BadheΒ also published an article aboutΒ Rails 7.1 AR adds normalizes API for attribute values

  • Shivam Singh ChaharΒ published an article aboutΒ Rails 7.1 adds support for responsive images.

How-Tos

  • MaurΓ­cio MaiaΒ published an articleΒ How-To Add Recommendations to a Rails App with pgvector and OpenAI

  • Aestimo Kirina published an article aboutΒ Manage Your Ruby Logs Like a Pro

  • Akshay Khot published an article about How to Create Custom Flash Types in Rails

  • Adam RiceΒ published an article aboutΒ Debugging with introspection

  • Takashi KokubunΒ published an article aboutΒ their talk at RubyKaigi about [JP] Announced how to write a JIT compiler on RubyKaigi (English version translated with Google)

  • Ariel Juodziukynas published an article about Handling Environment Variables in Ruby

Deep Dives

  • Unathi Chonco published an article about Ruby Method Lookup Demystified: Inheritance, Mixins, and Super

  • PaweΕ‚ DΔ…browskiΒ published an article aboutΒ Unraveling the mystery of the super keyword

Related

  • Adam RiceΒ published an article aboutΒ Why you shouldn't exclusively hire senior developers

  • Dave CopelandΒ shared an article aboutΒ My 20 Year Career is Technical Debt or Deprecated

  • PaweΕ‚ DΔ…browskiΒ published an article aboutΒ Understanding database Indexes in PostgreSQL

  • Jeremy SmithΒ shared an repository aboutΒ prompt-engineering: Tips and tricks for working with Large Language Models like OpenAI's GPT-4

  • Lucas BarretΒ published an article aboutΒ Postgres concurrency what could go wrong (part 1)


Please consider becoming a paid subscriber to support this newsletter for just $1.5/week ($6.5/month). Your contribution aids growth and maintains the quality of ShortRuby for everybody:

Support the newsletter for ~1.5$/week

If you consider upgrading and want more information, please read Why to subscribe to paid

2
Share
Previous
Next
Comments
Top
New
Community

No posts

Ready for more?

Β© 2023 Lucian Ghinda
Privacy βˆ™ Terms βˆ™ Collection notice
Start WritingGet the app
SubstackΒ is the home for great writing