Discover more from Short Ruby Newsletter
Short Ruby News - edition #20
Briefly about everything in Ruby world
You can jump directly to one of the following sections if you like:
More content: 🎥 🎧 🗞 (articles, podcasts, videos and newsletters)
👐 Our Community
👐 Jean Boussier about Ruby/Rails:
👉 All about Code and Ruby
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
Product Focused Ruby by Kasper Timm Hansen
If you want to understand more unary operators (the method ending with
@) here is an example:
If you want to know who was the one that inspired this and what they shared, read here
The thread also has some ideas about how a conversation about hiring senior developers could be.
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.
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
And this got a lot of gems proposing various ways to achieve this:
Here are some responses:
"Using it when the method is exactly one line with no logic (not even ||=)“ (@email@example.com)
“saw someone used it to replace the rails “scope” class method” (@firstname.lastname@example.org)
“I often use them for methods that are a single statement (not line, statement)” (@email@example.com)
“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.” (@firstname.lastname@example.org)
“I use it with one-liners, mostly like I'm using one-liners in Elixir. Just return data, no mutations or memorization” (@email@example.com)
“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
🧰 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
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)
He then followed up with a thread explaining more about why they think the book is outdated and also shared.
More content: 🎥 🎧 🗞
🗞 Greg Molnar shared a new edition of This Week in Rails: Disable enum methods generation, a concurrency fix and more!
🎥 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
Data Indexing with RGB (Ruby, Graphs and Bitmaps) by Benji Lewis
Keeping developers happy with a fast CI by Christian Bruckmayer
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
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: