#​625 — October 20, 2022

Read on the Web 🇺🇦

Together with  pgAnalyze

Ruby Weekly

Finding Relationships Between Ruby’s Top 100 Packages and Their Dependencies — RubyGems recently began rolling out a new security policy for protecting the most heavily used gems, but what about the dependencies of those gems? Kevin got to work using the (very useful) RubyGems data dumps and found that ‘24 of the 112 big gems rely on small gems’ but really the journey is more interesting than the outcome here.

Kevin Lin

Puma 6.0 'Sunflower' ReleasedPuma is arguably the leading HTTP server for Rack based apps right now and 6.0 is a significant release with overall performance improvements, experimental Rack 3 support, support for Sidekiq 7 ‘capsules’, and more. Note that Ruby 2.2 and 2.3 support has been dropped.

Puma Contributors

Free eBook: Advanced Database Programming with Rails and Postgres — Learn about subqueries, materialized views, and custom data types in Postgres and Rails. We walk through realistic real-life examples, translating first into SQL, and then into Rails code. Every example comes with source code so you can follow along.

pganalyze sponsor

DHH and Basecamp: "Why We're Leaving The Cloud" — Rails’ creator David Heinemeier Hansson is also CTO at Basecamp, 37signals or whatever it’s called this week, and as a prettttty significant Ruby and Rails shop, it’s interesting to see his take on the cloud vs self hosting. In other news, DHH has also discovered that LinkedIn is actually pretty good.

David Heinemeier Hansson

✉️  The Short Ruby Newsletter — A newsletter that's not by us! But don’t be fooled, it’s actually waaaay longer than Ruby Weekly but does a good job of digging up Ruby related tips, opinion and discussion from Twitter in particular. A good way to keep up with tips and chatter while we stick to the boring stuff ;-)

Lucian Ghinda

Improving Your Code with RubyCriticRubyCritic is a meta-tool for producing reports about Ruby code quality. It uses other tools like Reek, SimpleCov, Flay, and Flog to produce reports about things like complexity, code smells, and test coverage.

Brena Monteiro

QUICK BITS:

  • The dry-rb family of libraries has adopted Zeitwerk for code (auto)loading.

  • gemdex.org is a new and experimental way to search for Ruby gems by placing weights on different priorities you might have.

  • A few weeks ago, Dave Kimura began doing weekly 'This Week in Rails' video news roundups on YouTube. ▶️ Here's this week's video. (4 minutes.)

ViewComponent in The Wild: Building Modern Rails Frontends — The first in a two-part series on using ViewComponents, which is allegedly the frontend rage in Rails (and at GitHub) right now. This post focuses mostly on design patterns and the benefits of such.

Evil Martians

How to Build Your Own Rails Generator — In the context of Rails, generators are workflow tools that can be used to automate tasks, generate other files, and even generate other generators! This article explores them, including how to build your own from scratch.

William Kennedy

A Deep Dive into Active Record Validations — Accepting user input is critical to Rails applications, but without validations, it can cause problems. Learn why.

Honeybadger sponsor

Pagination in Hanami Apps with ROM — Hanami and Ruby Object Mapper focus on keeping things as simple, extensible, and maintainable as possible. This approach to pagination is no exception and includes validating the pagination parameters.

Seb Wilgosz (Hanami Mastery)

Time Ranges Are Clearer When Querying Databases — Consider using range expressions instead of string fragments when querying for a period of time - they’re shorter and less prone to bugs.

Andy Croll

Enumerating Musical Notes — A look at using Array and Enumerable to teach Ruby (and you) how to play guitar. It’s a fun and different problem to solve with the language.

Kevin Murphy

🛠 Code & Tools

re2: Ruby bindings to Google's RE2 Regex Library — RE2 bills itself as “a fast, safe, thread-friendly alternative to backtracking regular expression engines” and this project brings it into the Ruby world. Note that re2’s regex syntax differs from what you might be used to. v1.5.0 adds a new ‘set’ feature for matching against a collection of patterns simultaneously.

Paul Mucur

pg_enquo: A Way to Securely Query Against Encrypted DataEnquo (standing for “ENcrypted QUery Operations”) is an admittedly niche (for now) approach as it also requires client support (currently only in Rust and Ruby – yes, there's a Rails integration) but it’s interesting to see experiments in this area given increasing concern and legislation around data privacy and security.

Matt Palmer

Register for Unblock 22 - A CI/CD Conference by Buildkite

Buildkite sponsor

FastPage: Faster Pagination for ActiveRecord with Deferred Joins — Given it’s from the PlanetScale managed MySQL folks, you won’t be surprised this is for MySQL users only. It uses a MySQL specific optimization to improve offset/limit queries.

PlanetScale

premailer-rails-revived: For Inlining CSS into HTML Emailspremailer is the established gem for this task with premailer-rails integrating it with Rails. After some questions around its maintenance, however, this fork appeared to add Rails 7 support. The original author of premailer-rails has since promised fresh development so you’ll need to do your research before picking a solution in the interim. GitHub repo.

Adrien Siami

Transactable 0.1: DSL for Transactional Workflows atop Function Composition
Alchemists

Ruby Transactional Notification System Saves Engineering Time

Courier.com sponsor

Jobs

Backend Engineer, Ruby on Rails (Remote) — Booqable is a SaaS application for the global rental industry. We are looking for an experienced Backend Developer.
Booqable

Find Ruby Jobs Through Hired — Create a profile on Hired to connect with hiring managers at growing startups and Fortune 500 companies. It's free for job-seekers.
Hired

👾 And two for fun..

A New Tech Demo of the DragonRuby Game Toolkit — For some reason, the DragonRuby Game Toolkit hasn’t quite caught my imagination yet, but it’s fun to see what other people are achieving with it, and this demo is pretty neat for only a few hundred lines of Ruby. (Video example included – yes, did you know you can host videos on GitHub gists now?)

Amir Rajan

Or if you prefer your games to be a bit more textual..

An Experiment in Building a Roguelike in Ruby — Very early days for this passion project by a developer who is keen for feedback – it’s more a maze game so far, but he explains his work quite well in the README.

David Silva