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.
Testing for Errors without Side–Effects in RSpec
A simple way to write RSpec tests that assert an exception is raised and changes are rolled back.
Refactor your switch statements with case_register
case_register is a gem that provides a design pattern to manage switch statements by mapping each case to a method which is dynamically defined in advance.
Modern Rails flash messages (part 2): The undo action for deleted items
Easily allow users to undo removing of deleted items using modern Rails flash messages with the undo action. The second part of the tutorial with full code on GitHub and live demo.
Tracking All Paper Trail Version From A Single Request With Correlation UUIDs
If you’ve ever had a need to implement an audit log to track all the changes that get persisted for all or at least some models in your application, there is a good chance that you’ve encountered PaperTrail gem that makes it trivial to track all the changes - it might be as easy as adding has_paper_trail to the desired models. [more inside]
Writing a background job processing using Ractor
How to use Ractor the new concurrency primitive to build a simple background job processing [ READ MORE ]
The Hidden Costs of Software Dependencies [YouTube]
I take a 10-year perspective on my Rails application and look at how Ruby and JS dependencies contributed to maintenance costs: https://www.youtube.com/watch?v=rQegYUsU7ec
The Data Cascade, Find Tag, and More in Bridgetown 0.17
We’re pleased to announce the release of Bridgetown 0.17, codenamed “Mount Scott”. Some of the improvements are optimizations at the code level and preparing for bigger features down the road (i18n), but there are also a few goodies you can start using in your static site projects today. https://www.bridgetownrb.com/release/whats-new-in-0.17-mount-scott/
Glimmer Has Been One Point Oh’ed!
Glimmer is finally 1.0.0. This marks a big milestone since Glimmer has outgrown its single-library roots and has become an assortment of Ruby gems that work together, such as Glimmer DSL for SWT (JRuby Desktop Development GUI Library), Glimmer DSL for Tk (Ruby Desktop Development GUI Library), Glimmer DSL for Opal (Web GUI Adapter for Desktop Apps), Glimmer DSL for XML (& HTML), and Glimmer DSL for CSS. https://andymaleh.blogspot.com/2020/09/glimmer-has-been-one-point-ohed.html
The defined? keyword in Ruby
An overview of the defined? keyword with a use case from the Ruby source code.. and an optimization tip! https://medium.com/rubycademy/the-defined-keyword-in-ruby-b7a5a5a48e1e
Rails Concerns: To Concern Or Not To Concern
Should you be concerned about Rails concerns? [more inside]
Interesting Methods to Work with Ruby Hashes in A Better Way
Learn more about important methods for ruby hashes. Taking care of some mistakes while accessing ruby hashes and working on it. https://www.botreetechnologies.com/blog/interesting-methods-to-work-with-ruby-hashes-in-a-better-way
Zero-Downtime migrations in Rails
Often, we rename a column and deploy to find out the Honeybadger screaming at us with the errors accessing column with the old name! [more inside]
How to Test Gem Dependencies with Appraisal
If you’re building a gem or just want to test your app against multiple versions of your gem dependencies, the Appraisal gem makes this process really simple. Watch the screencast on how to use the Appraisal gem to test multiple gem dependencies and versions
Communication between multiple docker-compose projects
Hey all, learn how to make all your dokcer-compose projecto communicate to each other: https://medium.com/@matayoshi.mariano/communication-between-multiple-docker-compose-projects-d79a68af3348
Function Composition: Python vs Ruby
Learn more about Function Composition here: https://medium.com/rubycademy/function-composition-in-ruby-d9ca64f65abb
football.db Gem Family 2020.9 Update for Season 2020/21
Hello, I’ve updated the complete football.db Gem Family for Season 2020/21. The football.db gems incl. zero-config ready-to-use datasets / classes for all FIFA countries (240+), the world’s top football leagues & clubs and more. Enjoy the beautiful game with ruby. Cheers. Prost.
Glimmer DSL for Tk 0.0.5
Glimmer DSL for Tk 0.0.5 ships with Hello, Computed! having computed-value data-binding and grid geometry manager support. https://andymaleh.blogspot.com/2020/09/glimmer-dsl-for-tk-005-hello-computed.html