👐 Short Ruby - edition #19
Briefly about everything happening in Ruby
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:
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!
It is excellent to start the week with something positive:
👐 Our Community
It will help if you read the entire conversation as good ideas are replied back and forth.
You should read the conversation on ruby.social it has some excellent arguments for using ViewComponent or Phlex.
You can now buy the Programming Ruby 3.2 pickaxe book with 40% discount using that code.
👉 Code Inspiration
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.
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:
Before enabling this, you should read about The BREACH attack
Here is the list of gems with links:
If you have read so far and you like the content, maybe you take into consideration sharing this and subscribing:
🧰 Gems, Libraries, and Updates
🤝 Related (but not Ruby-specific)
Here is the relevant section from the Github docs:
Here is one of those risks, as Alex mentions it, but you should read the thread:
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.
Thanks for reading Short Ruby Newsletter! If you enjoyed this and want to receive the newsletter weekly in your inbox, consider subscribing: