- Short Ruby Newsletter
- Posts
- Short Ruby News - edition #20
Short Ruby News - edition #20
Briefly about everything in Ruby world
This edition was created with the help of @adrianthedev/@[email protected] 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
More content: π₯ π§ π (articles, podcasts, videos and newsletters)
π Our Community
π Hanami 2.0 was released. Read the release notes here.
Related to this, Postmodern announced that ruby-versions now support all these three versions.
π Jean Boussier about Ruby/Rails:
π€ 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 :
π All about Code and Ruby
π Greg Navis shared a thread about constant autoloading. Read the whole thread about how constant autoloading works:
π 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:
Here is a list of links (that today - Sunday seems still to be valid) from the replies:
Avo - CMS and CRM builder on Ruby on Rails (use code RUBY20BF)
Spektr - vulnerability Scanning for Ruby on rails app - all plans free
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:
If you want to understand more unary operators (the method ending with @) here is an example:
π James shared a new project he is working on rubymyths.dev and here is the reason why:
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:
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:
Nate Berkopec pointed out that maybe Ruby is not the issue here:
And also added that the X-runtime header is showing 92 milliseconds runtime:
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:
π Joel Drapper shared a code preview showing conditional tokens support in the next version of Phlex:
π Greg Navis shared a thread about using then to sequence operations:
π Kirill Shevchenko shared a code sample about using the ActiveSupport built-in module for configuration:
π Greg Navis shared a thread about currying in Ruby. There are a lot of code samples there so here are two
π Peter Solnica shared a code sample showing how providers work in Hanami:
π Greg Molnar asked about Rspec or Minitest:
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):
And this got a lot of gems proposing various ways to achieve this:
Jamie Gaskins shared their gem method_pattern:
Brandon Weaver shared their gem taking:
PaweΕ ΕwiΔ tkowski shared their own gem noaidi:
π Lucian Ghinda asked about examples of using the endless method:
Here are some responses:
"Using it when the method is exactly one line with no logic (not even ||=)β (@[email protected])
βsaw someone used it to replace the rails βscopeβ class methodβ (@[email protected])
βI often use them for methods that are a single statement (not line, statement)β (@[email protected])
β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.β (@[email protected])
βI use it with one-liners, mostly like I'm using one-liners in Elixir. Just return data, no mutations or memorizationβ (@[email protected])
β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
π§° Joel Drapper shared a RC release for Phlex 1.0. Read the release notes here
π§° Stan Lo shared that IRB v.1.5.0 has been released. He also shared short videos explaining the highlights:
π§° Ruby Lib Hunt shared a ruby gem created by Andrew Kane polars-ruby - DataFrames for 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:
π§° 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:
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:
π€ Ryan Bates shared about writing clever code:
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
Reply