This is a short(ish) form of the newsletter where I limited the number of sections and also tried to include less content in each one of them:
๐งฐ Gems, Libraries, and Updates
๐ค Related (but not Ruby-specific)
If you want to read the usual long format that includes videos, articles and podcasts, and a lot more content that I did not include here click on:
This is just an experiment with the format of the newsletter. I will share how it goes!
This edition was created with support fromย @adrianthedevย fromย Avo for Ruby on Rails (a friendly full-featured Rails admin panel) and @jcsrb
It is excellent to start the week with something positive:
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7795071c-5053-47b7-a354-ce01bebb3fc2_1978x870.png)
Also, on the topic of good news, donโt forget that Hanami is very close to the final release of version 2.0. Follow the progress here (on Trello) or here (on Github).
๐ Our Community
๐ Adrian Marin shared a suggestion about how to contribute to supporting more people to user Ruby:
![People keep asking what's the best thing to do to ensure more people work with Ruby in the future. Answers like "build more things in Ruby", "contribute to Open Source projects" are vague, not clearly defined, and un-actionable. Create an apprenticeship program for developers who are still in school. They usually want to learn how "real-world" development is being done and are eager to learn. Make Ruby the first programming language for them and you'll have a passionate Ruby-ist for life. People keep asking what's the best thing to do to ensure more people work with Ruby in the future. Answers like "build more things in Ruby", "contribute to Open Source projects" are vague, not clearly defined, and un-actionable. Create an apprenticeship program for developers who are still in school. They usually want to learn how "real-world" development is being done and are eager to learn. Make Ruby the first programming language for them and you'll have a passionate Ruby-ist for life.](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F5f6f2d13-549a-4789-b1a2-8da408b7f9be_1194x770.png)
It will help if you read the entire conversation as good ideas are replied back and forth.
๐ย Ruby On Railsย shared the news about Rails Foundation:
![The Rails Foundation kicks off with one million dollars from @cookpad , @doximity , @fleetio , @github , @intercom , @procoretech , @Shopify , and @37signals to improve the documentation, education, marketing, and events in our ecosystem ๐ The Rails Foundation kicks off with one million dollars from @cookpad , @doximity , @fleetio , @github , @intercom , @procoretech , @Shopify , and @37signals to improve the documentation, education, marketing, and events in our ecosystem ๐](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F51c59b36-55c2-4bb7-841f-dcdb6b0035c3_1304x554.png)
If you want to read also about concerns regarding this foundation, here is a conversation started by Luca Guidi and here is one started by Brandon Weaver.
๐ Mike Dalessio shared that the Ruby Core monthly meeting notes are available on Github repo:
![TIL that the Ruby Core monthly meeting notes are public and kept in a github repo: TIL that the Ruby Core monthly meeting notes are public and kept in a github repo:](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F21170199-2922-4410-a807-db7d02627d65_1324x578.png)
๐ Joel Drapper shared their take on React and View layer on Rails:
![Iโve done a lot of technical interviews at companies using Ruby / Rails recently and one thing seems clear to me: on the current trajectory, React is set to be *the* Rails view layer. Hotwire gets us a long way towards SSR reactivity, but partials donโt cut it. Add to that the fact itโs quite difficult to hire Rails front-end developers and Shopify / GitHub have basically abandoned SSR, CTOs are sadly picking React. Iโve done a lot of technical interviews at companies using Ruby / Rails recently and one thing seems clear to me: on the current trajectory, React is set to be *the* Rails view layer. Hotwire gets us a long way towards SSR reactivity, but partials donโt cut it. Add to that the fact itโs quite difficult to hire Rails front-end developers and Shopify / GitHub have basically abandoned SSR, CTOs are sadly picking React.](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F918fa7f9-993d-4b30-9259-0c4634322d6c_1354x684.png)
You should read the conversation on ruby.social it has some excellent arguments for using ViewComponent or Phlex.
![Hereโs the thing, itโs not that *anything you can do in React can be done in Hotwire.* Rather, youโre doing a million things in React that donโt need to be done because they donโt actually serve anyoneโs needs. We spent so long designing the perfect React modal, no one stopped to consider the fact that modals provide an awful, frustrating, inaccessible user experience and we should use a different pattern like rendering a new page or providing an โundoโ feature instead. Hereโs the thing, itโs not that *anything you can do in React can be done in Hotwire.* Rather, youโre doing a million things in React that donโt need to be done because they donโt actually serve anyoneโs needs. We spent so long designing the perfect React modal, no one stopped to consider the fact that modals provide an awful, frustrating, inaccessible user experience and we should use a different pattern like rendering a new page or providing an โundoโ feature instead.](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F33f884bb-d373-4cdd-88da-90e92804afb4_1354x790.png)
๐ย Justin Searlsย shared that DevRel and megacorps influence our decision process:
![One reason I withdrew a bit from the JavaScript Communityยฎ and chose to reinvest in Rails was that front-end frameworks and tooling became dominated by megacorps whose DevRel people convinced everyone that EVERY team should adopt solutions designed for Google or Facebook scale. One reason I withdrew a bit from the JavaScript Communityยฎ and chose to reinvest in Rails was that front-end frameworks and tooling became dominated by megacorps whose DevRel people convinced everyone that EVERY team should adopt solutions designed for Google or Facebook scale.](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F389af517-653d-47c5-ab2d-ee208fffe82f_1284x554.png)
๐ย Noel Rappin shared that The Pragmatic Bookshelf is having a Black Friday, and now you can buy Ruby books with a discount:
![Pragmatic Press is starting their annual November sale today. Starting now and through November all ebooks are 40% off with code "turkeysale2022". That's a lot of great technical books, and I really hope you'll check out the whole slate. I have four books in print right now Pragmatic Press is starting their annual November sale today. Starting now and through November all ebooks are 40% off with code "turkeysale2022". That's a lot of great technical books, and I really hope you'll check out the whole slate. I have four books in print right now](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0454cee9-c64b-4850-8e4f-4ef517d6b2bd_1344x1374.png)
You can now buy the Programming Ruby 3.2 pickaxe book with 40% discount using that code.
๐ Code Inspiration
๐ย Kirill Shevchenkoย shared a code sample showing the difference between ==
and .equal?
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F2c58ece7-28e0-4e4c-9bf1-52c5ebbff39e_1314x562.png)
![== may perform type coercions whereas eql? does not: irb(main):005:0> 1 == 1.0 => true irb(main):006:0> 1.eql?(1.0) => false == may perform type coercions whereas eql? does not: irb(main):005:0> 1 == 1.0 => true irb(main):006:0> 1.eql?(1.0) => false](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fda7acadb-f061-441d-96f8-399689efe3da_1314x570.png)
And David Stosik added:
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F525d8dd4-2e1c-439a-8736-bcb9933eaef1_1358x1234.png)
๐ย Kirill Shevchenkoย shared a code sample about using split with a second argument:
![Ruby's split method mostly used with the first argument like "one two three".split(" "). However, you can specify a second argument, which is used to limit the resulting array. There is a classic example of mapping the full name into two fields. Ruby's split method mostly used with the first argument like "one two three".split(" "). However, you can specify a second argument, which is used to limit the resulting array. There is a classic example of mapping the full name into two fields.](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F3b18c0c1-89d7-4f86-938c-b88b1774137f_1296x1264.png)
๐ย Greg Navisย shared code samples about methods similar to method_missing:
![๐ก Ruby tip: method_missing has 10+ brothers and cousins. There are more than 10 hook methods that get called in response to certain events. โฌ๏ธ Let's have a quick look at each one along with code examples. ๐ก Ruby tip: method_missing has 10+ brothers and cousins. There are more than 10 hook methods that get called in response to certain events. โฌ๏ธ Let's have a quick look at each one along with code examples.](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F997e8bd0-5ed5-425e-a072-4a7c94876210_1294x586.png)
Here is the list that Greg will demo with code samples in this thread:
method_added - โInvoked as a callback whenever an instance method is added to the receiverโ
method_removed - โInvoked as a callback whenever an instance method is removed from the receiverโ
method_undefined - โInvoked as a callback whenever an instance method is undefined from the receiver.โ
prepended - โThe equivalent ofย
included
, but for prepended modules.โincluded - โCallback invoked whenever the receiver is included in another module or class.โ
extended - โThe equivalent ofย
included
, but for extended modules.โsingleton_method_added - โInvoked as a callback whenever a singleton method is added to the receiver.โ
singleton_method_removed - โInvoked as a callback whenever a singleton method is removed from the receiverโ
singleton_method_undefined - โInvoked as a callback whenever a singleton method is undefined in the receiver.โ
method_missing - โInvoked by Ruby whenย objย is sent a message it cannot handle.โ
const_missing - โInvoked when a reference is made to an undefined constant inย mod.โ
respond_to_missing? - โHook method to return whether theย objย can respond toย idย method or not.โ - please notice the docs say โDO NOT USE THIS DIRECTLYโ
You should read the entire thread where Greg shares code samples about each method.
๐ย Brad Gesslerย shared a thread where he showed how to build a view for a form with Phlex.fun:
![Got the prototype working! The form object tracks which fields youโve used, creates a permitted params hash, signs it, and stuffs it into a hidden `permitted_params` input field. When the form is submitted, Rails verifies the params and stuffs them into `params.permit` Got the prototype working! The form object tracks which fields youโve used, creates a permitted params hash, signs it, and stuffs it into a hidden `permitted_params` input field. When the form is submitted, Rails verifies the params and stuffs them into `params.permit`](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fed787112-e512-49a1-9aee-2f80992f7044_1292x648.png)
Here is a code sample Brad shared for how the controller might look like, but you should read the entire thread as it has more code samples about how to use Phlex components:
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7ecb35b-c70c-4ab9-b45c-4b7f26bbf636_1576x1558.png)
๐ย Leastbadย shared a one-line config for Rails that will enable Brotli gzip content-encoding:
![Add this to your config/application.rb to enable Brotli gzip content encoding in your Rails app: config.middleware.insert_after ActionDispatch::Static, Rack::Deflater ~70-90% compression on your HTML payloads. Add this to your config/application.rb to enable Brotli gzip content encoding in your Rails app: config.middleware.insert_after ActionDispatch::Static, Rack::Deflater ~70-90% compression on your HTML payloads.](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Faa285084-71d7-4a21-a4dc-98a99a293b87_1290x586.png)
Before enabling this, you should read about The BREACH attack
๐ย Kevin Newtonย shared a code sample about how to use emojis as methods:
![Ever wanted to use emojis as methods and be able to add them together? They're completely accepted as identifiers in Ruby, so you can use them as method names and local variable names. Ever wanted to use emojis as methods and be able to add them together? They're completely accepted as identifiers in Ruby, so you can use them as method names and local variable names.](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F5aab23ea-67d5-4aea-b8fc-704d20bccae5_1284x1378.png)
๐ย Kirill Shevchenkoย sharedย a collection of tools to debug memory issues:
![If you ever faced with debugging memory issues with ObjectSpace, there are 4 tools that provide a powerful interface on top of it: 1. memory_profiler 2. heapy 3. derailed_benchmarks 4. heap-profiler (links in thread) If you ever faced with debugging memory issues with ObjectSpace, there are 4 tools that provide a powerful interface on top of it: 1. memory_profiler 2. heapy 3. derailed_benchmarks 4. heap-profiler (links in thread)](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F77f89481-2ac4-423b-b453-0037590d9ced_1306x676.png)
Here is the list of gems with links:
๐ u/campbellm asked a question about how to use service objects and received a lot of good responses:
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F45f251dc-d3ed-49b4-babd-07b82e896f2c_1674x1428.png)
If you have read so far and you like the content, maybe you take into consideration sharing this and subscribing:
๐งฐ Gems, Libraries, and Updates
๐งฐ Meg Gutshallย sharedย the prettier_print gem that can replace the prettyprint gem.
๐งฐ Joel Drapper published a new version of Phlex. Read the changelog here
๐งฐ Marco Rothย sharedย that their PR about Outlets API was merged to hotwire/stimulus:
๐งฐ Stan Loย sharedย they are working on adding the edit command to IRB. Check out the PR Add edit command by st0012
๐งฐ Joel Drapper shared an example of how easy it is to re-use Phlex views as gems: See the code here
๐งฐ Stanislav Katkov shared an update of their gem rdoc-markdown
where they added output examples. See example 1 and example 2
๐งฐ Joel Drapper shared they merged a PR that adds around_template hook on Phlex: Check out the PR here
๐งฐ Stephen Ierodiaconou published a new gem named yaml_csp_config that โallows you to specify your content security policy (CSP) in a YAML fileโ.
๐ค Related (but not Ruby-specific)
๐คย Jason Warnerย shared their thoughts about the monolith and micro-services architecture:
![I'm convinced that one of the biggest architectural mistakes of the past decade was going full microservice On a spectrum of monolith to microservices, I suggest the following: Monolith > apps > services > microservices So, some thoughts I'm convinced that one of the biggest architectural mistakes of the past decade was going full microservice On a spectrum of monolith to microservices, I suggest the following: Monolith > apps > services > microservices So, some thoughts](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F282a5715-785f-4ac0-93fd-5ee7102d1ca1_1294x666.png)
Here are some parts of the thread, but you should read it all:
๐ค Ryan Batesย sharedย that it is possible to ignore specific commits while git blame: Read the docs here
Here is the relevant section from the Github docs:
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F65a1cf79-4bf4-4b38-be2c-0ee2943523e4_1578x960.png)
๐คย Alex Russellย shared about a new concept named Minimal Client Complexity:
![I need to blog about the Principle of Minimal Client Complexity, but one way to understand why I push back so hard on huge stacks of JS is that when you move thing to the client, you don't add risks from each uncontrolled dimension, you _multiply_ them. What are those risks? I need to blog about the Principle of Minimal Client Complexity, but one way to understand why I push back so hard on huge stacks of JS is that when you move thing to the client, you don't add risks from each uncontrolled dimension, you _multiply_ them. What are those risks?](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F407923ff-0c0d-4bc6-b303-b2119b559c06_1294x616.png)
Here is one of those risks, as Alex mentions it, but you should read the thread:
![](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F5451b2ab-ce27-4e7f-83d1-cabb0e274045_1346x316.png)
๐คย Study Every Daย shared how to open all changed files in vim:
![Git alias I'm trying out - Open the files changed in a commit in vim tabs. So I can do something like `git go head` to pick up where I left off. If there's a way to do this already with fugitive LMK Git alias I'm trying out - Open the files changed in a commit in vim tabs. So I can do something like `git go head` to pick up where I left off. If there's a way to do this already with fugitive LMK](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fff974e1f-acf3-4544-a5f1-e3c75ff9c718_1286x862.png)
It is worth considering this reply from Ara Hocopian:
![This is how I do it for WIPs and HEAD. Maybe there is something of value that you can adapt to your needs. I'd also be interested to see how others do it. This is how I do it for WIPs and HEAD. Maybe there is something of value that you can adapt to your needs. I'd also be interested to see how others do it.](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fee8de598-1caf-4f2c-ba5d-e58e9f1e8577_1312x1214.png)
๐คย Mosquito Capitalย sharedย a good thread about how to think and approach reliability scenarios:
![I've seen a lot of people asking "why does everyone think Twitter is doomed?" As an SRE and sysadmin with 10+ years of industry experience, I wanted to write up a few scenarios that are real threats to the integrity of the bird site over the coming weeks. I've seen a lot of people asking "why does everyone think Twitter is doomed?" As an SRE and sysadmin with 10+ years of industry experience, I wanted to write up a few scenarios that are real threats to the integrity of the bird site over the coming weeks.](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7165f26-e087-49d6-912a-19f43c8f353d_1306x572.png)
If you read that thread, you can easily extract a checklist about what to check or how to test your system and see if you have the proper processes and people to handle these unexpected scenarios.