Short Ruby Newsletter

Share this post

Short Ruby News - edition #20

newsletter.shortruby.com

Short Ruby News - edition #20

Briefly about everything in Ruby world

Lucian Ghinda
Nov 28, 2022
5
2
Share this post

Short Ruby News - edition #20

newsletter.shortruby.com

This edition was created with the help ofΒ @adrianthedev/@adrian@ruby.socialΒ fromΒ Avo for Ruby on Rails (a friendly full-featured Rails admin panel) and @jcsrb.

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

πŸ‘ Our Community

πŸ‘‰ All about Code and Ruby

🧰 Gems, Libraries, and Updates

🀝 Related (but not Ruby-specific)

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


πŸ‘ Our Community

πŸ‘ Hanami 2.0 was released. Read the release notes here.

Source: @hanami@ruby.social

πŸ‘ Ruby versions 3.1.3, 3.0.5 and 2.7.7 are released:

Source: ruby-lang.org

Related to this, Postmodern announced that ruby-versions now support all these three versions.

πŸ‘ Jean Boussier about Ruby/Rails:

Source: @_byroot on Twitter

🀝 Cezar Halmagean is offering all Short Ruby subscribers/readers a 40% discount for his course Learn Hotwire . Use coupon code SHORTRUBY (valid until Tuesday) at the checkout :

Learn Hotwire


πŸ‘‰ All about Code and Ruby

πŸ‘‰Β Greg NavisΒ shared a thread about constant autoloading. Read the whole thread about how constant autoloading works:

Source: @gregnavis onΒ Twitter

πŸ‘‰ Chris Oliver asked about deals for Ruby & Rails. Some of them were available for Friday, but I think you should check them out as most of them are still available:

Source: @excid3 on Twitter

Here is a list of links (that today - Sunday seems still to be valid) from the replies:

  • Go Rails and Jumpstart Pro

  • Avo - CMS and CRM builder on Ruby on Rails (use code RUBY20BF)

  • Book time with Ian Moss

  • Spektr - vulnerability Scanning for Ruby on rails app - all plans free

  • Rebuilding Rails book by Noah Gibbs

  • Deployment from Scratch by Josef Strzibny

  • Advanced CableReady by Julian Rubisch

  • StimulusReflex Patterns Premium + Advanced CableReady Bundle by Julian Rubisch

  • Pragmatic Programmer books are 40% off (code turkeysale2022) - that includes Programming Ruby 3.2 and Modern Front-End Development for Rails by Noel Rappin

  • Product Focused Ruby by Kasper Timm Hansen

πŸ‘‰ Mehdi Farsi shared a short code explaining the difference between ! and not:

Source: /u/mehdifarsi on /r/ruby

If you want to understand more unary operators (the method ending with @) here is an example:

Source: /r/ruby

πŸ‘‰ James shared a new project he is working on rubymyths.dev and here is the reason why:

Source: @jsrn@ruby.social

If you want to know who was the one that inspired this and what they shared, read here

πŸ‘‰ Joel Drapper asked about why senior/principal engineers are asked basic Rails take-home coding challenges:

Source: @joeldrapper@ruby.social

The thread also has some ideas about how a conversation about hiring senior developers could be.

πŸ‘‰Β Kelly SommersΒ shared a joke that Mastodon seems slow, and it implied this is because of Ruby:

Source: @kellabyte onΒ Twitter

Sam Saffron replied:

Source: @samsaffron on Twitter

Nate Berkopec pointed out that maybe Ruby is not the issue here:

Source: @nateberkopec on Twitter

And also added that the X-runtime header is showing 92 milliseconds runtime:

Source: @nateberkopec on Twitter

I am adding something here: Kelly said they shared this as a joke, but this is a joke that is not so obvious and implies that Ruby is slow. Thus please take time to read the thread, as this kind of critique, sometimes thrown in a lightweight way, will influence decisions. It will help you be prepared to have this conversation.

πŸ‘‰Β Jason SwettΒ shared they are starting Code With Jason Salon. Register here if you want to participate:

