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.
Why Dry: An Introduction to dry-rb and Why You Should Use It
Learn all about dry-rb gems and how they can help provide a robust, testable, and scalable way of handling business logic in your Rails applications. Read the post.
Write test for data migrations
Today I heard a funny story at a local Ruby meetup. A guy corrupted data in production by a data migration. Don’t repeat his mistake, use this gem. It’s not super popular, but has been tested over time. Surprisingly, people still use it and seem satisfied. Any contribution is welcomed!
Clean your Rails routes: grouping
In Rails, it’s important to find a way to order and maintain your routes.. SEE MORE
Custom RuboCops to support your code-reviews
Running RuboCop in your CI is a great way to enforce a commonly agreed upon style-guide and best-practices. [more inside]
Rails migration for belongs_to with custom table name
Check out my recent post describes how to specify a belongs to association in Rails migration with a foreign key to custom table name. Spoiler: as the result it has improved Rails docs!
rubynews gem - what's news in the ruby world? browse week by week - 30+ channels
Hello, I’ve put together a new command line tool using the Pluto News machinery that lets you browse ruby news week by week. Let’s welcome the rubynews gem package. Type: $ rubynews
to run. Resulting in: Welcome to Ruby News v1.0 (30 Channels, 940 Items) ... A Migration Path to Bundler 2+ ... Happy new year & Sinatra 2.0.8! ...
. Cheers. Prost. PS: Find the 30 built-in news channels / feeds for easy (re)use in the planet.ini configuration file.
How I MITM'd rubygems.org ... Kinda
An exploration of how I ran a Man in the Middle server against rubygems by using a domain typosquat
Build a WhatsApp chatbot with Ruby, Sinatra and Twilio
In this post we’ll get started building a simple chatbot that can respond to different keywords over WhatsApp, sending back pictures about dogs or cats based on the message you send it. We’ll use Sinatra and the Twilio API for WhatsApp to build ourselves a chatbot.
Net::HTTP is not your API client
Firing off one request is not enough to interact with APIs in production. If you are not willing to add the boilerplate code to add the necessary robustness - please use a library [more inside]
Decoupling Ruby: Delegation vs Dependency Injection
We’ve all worked with tightly-coupled code. If a butterfly flaps its wings in China, the unit tests break. Maintaining a system like this is…unpleasant. In this article, Jonathan Miles dives into the origins of tight-coupling. He demonstrates how you can use dependency injection (DI) to decouple code. Then he introduces a novel decoupling technique based on delegation that can be useful when DI is not an option. https://www.honeybadger.io/blog/decoupling-ruby-delegation-dependency-injection/
Maintainable Rails email course
Is your Rails app outdated, unwieldy, or….off the rails? Do you struggle with spaghetti code or technical debt? Get one tip each week sent to you to help get it under control. [more inside]
Correios CEP gem updated
Find Brazilian addresses by zip code, directly from Correios database. [more inside]
date-formatter gem - date formatter by example; auto-builds strftime format string
Hello, I’ve put together a new date formatter gem that lets you format dates e.g. “January 02, 2006” using an example as a format string e.g “January 02, 2006” instead of the classic strftime format specifier e.g. “%B %d, %Y”. The date by example adds: String#to_strfime, Date#format, Time#format, DateTime#format, NilClass#format to the built-in classes for easy use. Happy date and time formatting. Cheers. Prost.
The Top Ruby HTTP Clients to use in 2020
So you want to make HTTP requests in your Ruby project, but you are not sure which clients to use? Have a look to the list of the top Ruby HTTP clients and pick the one that fits you best.