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.
Introducing dry-files
A library for file system abstractions, error handling, file management, including Ruby file manipulation. It also ships with an in-memory adapter for unit tests. https://dry-rb.org/news/2021/05/04/introducing-dry-files/
Fighting the primitive obsession with Value objects
My previous post on read models intended to address something different, but I decided to focus on read model part and leave the other topic for a different one. There’s one thing which I dislike in the implementation. Using primitives to calculate the scores. [more inside]
How to build a read model with Rails Event Store Projection
Recently I faced interesting challenge in one of our customer’s application. Imagine that you take a test after which you get a personalised reports about your skills level. Existing mechanism for that was time and resource consuming. People had to wait for e-mail delivery with PDF-generated report several hours due to several constraints, which I would prefer not to dive into. [more inside]
Semantic blind spot in Ruby case statement
Mutation testing is great at semantic reduction of the code. Read on to see the case of reducing a case statement and the blind spot it discovered. [more inside]
Building a Discord bot in Ruby on Google Cloud Functions
I recently spent a weekend experimenting with the Discord API and writing a command for my church’s Discord server, all in Ruby of course. This is a series of four articles that step through the process, including setting up Discord integration, deploying the implementation to Google Cloud Functions, handling secrets and auth, and setting up an event-driven architecture. https://daniel-azuma.com/blog/2021/04/30/discord-command-in-ruby-on-google-cloud-functions-intro
Building a Questionnaire
Using StimulusJS and nested forms, we create the first parts of a questionnaire. Dynamic surveys can be difficult to architect and maintain. In this episode, we take a simple approach to creating questionnaires. https://www.driftingruby.com/episodes/building-a-questionnaire
12 Most Asked Questions About Ruby on Rails
Check out the 12 most questions asked about Ruby on Rails. Link: https://thedevpost.com/blog/12-most-asked-questions-about-ruby-on-rails/
Ruby on Rails App to manage covid vaccination in your city
Agenda Saúde is a Ruby on Rails application that has been used since last year to manage the vaccination queue of Covid-19, H1N1, and PCR tests. The project is developed by the local open-source community of Joinville, Brazil in collaboration with the city hall and local companies. [more inside]
Pushing Rails validations down to the database?
Ever open up a Rails console to debug a problem and come away wondering how the data got so funky? Despite our best efforts the database will accept plenty of garbage data if you let it. Find out how to manage it and prevent it where we can. [more inside]
Rails console trick I had no idea about
And this ain’t another .irbrc customization: [more inside]
Truemail 2.4.0 has been released 🚀 configurable plain Ruby 📨 email validator
Added ability to use MX blacklist validation. This validation layer provides checking extracted mail server(s) IP address from MX validation with predefined by user blacklisted IP addresses list. It can be used as a part of DEA (disposable email address) validations. Be sure that email address valid and exists. https://github.com/truemail-rb/truemail
Linting Ruby Code
Let’s take a look at what linting is and a few problems that come with it. https://blog.appsignal.com/2021/04/28/ruby-linting.html
Decorate your runner session like a pro
In this post I describe how to execute some custom code when your script is run by Rails runner. You can use that to notify external services when your script finishes or to prepare some initial data before your script starts. [more inside]
How to balance the public APIs of an open-source library — practical examples from Ra
On twitter, Krzysztof asked an interesting question: what are our thoughts on carving a well-balanced API for an open-source library that RailsEventStore is. [more inside]
Introducing attributes_sanitizer Rails Gem
Have you ever needed to sanitize data before sending it to the database? Do you need to ensure that a string should be always saved in lowercase without extra spaces? The attributes_sanitizer gem can help you with that. Extracted from a real project, it makes it possible to easily set up attributes sanitization for Rails 5+ projects. [more inside]
Understanding Insertion Sort in Ruby
There are lots of ways to sort data. Insertion sort is particularly interesting because it sorts the data in place and is pretty easy to understand. Of course, most of us just use the #sort method. But interviewers still love to ask questions about sorting algorithms and related topics like Big-O notation. In this post, you’ll learn not only how insertion sort works but also how to implement it yourself in ruby. https://www.honeybadger.io/blog/ruby-insertion-sort/
Importing posts from external source into Nanoc
A tutorial on adding external source of content into Nanoc static-site generator: https://mostlyobvio.us/2021/04/importing-external-posts-into-nanoc/
Audiobook streaming platform with Ruby on Rails and AWS stack
I recently was faced with the problem of setting up an audiobook streaming platform on AWS using Ruby on Rails and VideoJS. I described the challenges I encountered in the series of blog posts: https://rubywizards.com/series/audiobook-streaming
Growing Rails - Utilizing Form Models for complex validations or side effects
I explain advantages of introducing Form Models as a First Class Citizen under app/forms, and show you our ApplicationForm base class, including parameter coercing, validations and Strong Params “auto permitting” without any dependencies besides Rails. [more inside]
huge update to Rails Performance gem (free alternative of NewRelilic)
https://github.com/igorkasyanchuk/rails_performance got a major update (added support for grape, rake tasks, delayed_jobs, custom event tracking, and several bug fixes). [more inside]