Source: @JasonSwett onΒ Twitter

πŸ‘‰ Joel Drapper shared a code preview showing conditional tokens support in the next version of Phlex:

Source: @joeldrapper@ruby.social

πŸ‘‰ Greg NavisΒ shared a thread about using then to sequence operations:

Source: @gregnavis onΒ Twitter

πŸ‘‰ Kirill ShevchenkoΒ shared a code sample about using the ActiveSupport built-in module for configuration:

Source: @kirill_shevch onΒ Twitter

πŸ‘‰Β Greg NavisΒ shared a thread about currying in Ruby. There are a lot of code samples there so here are two

Source: @gregnavis on Twitter
Source: @gregnavis on Twitter

πŸ‘‰ Peter Solnica shared a code sample showing how providers work in Hanami:

Source: @solnic@ruby.social

πŸ‘‰ Greg Molnar asked about Rspec or Minitest:

Source: @GregMolnar on Twitter

Here is a summary of reasons for choosing Minitest:

  • It is simple

  • It is fully supported by Rails.

  • It is easier to reason with

  • It is easy to onboard new developers as there is no new DSL to learn

And here is a summary of reasons for choosing RSpec:

  • Because a lot of people are using it

  • needs less code to achieve the same test case as with Minitest

  • Rspec seems less boring than Minitest

Worth considering listening to this YAGNI episode: RSpec w/ Justin Searls

πŸ‘‰ Joel Drapper started a discussion about method overload in Ruby (please be advised this does not work):

Source: @joeldrapper@ruby.social

And this got a lot of gems proposing various ways to achieve this:

Jamie Gaskins shared their gem method_pattern:

Source: https://github.com/jgaskins/method_pattern

Brandon Weaver shared their gem taking:

Source: https://github.com/baweaver/taking#usage

PaweΕ‚ ŚwiΔ…tkowski shared their own gem noaidi:

Source: https://github.com/katafrakt/noaidi

πŸ‘‰ Lucian Ghinda asked about examples of using the endless method:

Source: @lucian@ruby.social

Here are some responses:

  • "Using it when the method is exactly one line with no logic (not even ||=)β€œ (@davetron500@ruby.social)

  • β€œsaw someone used it to replace the rails β€œscope” class method” (@schneems@ruby.social)

  • β€œI often use them for methods that are a single statement (not line, statement)” (@joeldrapper@ruby.social)

  • β€œI use it mostly as a signal that the method is basically a computed attribute -- it's a single statement, and usually takes no arguments.” (@noelrap@ruby.social)

  • β€œI use it with one-liners, mostly like I'm using one-liners in Elixir. Just return data, no mutations or memorization” (@katafrakt@ruby.social)

  • β€œOnly use Ruby 3.0’s endless method definitions with a single line body. Ideally, such method definitions should be both simple (a single expression) and free of side effects.” (rubystyle.guide)

There are some code samples shared so you should read the replies.


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


🧰 Gems, Libraries, and Updates

🧰 Avo shared a new release packed with a lot of goodies:

Source: avohq.io/releases/2.2.0

🧰 Joel Drapper shared a RC release for Phlex 1.0. Read the release notes here

Source: @joeldrapper@ruby.social

🧰 Stan Lo shared that IRB v.1.5.0 has been released. He also shared short videos explaining the highlights:

Explaining edit commands and explaining debug commands:

Source: @_st0012 on Twitter

🧰 Ruby Lib Hunt shared a ruby gem created by Andrew Kane polars-ruby - DataFrames for Ruby

Source: github.com/ankane/polars-ruby

🧰 Jean Boussier shared a PR for fixing format_command Fix `format_command`'s terrible performance

🧰 Dima Fatko shared their two PRs that are merged and will be part of Rails 7.1 that will save many queries when updating records:

  • Avoid validating belongs_to association if it has not changed

  • Avoid validating a unique field if it has not changed and is backed by a unique index

🧰 Stanislav Katkov shared a gem that provides a CLI utility for managing migrations jesseduffield/lazy_migrate: A little terminal UI for managing schema migrations in rails

