The Ruby and Rails community linklog
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
Submit a post
Post Preview
Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.
Monkey Patch Responsibly
Learn how to deploy Monkey Patches in Rails Applications, or as Rubygems, that don’t blow up your production environment because you forgot to take them out when a final patch was released. [more inside]
Be Careful With Time Durations in Rails
Rails’ date and time helpers are great. They save us from duplicating simple add-duration-to-time logic across our applications and make the code more readable. However, complex date manipulations are dangerous places full of edge-cases. This article discusses some of them. https://www.honeybadger.io/blog/activesupport-duration-helpers/
Announcing the Ronin 2.0.0 Open Beta
After a year of continuous work refactoring, Ronin 2.0.0 (beta) has finally been released and is ready for beta testing. [more inside]
All Ruby Books @ Planet Ruby Opened Up /2023 Directory & More
Hello, the All Ruby Books collection was started by Florent Guilleux in 2016 and before shutting it down I volunteered to rescue the collection and moved it over to Planet Ruby and converted the code to an all static website built with ruby (via jekyll and github pages) from collections in markdown (one per book organized by directories per year). Anyways, to kick off the new year I added a new /2023 directory and added two upcoming ruby books in beta. Anything missing? Your contributions welcome.
Ruby Conferences & Camps in 2023 @ Planet Ruby - What’s Upcoming?
Hello, over at the Planet Ruby I opened-up a new page listing all Ruby Conferences & Camps in 2023 - What’s Upcoming?. It’s all built with ruby (via jekyll and github pages) and a (open) datafile in yaml. There’s even an old school web feed in xml (and modern flavor in json). What ruby (or rails) conference or camp are you planning to attend in 2023 (or are you cancel-cultured like DHH and have to re-start your own foundation and conference that invites you back as a keynote speaker ;-) ?
Preloading associations on an Array of Objects
It might happen that your initial array of objects is not an ActiveRecord Relation. You cannot use preload on an array of objects and therefore you suffer of N+1 queries. Here is a smart way to solve the problem! [more inside]
It is not what you expect, but it is what you want: how Data#initialize is designed
A curios core class design decision made for happier coding.
Why I think that Authentication Zero is a bad idea
Let’s start the new year with a hot take! I think Authentication Zero is a bad idea for security. I summed up here why I think that: [more inside]
"Woke" Conspiracy Lead By Schneems et al Trying to "Cancel Culture" Rails Lead
What’s ahead in 2023 in rubyland? I am not making it up my “good old friends” - Richard Schneeman (Schneems) and Brandon Weaver - that perma-banned “cancel cultured” for life my humble self from r/ruby & ruby-talk (see r/planetruby for some background) are now leading a conspiracy to “cancel culture” DHH from rails. [more inside]
Reading logs to debug? Consider different approach
Debugging applications can get hard. Unless you know what happened. You can make it easier for yourself, specifically in the most important parts of it. Check out how RailsEventStore can help there. https://blog.arkency.com/simplify-your-system-debugging-by-introducing-event-store-linking/
If I Were ~~King~~ Matz - Ideas For Ruby 4.0 - What's Broken & Missing In 3.x
Hello, to start off the new year with looking ahead I started a new page titled If I Were ~~King~~ Matz (aka Yukihiro Matsumoto) - Ideas For Ruby 4.0 - What’s Broken & Missing in Ruby 3.x and How To Fix It that is a (living) quick draft of ideas (backed-up with code & monkey-patches that you can use / try out today). Your questions and comments welcome. Happy new year. Prosit 2023!
Custom Turbo Stream Actions
With the release of Turbo 7.2, we gained the ability to create custom actions in Turbo. This allows us to trigger functions on the client side that would have been difficult or cumbersome to do in the past. In this episode, we look at setting up custom actions and how to use them. https://www.driftingruby.com/episodes/custom-turbo-stream-actions
Irbtools 4.0 for IRB 1.6+
More recent versions of IRB introduced a bunch of useful commands like show_doc. The arguments to these commands don’t need to be Ruby objects, so that things like show_doc String#gsub just work. [more inside]
Ruby-on-Rails bullet gem tutorial
Rails bullet gem is here to solve the N+1 query problem. Let’s create this problem first, and solve it thanks to the Rails bullet gem. [more inside]
HexaPDF 0.28.0 - Small enhancements and restructured documentation
I just released HexaPDF 0.28.0 with many small enhancements as well as a restructured documentation site and great performance numbers courtesy of Ruby 3.2.0+YJIT [more inside]
abicoder gem - New Application Binary Inteface (ABI) Coder For Ethereum & Co.
Hello, to help out all ethereum & co gems in rubyland I have started a new abicoder gem that includes application binary interface (abi) encoder & decoder for easy (re)use with zero-dependencies on any 3rd party gems incl. any of my own ;-). The idea is to work together in 2023 on any missing functionality - I have already pinged / invited the eth.rb lead. Happy blockchaining with ruby. Happy New Year. Prosit 2023! PS: A little user survey - What’s your ethereum gem of choice? Does it support tuples (or tuple arrays) in (contract) function calls?
Ruby and exception performance
Ruby has a mechanism for handling errors and exceptions in a clean and organized manner, but using exceptions too frequently or improperly can negatively impact the performance of a Ruby application. [more inside]
My First Code Commit in Ruby
This post celebrates my first code commit merged into Ruby with the years-long tale of what put me in position to make the change. https://kevinjmurphy.com/posts/my-first-code-commit-in-ruby/
ShinyGems.dev - Help maintain your favourite gems and make them shine
ShinyGems connects maintainers with passionate developers who want to make ruby ecosystem better. shinygems.dev
abiparser gem - New Application Binary Inteface (ABI) Parser For Ethereum & Co.
Hello, I have started on a new abiparser gem that includes application binary interface (abi) parser machinery / helper for Ethereum & Co. (blockchain) contracts and started to document function signature hashes (“sighashes”) / selectors and interface (type) ids and more - all using coding examples in ye good olde plain ruby. Happy blockchaining with ruby. Are abis (application binary interfaces) the new apis (application programming interfaces)? Discuss. Cheers. Prost. PS: A first (upcoming) “real-world” usage-case is the new abidoc gem that - surprise, surprise - generates abi documentation pages from public abi (contract) specs (in json) parsed with the abiparser gem.