🧰 Takashi Kokubun announced the release of ERB v.4.0.0:

RB::Util.html_escape became 1.77x faster in no-escape cases. From Ruby 3.2 or if you use ERB 4+, it's faster than CGI.escapeHTML

He also shared a PR that is merged to Rails main which will improve ERB speed


🀝 Related (but not Ruby-specific)

🀝 Mario Fusco shared an opinion about the Design Patterns book:

Source: @mariofusco on Twitter

He then followed up with a thread explaining more about why they think the book is outdated and also shared.

🀝 Jason Swett shared about one of the benefits of writing tests first:

Source: @JasonSwett onΒ Twitter

🀝 Ryan Bates shared about writing clever code:

Source: @rbates onΒ Twitter

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

Newsletter

πŸ—ž Greg MolnarΒ shared a new edition of This Week in Rails:Β Disable enum methods generation, a concurrency fix and more!

πŸ—ž Ruby Radar published a new edition: Ruby Radar #78 - RubyConf 2022

πŸ—žοΈ Ruby Weekly published a new edition: OK, this is a big week for Ruby

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

Podcasts

🎧 The Ruby on Rails Podcast published a new episode about Episode 445: The 2022 Holiday Gift Guide Episode

🎧 Ruby For All published a new episode about How to Open Source with Richard Schneeman

🎧 Joe Masilotti published a new edition of Hotwire dev newsletter - November 2022

🎧 Matt Swanson published the last episode of YAGNI: RSpec w/ Justin Searls

🎧 Remote Ruby published a new episode about Tip Tapping Around & The Rails Foundation

Videos

πŸŽ₯ Avo shared a video showing the last release's changes and how to use the code for the new features: Avo 2.20 - Arguments on filters and actions, keep action modal open, and select field fixes.

πŸŽ₯ Joe MasilottiΒ published a live video aboutΒ Building a referral program from scratch for RailsDevs

πŸŽ₯ The London Ruby User Group shared the videos from the November 2022 meeting:

  • Data Indexing with RGB (Ruby, Graphs and Bitmaps) by Benji Lewis

  • ruby/debug - The best investment for your productivity by Stan Lo

  • Keeping developers happy with a fast CI by Christian Bruckmayer

πŸŽ₯ John Hawthorn shared a live stream on Twitch about improving Mastodon and looking at Ruby performance: Watch it here

πŸŽ₯ Collin Donnell did a live streaming on Youtube about the first look at Hanami: Hanami First Look

πŸŽ₯ Dave Kimura published a new episode about Active Storage Variants

Articles

Matt ZagajaΒ sharedΒ an article about How to Get Started with Ruby on Rails

Maciej Mensfeld shared an excellent article they wrote about contributing to Ruby on Rails and improving concurrency: Ruby concurrency is hard: how I became a Ruby on Rails contributor

Evil MartiansΒ shared the slides fromΒ Bites and bytes founder gathering: dev tools & open source by Evil Martians

Sinan MujanΒ sharedΒ a new article about Stimulus MultiSelect

Yukihiro MatzΒ shared an article aboutΒ How I developed a faster Ruby interpreter

Pragmatic Programmers did an excellent interview with David Copeland: Spotlight: David Bryant Copeland (Author) Interview and AMA!

Pushpad Blog published a new article about Multi-Channel Notifications in Ruby on Rails with Noticed gem and Pushpad

Francois shared a great article about Stop lying to yourself – you will never β€œfix itΒ later”

AppSignal blog published a new article by Julian Rubisch about System Notifications with Noticed and CableReady in Rails


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

2
Share this post

Short Ruby News - edition #20

newsletter.shortruby.com
Previous
Next
2 Comments
Steven Rosenberg
Nov 28, 2022Liked by Lucian Ghinda

I am really enjoying this newsletter. Thanks for finding all of these good, interesting things so I don't have to.

Expand full comment
Reply
1 reply by Lucian Ghinda
1 more comment…
TopNewCommunity

No posts

Ready for more?

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