Rubyland

news, opinion, tutorials, about ruby, aggregated
Sources About
Benito Serna 

Solve n+1 queries and slow counts with counter caches

Sometimes calculating the count of a collection on every page render, even in SQL, is not the best option.

Imagine that you need to render a post, with its count of likes and comments, but the post has thousands of likes and comments. That would be slow.

One solution is to save the count of those comments and likes in the record, and when you need to render the post, instead of counting the elements again, just display the count that you already saved.

Keeping that count in sync is not easy, but rails makes it easy for us with a feature called “counter cache”.

Here I will show you how you can use a counter caches, how to introduce it in an existent association and some tips to work with…

Ruby on Rails 

Welcoming Ryuta, Jean, John to Core and Yasuo, Jonathan to Committers

I’m thrilled to announce three new awesome members to the Rails Core team, which will increase the total number of core members to a cool twelve, and help ensure we have even more bandwidth to process the thousands of pull requests that go into every new major version of the framework.

First up is Ryuta Kamizono, who’s been contributing to Rails since 2013, and has a staggering 4500+ commits to his name. He’s the fourth most prolific committer overall, and has been instrumental in improving Active Record in particular. Ryuta is from Tokyo, Japan, making him our first core member from Ruby’s home country!

Next we have Jean Boussier, who’s been contributing to Rails since 2011, on a journey…

Shopify Engineering - Shopify Engineering 

Lessons Learned From Running Apache Airflow at Scale

The RubyMine Blog : Intelligent Ruby and Rails IDE | The JetBrains Blog 

RubyMine 2022.2 EAP is Open!

Hi everyone,

The Early Access Program for the upcoming version 2022.2 of RubyMine is now available. As always, you are welcome to try the new features before the official release, and we are looking forward to hearing your feedback.

RubyMine 2022.2 EAP

Here are the main highlights of the first EAP build:

Debugger

We’ve improved RubyMine’s debugger to make it more robust for Ruby 3 and onward. Starting with this EAP, you should be able to debug your Ruby 3 and up code without any major issues while using all the fancy features provided in the GUI, such as stepping through the code, evaluating expressions, and so on. We also fixed issues in the previous debugger implementations, so if you are running an older…

Josh Software 

PART 1 – How to create JIRA Dashboards: An effective way of Agile project management

Now a days all the projects are managed the Agile way and project management activities are performed using different tools which helps the teams to manage the projects in an effective way. Once such and popular management tool is JIRA. JIRA offers tool for project management options and one such very popular tool is JIRA … Continue reading PART 1 – How to create JIRA Dashboards: An effective way of Agile project management
DEV Community: Truemark Technology 

Setup Action Mailbox with SendGrid

Rails 6 released with many awesome features and action mailbox was one of them that has come to make the life easier. From Official Action Mailbox Guide:

Action Mailbox routes incoming emails to controller-like mailboxes for processing in Rails. It ships with ingresses for Mailgun, Mandrill, Postmark, and SendGrid. You can also handle inbound mails directly via the built-in Exim, Postfix, and Qmail ingresses.

Basically, Action Mailbox can be used to forward all incoming emails to your Rails app and process it further as required like storing attachments, creating records from the email body in you database and many more.

And today, we will be implementing Action Mailbox with SendGrid.

Ruby in Better Programming on Medium 

Integrate Google Maps With a Rails App

A how-to guide

Photo by GeoJango Maps on Unsplash

I was recently adding a feature to one of my Rails projects that would allow the user to input a location and get back a list of breweries with an interactive map. The Google Maps API is obviously a popular choice for this but I was surprised to see that there are not a whole lot of resources online for incorporating it into a Rails app. To remedy this, let’s take a look at how one can go about making custom maps with this guide.

Setup

First things first, let’s set up the space where the map will go. In the view, file make a section for the map. Give it a simple id like “map”.

https://medium.com/media/1b81aaef8261c3fdaeafdd37ae390737/href

Sign up…

Honeybadger Developer Blog 

Event Streaming in Rails with Kafka

Companies want to react quickly to the need of processing and sharing large amounts of data in real time to gain insights and create more engaging customer experiences. So, traditional data processing is no longer viable in today’s world.

To achieve that, you need to process a lot of data as fast as possible and then send it to other services for more processing. But in the middle of all these quick actions, it's necessary to notify consumers when the event occurs—and we can do just that using event streaming.

This is the repo in GitHub that we will be using.

Events

Before talking about event streaming, let’s talk about what an event is. An event that happens within an application can…

BootrAils 

Rails 8 : unreleased features

Rails 8 : More confidence in existing tools

Rails tend to anticipate the trends - which means how neat are the maintainers. ActionText is one example. Before Trix, let's face it, giving any non-techie user the ability to write content was quite costly - or painful. Nowadays however, there are better tools than Trix. Simple features like "please create a <p></p> paragraph for every new paragraph" are still not released after years of PRs and requests from the community. I know, Open Source is given for free, and we should acclaim maintainer first instead of complaining. So first, a big thank you to all maintainers. Now for the Rails team, we would see two viable options :

  • Make Trix stay on…
Notes to self 

Understanding ViewComponent concepts by building a button

The ViewComponent library from GitHub is becoming a popular answer to building design systems in server-rendered Rails applications. Let’s understand the basics by creating a fancy component button.

What’s in the component

For the purposes of this post, a component is an encapsulation of a reusable piece of a view template responsible for its rendering. Components can technically be unique, but the core idea is to build common reusable parts and stay away from one-off components. Think buttons, alerts, or icons.

At its core, a component in a ViewComponent system is just a piece of Ruby code. It’s an object that calls its call method for rendering content:

class LinkButtonComponent < Vie…
Ruby on Rails 

Bugfixes, guides improvement and more!

Hi, this is Greg, bringing you the latest news from the Rails world.

Add ability to ignore tables by a regular expression for SQL schema dumps It was already possible to ignore tables by a regexp for ruby schema dump, but from now on if you use a SQL based structure dump, you can do so to by configuring ActiveRecord::SchemaDumper.ignore_tables = [/^_/]

Add skip_nil: support to RedisCacheStore This change allows RedisCacheStore to also accept a default value for skip_nil.

Support unbounded time ranges for PostgreSQL This PR fixed an issue when passing unbounded ranges to PostgreSQL.

Fixes Active Storage proxy downloads of files over 5Mb in S3-like storages Downloading files over 5Mb in…

Graceful.Dev 

Site News #12: Course-Splosion!

Hiya graceful devs! I know it’s been a while since I’ve written an update. This isn’t because there’s nothing new on the site. It’s actually because I’ve been deep in one of the most ambitious content improvements in the combined history of RubyTapas and Graceful.Dev!

So, as you know if you’ve been a member for a while, Graceful.Dev’s content is dominated by the nearly decade-long run of RubyTapas episodes now found in The Tapastry, spanning over 650 topics. Because I’ve always leaned towards covering subjects with perennial value, 99% of that material is still relevant to anyone using Ruby for work or play. But for someone who wasn’t following RubyTapas from the beginning, it’s a…

Shopify Engineering - Shopify Engineering 

Asynchronous Communication is the Great Leveler in Engineering

Remote Ruby 

Dealing With Perfectionism As A Developer

[00:02:49] Jason and Andrew have been working on some GitHub actions and what’s been going on with that. Also, Jason and Chris challenge Andrew to do the typing speed test before the end of this episode! ☺


[00:06:07] We hear about a cool thing Andrew’s been working on, Chris and Jason tell us they ran out of build minutes, and Andrew mentions “act” to test your Actions locally.


[00:08:54] Chris and Jason have a great discussion on perfectionism and writing code, and they share their struggles.


[00:27:23] Chris asks Jason how he feels about testing is one example of something that you can easily get to that point of perfectionism. Jason explains how he’s been thinking about this lately…

Awesome Ruby Newsletter 

💎 Issue 313 - Shopify Invests in Research for Ruby at Scale

Hi, we're Arkency 

Keep your team up to date on production data changes

Keep your team up to date on production data changes

It is not uncommon for Ruby developers to manipulate production data via Rails console. Sometimes it is just necessary. The crucial thing is to leave a trace of what commands you have issued.

  • Maybe you would be asked to do similar modifications again in the feature.
  • Possibly something would go wrong, and you will have to analyze what.
  • I am sure you want to keep our teammates informed on what is going on.

There are many more reasons to have some kind of logging.

In his blog post, Paweł showed how to load the helper module with the Rails console’s start. This time, in an analogous way, we will “hack” our console to get Slack…

OmbuLabs Blog 

Design Sprint Day 1

Let's deep-dive into what happens on the first day of a Design Sprint. On Mondays, we understand the problem.

I want to give credit to the creators of the Design Sprint method, Jake Knapp, John Zeratsky, and Braden Kowitz from Google Ventures who developed this Design Thinking method in the mid 2010s. Their process is the starting point from which all variations of Design Sprints come from, and I work with their framework to create Design Sprints that are customized to suit client needs.

Design Sprints don’t have to follow the exact Google Ventures format to be successful. There are shorter sprints that can be done over the course of a couple days or even 6 hours, or ways to extend the…

Ruby Rogues 

The Joy Of Structs - RUBY 546

Is it a class? Is it a hash? No, it's Ruby Struct! Brooke Kuhlmann joins the Rogues to explore this often-overlooked object. We extend simple structs with refinements, use pattern matching to compress complex logic and close the door on OpenStructs. Brooke talks about the challenges and rewards of introducing busy teams to advanced techiques, software craftsmanship and the transformational philosophy of alchemists.io.

Sponsors

Links

Ruby Weekly 

Shopify's big investments into Ruby's future

🇺🇦 #​604 — May 19, 2022

Read on the Web

Ruby Weekly

Shopify Invests in Research for Ruby at Scale — This is exciting! If you’ve kept an eye on industry comings and goings in recent years, you may have noticed Shopify has brought together quite the team of Ruby and VM experts (whether through direct hires or collaborations) and it’s only continuing – this bodes extremely well for Ruby and reminds me somewhat of when Google went all in on V8..

Chris Seaton (Shopify)

Using Scientist to Refactor Critical Rails Code — We’ve mentioned Scientist a few times over the years as a neat way to introduce change to an…

Hanami 

Announcing Hanami v2.0.0.alpha8

After a month’s break, we’re back with another Hanami 2.0.0 alpha release for you all!

This release includes new base action and view classes, plus a few small fixes.

New base action and view classes

This release includes new base classes for actions and views that integrate with their surrounding Hanami application: Hanami::Application::Action, Hanami::Application::View, and Hanami::Application::View::Context. Your base classes should now look like this:

# lib/my_app/action/base.rb:

require "hanami/application/view"

module MyApp
  module Action
    class Base < Hanami::Application::Action
    end
  end
end
# lib/my_app/view/base.rb:

require "hanami/appl…
Sandip Mane 

Git - delete local branches

After working on a project for a while, we normally end up having too many branches locally.

I cleanup all github branches from my local using the following command. Thought to share it for all those OCD’ians out there!

Delete merged branches except default

If you’re someone who do not want to lose unmerged branches, use this command.

git branch --merged | grep -v \* | xargs git branch -D

Delete all the branches except default

Personally, I push all the branches to git as soon as I create them, so it’s not a dealbreaker for me to delete them from local.

git branch | grep -v \* | xargs git branch -D
Saeloun Blog 

React 18 adds onResize event to video elements

SyntheticEvent in React is a cross-browser wrapper similar to browers’s native events; It has the same interface as the browser’s native event, including stopPropagation() and preventDefault(), except the events work identically across all browsers.

Until React 18, React’s synthetic media events contain several existing media events, for instance onLoadedMetadata and onVolumeChange. But there is no onResize handler.

Before

<video> element with a onResize prop would display a warning

Warning: Unknown event handler property `onResize`. It will be ignored.

After

With the changes in React 18, onResize props are added to <video> element that triggers when one or both of the videoWidth and

BootrAils 

Ruby pattern matching

Ruby : what is pattern matching?

If you are new to the feature, welcome to the typical "Pattern matching journey"; where first, you don’t know what it is, then, you don’t understand it, and finally, you don’t know how you could work without it.

The pattern matching feature consists in checking data given an expected result or pattern. Some people tend to confuse pattern matching with Regex (Regular Expression), because this searching tool allows us to find and replace string searchable patterns. Pattern matching is much more than that, we could say it is the evolution of Regex, as it enables us to work with not only string patterns but arrays, hashes, and any other object.

Using pattern…

Test Double Blog 

Please mock me

This lightning talk was recorded at RailsConf 2022 in Portland, Oregon. It shows off our new mocking library for Ruby, Mocktail.

It’s a bit of a whirlwind, so don’t feel bad if anything goes over your head! Please feel free to take your time perusing the library’s expansive README.

If you’re looking for another talk on this topic, consider watching the companion talk, Please don’t mock me. It’s a much longer talk, and so it takes the time needed to discuss some of the patterns and pitfalls to keep in mind when using test doubles in your tests.

00:00
- Okay, so the title of this presentation is
00:01
"Please Mock Me."
00:02
So hello everyone, Portland.
0…
Andy Croll 

The Mrs Triggs Problem

First given at RailsConf 2022 in Portland on Thursday, 18th May 2022.

Thanks to Emma, Vaidehi, Nadia and Jemma for reviewing early versions of this talk and their invaluable notes.

And particularly to my other half, Jo.

Abstract

“That’s a good suggestion Mrs Triggs, perhaps one of the men in the room would like to make it?”

As a society we have an attribution problem. People who look like me get it easy. Let’s push back on the default stories & myths of the programming community.

Warning, may contain content that will make you uncomfortable about your own past behaviour. But you’ll leave better able to provide a better industry for your fellow humans.

Video

…will end up here…

Furth…

Honeybadger Developer Blog 

Linting and Auto-formatting Ruby Code With RuboCop

Linting is the automated checking of source code for programmatic and stylistic errors. This checking is performed by a static code analysis tool called a linter. A code formatter, however, is a tool concerned with formatting source code so that it strictly adheres to a pre-configured set of rules. A linter will typically report violations, but it's usually up to the programmer to fix the problem, while a code formatter tends to apply its rules directly to the source code, thus correcting formatting mistakes automatically.

The task of creating a more consistent code style in a project usually necessitates the introduction of a separate linting and formatting tools, but in some cases, a…

Shopify Engineering - Shopify Engineering 

Double Entry Transition Tables: How We Track State Changes At Shopify

RubyGems Blog 

3.3.14 Released

RubyGems 3.3.14 includes enhancements.

To update to the latest RubyGems you can run:

gem update --system

To install RubyGems by hand see the Download RubyGems page.

## Enhancements:

  • Installs bundler 2.3.14 as a default gem.

SHA256 Checksums:

  • rubygems-3.3.14.tgz
    81e83c2f42c5335457b7209aa965143654d4dce660e2fa4ded47c63dac3b11b9
  • rubygems-3.3.14.zip
    b1fac5481605de4082f7d553d8ea07f6391db6a892f8a7c131809893fd09e860
  • rubygems-update-3.3.14.gem
    5c5a8b3c39d1e38f3dd5d2562a7e4d30eda50635d3b590390c7c893736032972
Ruby Magic by AppSignal 

Using Scientist to Refactor Critical Ruby on Rails Code

Ask any software engineer to review key portions of production code, and inevitably, they will point out three things that need to be refactored. So why does so much bad, brittle, or misunderstood code remain running in production?

The answer is simple: engineers are afraid to touch it. Refactoring tasks get identified and added to the backlog, but rarely make it into the current sprint.

There are numerous reasons for this. The code may have been written by an engineer who left the team years ago, and no one completely understands it. In other cases, the capability is critical to the business. No one wants to be responsible for a potential outage or loss of revenue.

In this post, we'll…

The Ruby on Rails Podcast 

Episode 418: Flash Forward to Railsconf Day 2 with Andrea Fomera

Andrea Fomera is a Senior Software Developer at Podia who finds enjoyment in updating dependencies and crafting high quality, robust and maintainable code. She and Brittany flash forward to Railsconf Day 2 to discuss Andrea's talk, goals for the conference and an epic quest to find the best donut in Portland.

Show Notes & Links:

Sponsored By:

AppSignal

Monitor your apps from A to Z: error tracking, performance insights, server metrics, uptime pages, custom dashboards, and more. AppSignal works for all popular Ruby frameworks and automatically instruments and creates…

Saeloun Blog 

Saeloun's Company Retreat to Goa

Our team at Saeloun thought of no better way of celebrating the company’s 3rd anniversary than a wholesome office retreat to Goa. Another major motive was to foster bonding among team members. As we are a remote company working from different parts of the world, a company trip sounded like an amazing plan to break through the remote team dynamics and hit the refresh button.

Not to mention, it was a huge success. We witnessed a boost in company morale and our new employees, especially the freshers got an opportunity to bond with the entire Saeloun team. So, without much ado, let’s dive right in and unravel some of the best moments we had in Goa.

Day 1

It was a 3-day trip…

Code with Jason 

146 - Build, Measure, and Learn with Ufuk Kayserilioglu

In this episode, Ufuk Kayserilioglu and I discuss the Lean Startup methodology and how it relates to the scientific method and the build, measure, learn loop, how to come up with ideas for businesses, sharpening up a business concept with the Lean Canvas, the real reasons people go to conferences, and how to measure success.

Benito Serna 

4 things you can try before using a counter cache in rails

Maybe you have heard about the counter cache feature.

A counter cache makes finding the number of belonging objects more efficient by keeping a column with the count.

Rails makes it easy to implement it, but is not free. Sometimes it may be better not to use it.

Here are four things you could try before or instead of using a counter cache, without introuducing n+1 queries.

1. If you don’t need the count in a list just count the records

If you don’t need to use the count inside a list, and instead you just want to show the count of the association in a details or stats page, you can try to count the records via SQL using count or size.

post = Post.first
# Post Load ...
post.comments.size
BootrAils 

Ruby-on-Rails : Le Wagon, a review

Le Wagon coding bootcamp : why

BootrAils could be something that will help you after the coding bootcamp is over. Before this, let's see why you should enter the arena.

Are you considering a new career path in the tech industry? Do you want to learn how to build an application from scratch or improve your coding skills?

During the past years, many companies have developed new educational programs that aim to train and develop the coding skills of students that are new or have basic knowledge in the matter. These programs are usually referred to as Bootcamps, as they offer a full time and immersive learning experience that guarantees you will get the aimed knowledge in a short time (usually…

The Bike Shed 

338: Meticulously Wrong

Chris switched from Trello over to Linear for product management and talks about prioritizing backlogs.

Steph shares and discusses a tweet from Curtis Einsmann that super resonated with the work she's doing right now: "In software engineering, rabbit holes are inevitable. You will research libraries and not use them. You'll write code just to delete it. This isn't a waste; sometimes, you need to go down a few wrong paths to get to the right one."


This episode is brought to you by BuildPulse. Start your 14-day free trial of BuildPulse today.


Linear
Curtis Einsmann Tweet
Louie Bacaj Tweet


Become a Sponsor of The Bike Shed!

Transcript:

AD: Flaky tests take the joy out of…

Kevin Newton 

Syntax Tree and lambda-local variables

I just released version 2.6.0 of Syntax Tree. Along with a couple of other changes, this includes support for lambda-local variable declarations. This was a bit of a journey, so I thought I’d write up how I discovered this syntax, how I added support for it to Syntax Tree, and go ahead and plug Syntax Tree one more time as something that should be merged into Ruby core.

If you want to skip straight to the code, here’s the pull request.

lambda-local variables

What are lambda-local variables? (Side note: I have no idea if that’s the correct terminology. I might be making it up.) You may be familiar with block-local variables. If you’re not don’t worry about it — you’re certainly not the…

Ruby Together News 

RailsConf2022 Speaker Spotlight: Vladimir Dementyev

RailsConf2022 Speaker Spotlight: A Tech outsider’s picks

RailsConf2022 boasts an exciting variety of tracks and talks that highlight the creativity and interdisciplinary nature of the Ruby community. As a tech sector newcomer, I thought it would be fun to curate a series highlighting talks that immediately captured my curiosity, and get to know their respective speakers a little better. Read on for today’s speaker spotlight…

Title of Talk:

The pitfalls of realtime-ification

Speaker: Vladimir Dementyev

746350A4-C9BF-4633-88BA-26A031F3458B - Vladimir Dementyev.jpeg

How Did you get into Ruby?

I was looking for an alternative tech to rebuild my product, and found an online course titled “Building SaaS web applications with Ruby on Rails”. That was…

Martian Chronicles, Evil Martians’ team blog 

Soft deletion with PostgreSQL: but with logic on the database!

Authors: Andrew Kozin, Back-end Developer and Travis Turner, Tech Editor at Evil Martians

Any developer eventually faces a challenge: making significant changes to large code bases. But here, I’ll walk through an unorthodox solution which allows all the application code’s complexity to remain untouched thanks to the might and power of the underlying database! It’s soft deletion, but we’ll put the logic in the database itself. Keep reading for the ‘how’ and ‘why’!

While this post is primarily about PostgreSQL, I’ll need to touch the application code a couple of times. Since Ruby on Rails is the stack I have the most experience with, I’ll be using it in my examples. Although Rubyists…

Shopify Engineering - Shopify Engineering 

Shopify Invests in Research for Ruby at Scale

The RubyMine Blog : Intelligent Ruby and Rails IDE | The JetBrains Blog 

RubyMine 2022.1.1 Is Available

Hi all,

RubyMine 2022.1.1, the first bug-fix update for the current major version, is now available.

You can update using the Toolbox App, right from inside the IDE, or by downloading RubyMine 2022.1.1 from our website.

With this update we fixed the issues that were caused when Rails 3 support was discontinued. Please read our statement on the retirement of Rails 3 and other outdated features.

You’ll find the following improvements in this update:

  • The debugger now supports Ruby 3: RUBY-27310.
  • Support for injected JSON in .liquid files is available: RUBY-27525, RUBY-28058.
  • We fixed an issue with generating arguments for Rails servers: RUBY-29617.
  • We fixed a number of RBS issues: RUBY-29524, …

See the release notes for the complete list of closed tickets, and, as always, please report any issues you encounter.

Happy developing!
The RubyMine team

The RubyMine Blog : Intelligent Ruby and Rails IDE | The JetBrains Blog 

RubyMine Plans to Retire Support for Rails 3 and Other Outdated Features

Dear all,

As some of you already know, RubyMine 2022.1 was shipped without support for Rails 3. The reason for this decision was quite simple: Rails 3 reached End Of Life many years ago, and most of you had long since switched to the newer Rails releases. Hence, continuing to support Rails 3 in RubyMine simply didn’t seem practical given the amount of effort that would have been involved.

However, we didn’t communicate this decision in a clear and timely manner, which resulted in reasonable questions from some of our users who still use Rails 3. We would like to apologize for that and assure you that we fixed the issues that were caused when Rails 3 support was discontinued as part of the…

Alfredo Motta 

The messy middle – 5 Software Engineering lessons from a 5 years startup journey

Introduction These are some of the lessons that I have learned over my 5 years at a Fintech startup that went from 0 to 100k customers and grew the team from 4 to 50 people. It would be hard for me to identify what we did to put us in this fortunate position; the market...
Ruby on Rails 

More async queries, pattern matching and no more autoclosed PRs!

Hi, this is Petrik, bringing you the latest news from the Rails world.

Async aggregate and find_by queries
Active Record async support was limited to loading collections, but among the not so fast queries that would benefit from asynchronicity you often find aggregates as well as hand crafted find_by_sql queries.
We now support the following methods:

  • async_count
  • async_sum
  • async_minimum
  • async_maximum
  • async_average
  • async_pluck
  • async_pick
  • async_find_by_sql
  • async_count_by_sql

Allow CSRF tokens to be stored outside of session

When sessions are not stored in cookies, millions of sessions may be created and constantly evicted just for the CSRF token. This new configuration…

Honeybadger Developer Blog 

Understanding the Ruby Object Model In Depth

According to Wikipedia, object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code: data in the form of fields (often known as attributes or properties) and code in the form of procedures (often known as methods).

Ruby is a pure object-oriented language, which means that in the Ruby language, everything is an object. These objects, regardless of whether they are strings, numbers, classes, modules, etc., operate in a system called The Object Model.

Ruby offers a method called the object_id, which is available to all objects. This identifier returns an integer and is never the same for any two objects. Let's get into irb to…

Stefan’s Blog 

Dev-Links #19 - Ruby + JS

After a longer break from this type of post, here a collection of random Ruby + Javascript resources that I found recently.

GitHub - nevir/Bumbler: Track the load progress of your Bundler-based projects

Track the load progress of your Bundler-based projects - GitHub - nevir/Bumbler: Track the load progress of your Bundler-based projects

Already shove a whole second on each app run by un-require rubocop

GitHub - dropbox/zxcvbn: Low-Budget Password Strength Estimation

Low-Budget Password Strength Estimation.

Dropbox’ made password estimation tool. Also available as Ruby-code to give the user a meaningful estimate about the security of their password.

gem-compare goes 1.0

A tool to diff Gem versions before bundle updating all the stuff. See if meaningful code changed, license, deps changed etc.

Sorbet + 100% cov makes Ruby refactoring…

Giant Robots Smashing Into Other Giant Robots 

A Case for Query Objects in Rails

You may have heard of query objects before: their main purpose is to encapsulate a database query as a reusable, potentially composable, and parameterizable unit. When is it best to reach for them and how can we structure them? Let’s dive into this topic.

Reusing query filters

In Rails, it’s very easy to create database queries. Provided that we’ve defined an Active Record model, we can easily construct an ad-hoc database query:

ServiceOffering
  .where(state: "CA")
  .joins(:vendor)
  .where(vendors: {education_level: "Kindergarten"})

If we spread queries like that throughout our application but need to change how the “education level” filter works, there will be…

Shopify Engineering - Shopify Engineering 

Maestro: The Orchestration Language Powering Shopify Flow

Ruby in Better Programming on Medium 

A Small Tip to Reduce Your Docker Images Size by Almost Half

Optimize your Docker images

Today I want to explain a small tip I recently found out to reduce the Docker images size, in my case I was able to reduce the size by half!

Let’s assume that you are working with a language like Ruby or Python, even if these languages are not compiled they often need some system libraries to work properly, in particular, if you are working with databases (MySQL, SQLite, Postgres) you need to compile the gem or the library for the specific architecture of your machine.

In my case, I’m working with Ruby and I’m trying to install the SQLite gem that, unfortunately, requires the build-base system library.

Here is the project I’m working on: Faenz Analytics

GitHub -…

Remote Ruby 

Twitter Q&A and Railsconf Advice For First Timers

[00:01:22] Andrew tells us about a blog post he put out about his Twitter profile image and some stuff he did with his GitHub actions repo.


[00:05:29] The Tweet sharing begins. Tweet #1 topic is someone who’s learning Rails, has no idea how to read the documentation or where to go, and getting lost easily. 


[00:13:55] Tweet #2 topic is about Matestack, and Jason brings up a previous episode they did where they talked about it with Jonas Jabari.


[00:14:47] Tweet #3 topic is about what first timers at RailsConf should know or do by the time this episode airs.  


[00:19:02] Andrew tells us about people giving massages in the exhibition hall and he’s going to be devasted if they don’t do…

Julia Evans 

sqlite-utils: a nice way to import data into SQLite for analysis

Hello! This is a quick post about a nice tool I found recently called sqlite-utils, from the tools category.

Recently I wanted to do some basic data analysis using data from my Shopify store. So I figured I’d query the Shopify API and import my data into SQLite, and then I could make queries to get the graphs I want.

But this seemed like a lot of boring work, like I’d have to write a schema and write a Python program. So I hunted around for a solution, and I found sqlite-utils, a tool designed to make it easy to import arbitrary data into SQLite to do data analysis on the data.

sqlite-utils automatically generates a schema

The Shopify data has about a billion fields and I really did…

Awesome Ruby Newsletter 

💎 Issue 312 - Shopify: Our Experience Porting the YJIT Ruby Compiler to Rust

Ruby Together News 

RailsConf On Tracks

RailsConf on Tracks

If you’re looking for a curated conference experience this year, you can allow the RailsConf 2022 program committee to choose your adventure and sit back and enjoy your journey through the conference via a track.

The conference tracks are listed on the program and can be chosen up until the moment the first session starts. If you do select a track, there’s no obligation to stay on it. You’re free to move between tracks, move in and out of a track, or start on a track and then move on to general talks if you’d like.

Or, “there’s always the hallway track,” as RailsConf 2022 program committee member Aisha Blake puts it.

But if you do decide to stick to a track through…

Martian Chronicles, Evil Martians’ team blog 

eBaymag magic: under the hood of the international eBay spinoff

Authors: Niki Voronov, Account Manager at Evil Martians and Olga Rusakova, Writer at Evil Martians

For more than 7 years at Evil Martians, the product development of eBaymag has been one of our signature projects. This undertaking has been much more than a simple cooperative effort with one of the world’s leading brands. Far beyond that, over the course of this project, we mastered designing a product and its UI from scratch. Further, we learned and implemented Growth Hacking strategies and utilized over 20 of our own open source products.

Starting way back in 2014—and right up until early 2022—Evil Martians has been the core technical team working on the eBaymag product, with our…

Ruby Weekly 

How Ruby's YJIT went Rusty

🇺🇦 #​603 — May 12, 2022

Read on the Web

Ruby Weekly

Shopify's Experience Porting the YJIT Ruby Compiler to Rust — A project to port YJIT to Rust (rather than using C, as most of CRuby is written in) has been underway for a while and progress is going really well. The Shopify-based team’s leader tells the full story here covering both the high and low points

Maxime Chevalier-Boisvert (Shopify)

Have You Investigated Honeybadger Lately?🕵🏽‍♀️ — Honeybadger is so much more than error monitoring! All new plans include cron monitoring, uptime monitoring, customizable public status pages, and more - all rolled…

BootrAils 

Ruby, the self keyword

What is self in Ruby

self is a reserved keyword in Ruby that always refers to the current object and classes are also objects, but the object self refers to frequently changes based on the situation or context. So if you're in an instance, self refers to the instance. If you're in a class, self refers to that class.

self refers to the context

Yes, the context is where your code is at any given moment.

If your code is inside an instance method, self is an instance of that class. In other words, self is an object.

Let’s try that, and output self. In order to do that we need to add it somewhere inside the object. Any method would be good for that.

def name
  puts self 
end
name
# => main

This…

Honeybadger Developer Blog 

A Complete Guide To Managing User Permissions In Laravel Apps

In the web development world, you'll often come across the terms "roles" and "permissions", but what do these mean? A permission is the right to have access to something, such as a page in a web app. A role is just a collection of permissions.

To give this a bit of context, let's take a simple example of a content management system (CMS). The system could have multiple basic permissions, including the following:

  • Can create blog posts
  • Can update blog posts
  • Can delete blog posts
  • Can create users
  • Can update users
  • Can delete users

The system could also have roles, such as the following:

  • Editor
  • Admin

So, we could assume that the 'Editor' role would have the 'can create blog posts', 'can…

Ruby Rogues 

Railway Oriented Development and DRY-Monads - RUBY 545

It's not every day that you learn a new approach to error handling for Ruby. Today Abiodun Olowode shares her insights with railway oriented programming (ROP), a functional programming technique that allows sequential execution of functions, not necessarily synchronous. The key concept is that each function can only accept and return Container of either Success or Failure. They also dive into the topic of dry monads, the gems that helps you achieve railway oriented programming in that it helps bind your methods together and give you a success or failure result.

In this Episode…

  1. What is railway oriented programming (ROP)
  2. Examples of ROP and dry monads
  3. Limitations of dry monads
  4. H…
Ruby Together News 

RailsConf2022 Speaker Spotlight: Andy Andrea

RailsConf2022 Speaker Spotlight: A Tech outsider’s picks

RailsConf2022 boasts an exciting variety of tracks and talks that highlight the creativity and interdisciplinary nature of the Ruby community. As a tech sector newcomer, I thought it would be fun to curate a series highlighting talks that immediately captured my curiosity, and get to know their respective speakers a little better. Read on for today’s speaker spotlight…

Title of Talk:

Computer science you might (not) want to know

Speaker:

Andy Andrea

1642469857797 - Andy Andrea.jpeg

How Did you get into Ruby?

As I was finishing up school, I got lucky enough to land an internship at a great company that primarily used Ruby on their various projects. Since then,…

Code with Jason 

Do I have to code in my free time in order to be a good programmer?

In programming interviews, job candidates are sometimes asked what kinds of side projects they work on in their spare time. The supposed implication is that if you work on side projects in your free time then that’s good, and if you don’t that’s bad.

This idea has led to a somewhat lively debate: do you have to code in your free time in order to be a good programmer?

The popular answer is an emphatic no. You can put in a solid 8-hour workday, do a kick-ass job, and then go home and relax knowing you’re fully fulfilling all of their professional obligations. And actually, you might even be a better programmer because you’re not running yourself ragged and burning yourself out.

But actually,…

Shopify Engineering - Shopify Engineering 

Our Experience Porting the YJIT Ruby Compiler to Rust

In this post, I want to give a nuanced perspective on our experience porting YJIT from C to Rust. I'll talk about the positives, but also discuss the things that we found challenging or suboptimal in our experience.

More

The Ruby on Rails Podcast 

Episode 417: Treading Water & Panel Planning (Brittany + Jemma)

Fresh off of treading water in a sweatsuit for a swim test, Brittany called up Jemma to do a live brainstorm for the Railsconf 2022 Podcast Panel. After discussing Jemma's team trip to London for Shopify, they go over the panel participants, moderation strategies and potential topics.

Show Notes & Links:

Sponsored By:

Honeybadger

Honeybadger makes you a DevOps hero by combining error monitoring, uptime monitoring and check-in monitoring into a single, easy to use platform. Go to Honeybadger.io and discover how Starr, Josh, and Ben created a…

RubyGems Blog 

April 2022 RubyGems Updates

Welcome to the RubyGems monthly update! As part of our efforts at Ruby Central, we publish a recap of the work that we’ve done the previous month. Read on to find out what updates were made to RubyGems and RubyGems.org in April.

RubyGems News

In April, we released new versions of RubyGems 3.3.11, 3.3.12 and Bundler 2.3.11, 2.3.12.

The main highlight of this month’s update is that RubyGems now has experimental built-in support for Rust extensions, thanks to the work done on #5175.

The following is a non-exhaustive list of other improvements included in the above releases (see the changelog for further information):

  • added modern versions of Ruby as valid platform values in Gemfile DSL…
Hanami Mastery newest episodes! 

#21 JSON Serialization with Alba in Hanami

Serialize your API responses in Hanami applications with alba - the fastest ruby serialization gem
Julia Evans 

Pages that didn't make it into "How DNS Works"

Hello! A couple weeks ago I released a new zine called How DNS Works.

When I started writing that zine (in, uh, January 2021), I originally had in mind a broader zine on “everything you need to know to own a domain”. So it had a bunch of pages on domain registration, TLS, and email.

At the time I thought “I can just explain DNS in like 5 pages, it’s not that complicated, there will be lots of space for other topics about domains”. I was extremely wrong about that and it turned out I needed all 28 pages to explain DNS. So I ended up deciding to just focus the zine on DNS and all those other topics didn’t make it into the final zine.

This morning it occurred to me that instead of letting…

Passenger - Phusion Blog 

Passenger 6.0.14

Passenger 6.0.14

Version 6.0.14 of the Passenger application server has been released. This release adds Ubuntu 22.04 "Jammy" packages, and removes Ubuntu 21.10 "Impish" packages.

Passenger 6 introduced Generic Language Support, or: the ability to support any and all arbitrary apps.

Updates & improvements

  • Removes use of rexml in passenger restart command, because it was removed from Ruby 3. Closes GH-2415.

  • Adds Ubuntu 22.04 "Jammy" packages, and removes Ubuntu 21.10 "Impish" packages.

  • Fixes a use after free regression introduced in 6.0.12.

  • Fixed a warning about ERB.new argument deprecation in Ruby 3.1. Closes GH-2417.

  • Removed use of google apis from error pages for easier GDPR compliance.

  • Update…

Installing 6.0.14

Please see the installation guide for advice…

Benito Serna 

When do you need a counter cache in rails?

Maybe you have heard about the counter cache feature.

It makes finding the number of belonging objects more efficient, by keeping a column with the count.

But… When should you use it? Do you need to have a counter cache for every association count in your app?

Here are three situations when you could need a counter cache.

When you have slow counts in your views

Even if you do the count via SQL, a single count can be slow enough to need a counter cache.

Imagine you need to put the number of likes in a post.

If a post could have thousands or millions of likes, a single count, can really hit the performance of the app.

posts = Post.find(id)

# If there are thousands or millions of likes
Code with Jason 

145 - Docker with Nick Janetakis

This week, I'm joined by Nick Janetakis for a discussion about the basic concepts and terminology of Docker.

BootrAils 

How to use Rails flash messages

What are flash messages?

Flash messages are notifications and alerts that pop up in the interface of an application in order to communicate with the user and ease of interaction. Applications often apply flash messages to tell the user if the login was correct or to confirm the success of the action triggered by clicking a button. For example:

  • "You are logged in"
  • "Your profile has been updated"

Side note : At BootrAils we use flash messages along with the . Toasts components of Bootstrap. More about this at the end of the article.

Why should you use flash messages in your application?

Flash messages are a good UI/UX practice that is currently used by most applications as it is a great…

The Bike Shed 

337: Oh, Henry

We've got a tricycle anniversary! 🥳 Will it be ruined by a cockroach?

Steph shares an update regarding some of the progress and discoveries that she's helped make with a client in regards to speeding up CI.

Chris is finally getting a little bit more back into the code at work and finds himself riding another time management struggle bus. P.S.: Who even names these apps?!?!


Children of Time
Maker's Schedule, Manager's Schedule
The Backwards Brain Bicycle - Smarter Every Day 133
Clockwise - Time Management For Teams
One month on Analog
Getting Things Done
Bullet Journal


Become a Sponsor of The Bike Shed!

Transcript:

STEPH: I have officially started recording. You are on the…

Ruby Rogues 

GraphQL with David Sanchez - RUBY 544

GraphQL is a flexible, strongly-typed query language. It's useful because it gives front-end developers the ability to query the database without many changes to the back-end. In this episode, David Sanchez explains how to design and build GraphQL APIs in Rails.

In this Episode…

  1. What is GraphQL and how do you get started with it?
  2. What are the advantages and disadvantages of GraphQL?
  3. What is REST and how do you integrate in your workflow?
  4. Common misconceptions with GraphQL
  5. What is GraphiQL and how does it differ from GraphQL?
  6. How to use max_depth in your queries.

Sponsors

Lin…

Kevin Menard’s Weblog 

Embedding Truffle Languages

Introduction

The past several years of my career have been spent predominately working on TruffleRuby, an implemention of the Ruby programming language that can achieve impressive execution speed thanks to the Truffle language implementation framework and the Graal JIT compiler. Taken together, these three technologies form part of the GraalVM distribution. The full distribution includes implementations of other languages (JavaScript, Python, R, and Java), an interpreter for LLVM bitcode (Sulong), tooling such as a profiler and debugger for both host and guest code (VisualVM), tooling to visualize decisions made by the JIT compiler (IGV), and the ability to generate native binaries of Java…

Ruby on Rails 

Rails 7.0.3, 6.1.6, 6.0.5, and 5.2.8 have been released!

Hi everyone,

I am happy to announce that Rails 7.0.3, 6.1.6, 6.0.5, and 5.2.8 have been released. This is a bugfix release that includes a fix for when applications are using Vue.js, Alpine.js and content_tag which was broken in the last security release.

Note that 5.2 will reach end of life in June 2022, so this is likely the final release of that version. We recommend upgrading to a newer version as soon as possible.

CHANGELOGS

Only gems with changes in the CHANGELOGs are listed below. All include a bugfix for rails#45014 and rails#44972.

To see a summary of changes, please read the release on GitHub:

7.0.3

Test Double Blog 

End-to-end Testing with Cypress Series: 08 DRY Test Setup

In this video, learn how duplicated test setup steps can make Cypress end-to-end test suites unmaintainable. Discover how to use helper functions like beforeEach and how to configure Cypress with the cypress.json file in order to simplify and reduce repeated test setup.


Additional resources:


00:00
(gentle music)
00:03
Welcome back to Test Double's intro course
00:06
on end-to-end testing with Cypress.
00:08
In the last video, you learned how redundant tests
00:11
can violate the DRY principle and slow down test suites.
00:15
You then discovered how to…
EquiValent 

Use Importmaps without Rails

Rails 7 embraced the use of Import maps and they are awesome.

If you wonder how to use importmap in plain HTML here is an example:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Import maps without Rails - Local-time example</title>

    <script async src="https://unpkg.com/es-module-shims@1.2.0/dist/es-module-shims.js"></script>
    <script type="importmap-shim">
      {
        "imports": {
          "local-time": "https://ga.jspm.io/npm:local-time@2.1.0/app/assets/javascripts/local-time.js"
        }
      }
    </script>
    <script type="module-shim">
      import LocalTime from "local-time"
      LocalTime.start()
    </script>

    <style>
     …
Notes to self 

A hybrid development Docker Compose setup for Rails

Lots of developers choose between dockerizing their development setup or leaving it as is. There is also a viable hybrid approach in combining Docker Compose with native processes.

I am usually in the camp of running things directly or creating Vagrant environments that closely resemble what I normally run. I also think a lot between introducing more layers than I need, so I usually run without Docker if I can.

Nevertheless, I realized that running a Docker Compose setup alongside your regular Puma and Sidekiq processes is actually a pretty nice sweet spot to be in. It’s what we use at Phrase.

Why, but why

The arguments for dockerizing the whole development environment are usually in…

Honeybadger Developer Blog 

How to Sell a One-time Purchase in Rails With Stripe

Used by millions of companies, Stripe provides payment infrastructure for applications to handle subscriptions and one-time purchases. Stripe Checkout allows us to easily accept card payments via a hosted payments page, which is crafted to increase conversions. Combining this with webhooks allows developers to sell products and subscriptions and then deliver them digitally.

While it's technically possible to handle payments yourself using an existing provider, Stripe provides a number of benefits. For starters, it's faster. Stripe has over 4,000 people working on making payments as simple, secure, and convenient as possible.

Furthermore, having your payments 'powered by Stripe' is an…

Code with Jason 

Ruby memoization

What is memoization?

Memoization is a performance optimization technique.

The idea with memoization is: “When a method invokes an expensive operation, don’t perform that operation each time the method is called. Instead, just invoke the expensive operation once, remember the answer, and use that answer from now on each time the method is called.”

Below is an example that shows the benefit of memoization. The example is a class with two methods which both return the same result, but one is memoized and one is not.

The expensive operation in the example takes one second to run. As you can see from the benchmark I performed, the memoized method is dramatically more performant than the…

Blog of WJWH 

Making type-safe internet bots with Haskell

Using the `conduit` library to write type-safe network client applications that work with streaming data of potentially unbounded size.
HTTPX 

Standing on the shoulders of giants and leaky abstractions

Recently, a blog post about how to use activerecord as a library was shared on r/ruby, which started an interesting discussion thread (where I was involved) from the premise “instead of using activerecord out of the rails, why not sequel”? While several arguments were made both for and against the premise, it felt that, at times, discussion deviated towards the merits of sequel vs. activerecord, rather than using or building a gem on top of them, as a dependency; and as usual in the social network sphere, comments may have been misunderstood, everybody went their separate ways, and the Earth completed another orbit around the sun.

While the topic of which of the ORMs has better performance

Shopify Engineering - Shopify Engineering 

Talk Nerdy to Me: 10 Tech Podcast Recommendations from Shopify Engineering

We asked our tech talent which podcasts they’re tuning into and curated a list of their favorites. Whether you’re in the mood for something quick and informative, or witty and conversational, we think you’ll find something on this list you’ll enjoy.

More

Remote Ruby 

José Valim, creator of Elixir and form Rails core contributor

[00:01:29] José tells us his background and what he does, and Seth explains how he found himself on a Ruby podcast with the Elixir creator.


[00:03:47] We find out how José got started in Ruby and progress into being a Rails core team member.


[00:07:40] We hear how José went from being a Rails core team member to creating Elixir, and he tells us about an influential paper called, “The Free Lunch Is Over.”


[00:24:28] José talks about the story of Elixir, the story around putting it into the world, the features that have grown in it, and the adoption.

 

[00:26:46] We learn more about if José considers himself a Web Developer before he got into writing Elixir.


[00:32:34] Jose shares how long…

Awesome Ruby Newsletter 

💎 Issue 311 - Ruby 3.1’s incompatible changes to its YAML module (Psych 4)

Ruby Together News 

RailsConf2022 Speaker Spotlight: Kevin Murphy

RailsConf2022 Speaker Spotlight: A Tech outsider’s picks

RailsConf2022 boasts an exciting variety of tracks and talks that highlight the creativity and interdisciplinary nature of the Ruby community. As a tech sector newcomer, I thought it would be fun to curate a series highlighting talks that immediately captured my curiosity, and get to know their respective speakers a little better. Read on for today’s speaker spotlight…

Title of Talk:

Browser History Confessional: Searching My Recent Searches

Speaker:

Kevin Murphy

profile_photo - Kevin Murphy.jpeg

How Did you get into Ruby?

My manager bet me that I could write a basic application we were responsible for in Rails, when I had no prior experience with either Ruby…

BootrAils 

How to get a random number in Ruby

rand() method

Ruby's rand method belong to the kernel module. Which means you could use it in any Ruby's environment.

For example, if you want to emulate a dice roll, you would write :

rand(1..6)
# => 4
rand(1..6)
# => 2

Note that without range, output will be from 0 to N.

rand(6)    #=> gives a random number between 0 and 5.

random_number

Another possibility is tu use SecureRandom.random_number.

If a positive integer is given as X, random_number returns an integer like this : 0 <= random_number < X.

SecureRandom.random_number(2)
# => will output 0 or 1
SecureRandom.random_number(100)
# => will output any  number from 0 to 99

Without any argument, SecureRandom.random_number will output…

i…
Ruby Weekly 

Scoped gems. Yea or nay?

🇺🇦 #​602 — May 5, 2022

Read on the Web

Ruby Weekly

What Do You Think of 'Scoped Gems'? — Here’s an interesting proposal whose author wants more eyes on. The basic idea is that gems can be scoped to specific users – for example s3@aws-sdk rather than aws-sdk-s3 – so that separate RubyGems users can use whatever names they like (within their scope) and also to give end users reassurance that a gem is associated with a particular authoritative source.

Matt Muller

On Ruby 3.1’s Incompatible Changes to Its YAML Module (Psych 4) — Ruby 3.1 introduced Psych (Ruby’s core YAML parser) 4.0, a major upgrade that…

Felipe Vogel 

Dot syntax and dig! for Ruby hashes

Recently I heard about this convenient feature of Elixir maps:

To access atom keys, one may also use the map.key notation. Note that map.key will raise a KeyError if the map doesn’t contain the key :key, compared to map[:key], that would return nil.

Nice! This is something I’ve been wishing for in Ruby. In a current project I have a configuration hash that is passed around and used in a variety of objects. The hash is quite large and several levels deep, so my code abounds with chains of Hash#fetch such as config.fetch(:ite…

Honeybadger Developer Blog 

Rails' Hidden Gems: ActiveSupport Cache Increment and Decrement

Rails is a large framework with a lot of handy tools built-in for specific situations. In this series, we'll take a look at some of the lesser-known tools hidden in Rails' large codebase.

In this article, we'll explain the increment and decrement methods in Rails.cache.

The Rails.cache Helper

Rails.cache is the entryway to interact with the cache in your application. It's also an abstraction, giving you a common API to call regardless of the actual cache "store" being used under the hood. Out of the box, Rails supports the following:

  • FileStore
  • MemoryStore
  • MemCacheStore
  • NullStore
  • RedisCacheStore

Inspecting Rails.cache will show which one you are running:

> Rails.cache
=> <#ActiveSuppo…
Getaround Engineering 

JavaScript smooth API with named-arguments and TypeScript

As a JavaScript developer, you surely have encountered some functions that require a lot of arguments to be called. Because the argument list is an Array-like object, all the values need to be set and so it may have given you a headache to understand the order and purpose of each argument.

Let see an approach to define developer-friendly function signatures with the named-arguments pattern and TypeScript.

The original issues with functions and arguments

Passing multiples arguments to a function can leads to several issues:

Example with the infamous null in the middle
    getItem(itemId, null, null, true)
  • Unless some variables with good naming are used, you have no clue of what…
Ruby Magic by AppSignal 

Bootstrapping with Ruby on Rails Generators and Templates

Rails' batteries-included approach is one of its greatest assets. No other framework makes it so effortless to get your application off the ground quickly, at least partially due to Rails' generators.

If you've used Rails for any amount of time, you have come across generators. Need to create a new application? Run rails new. Need to scaffold a bunch of new models and views? Run rails generate scaffold. There are dozens more available to help you get started rapidly or streamline your workflow.

But sometimes, using generators is just not enough. You might want to customize the behavior of these commands or even create your own. In this article, we'll take a closer look at generators - in…

Test Double Blog 

Developing Humility: How to find balance as a developer and a leader

While the irony of trying to present myself like an expert on humility isn’t lost on me, I feel that humility is an important enough skill for all software engineers and leaders that I’m going to try anyway. I’ll preface this with: humility, like communication, is one of those skills that requires constant attention and balance. For communication, if you talk too much you can be perceived as a rambler, too little and you’re uncooperative or cold. Humility is similar – too much and you lose trust for being too self-deprecating, too little and you come across as rude and arrogant.

So! First things first – how do we get to the perfect balance?

The humility balancing act

Where…

The Ruby on Rails Podcast 

Episode 416: Tackling Technical Texts with Steve Lynch

Steve Lynch is an Engineering Manager at Root Insurance, working with a full-stack team on a Rails and React stack. Brittany invited Steve on to the show to discuss Engineering Management and his Rubyconf talk, "I Read It But Don't Get It, or How to Tackle Technical Texts" so she could tackle some texts on her bookshelf.

Show Notes & Links:

Sponsored By:

Honeybadger

Honeybadger is exception, uptime, and cron monitoring, all in one place — and easily…

RubyGems Blog 

3.3.13 Released

RubyGems 3.3.13 includes enhancements, bug fixes and documentation.

To update to the latest RubyGems you can run:

gem update --system

To install RubyGems by hand see the Download RubyGems page.

## Enhancements:

  • Installs bundler 2.3.13 as a default gem.

## Bug fixes:

  • Fix regression when resolving ruby constraints. Pull request #5486 by deivid-rodriguez

## Documentation:

  • Clarify description of owner-flags. Pull request #5497 by kronn

SHA256 Checksums:

  • rubygems-3.3.13.tgz
    f40b995eaa06c32ca0db3de90ed3e76df10d3cb59eb5764773db525487391eb6
  • rubygems-3.3.13.zip
    a60bdd10b8c5093946330e49c3d51758a35f5b520dacb92e6e773b9bb08c1166
  • rubygems-update-3.3.13.gem
    ff1fadba6c293e02b…
OmbuLabs Blog 

How to Run a Virtual Retreat

Just before the world shut down in 2020, the team at OmbuLabs participated in an in-person retreat in Punta Cana. It was a wonderful experience, and the team was eager to have another retreat in 2021. We even began planning one, but with the safety of team members at risk because of the pandemic and the difficulty of traveling it soon became obvious that an in-person retreat would not be possible. Therefore we turned our attention to having the retreat virtually.

This ended up being a very successful event, and we wanted to share the experience and strategies that we used to plan and execute this retreat which took place virtually over four days towards the end of 2021.

Planning the…

Code with Jason 

144 - Martin Lee

In this episode I talk with my boss, Martin Lee, about how he and I started working together and what it is that we're working on.

The Bike Shed 

336: Million Dollar Password

Chris came up with a mnemonic device: Fn-Delete – for when he really wants to delete something and is also thinking about password complexity requirements, which leads to an exciting discussion around security theater.

Steph talks about the upcoming RailsConf and the not-in-person option for virtual attendees. She also gives a shoutout to the Ruby Weekly newsletter for being awesome.


NIST Password Standards
3 ActiveRecord Mistakes That Slow Down Rails Apps: Count, Where and Present
Difference between count, length and size in an association with ActiveRecord
Ruby Weekly
Railsconf 2022


Become a Sponsor of The Bike Shed!

Transcript:

STEPH: Hello and welcome to another…

RubySec 

CVE-2022-29970 (sinatra): sinatra does not validate expanded path matches

Sinatra before 2.2.0 does not validate that the expanded path matches public_dir when serving static files.
Benito Serna 

Use dom_id helper on capybara with rspec and rails

At least for me it is very common to use the within method in capybara, to match the dom_id output.

And is very common to do it with code like "#user_#{user.id}" or #project_#{project.id}.

In this way:

within "#user_#{user.id}" do
  expect(page).to have_text user.name
end

# or...

within "#project_#{project.id}" do
  expect(page).to have_text project.name
end

If you do it one time, there is no trouble, but if you start doing it in every file, maybe you will want to do something to remove the repetition.

Here I will show you two tips, to help you avoid this repetition.

Tip 1: Include ActionView::RecordIdentifier module to use the dom_id on your specs

On your spec you can include Ac…

Ruby Together News 

RailsConf2022 Speaker Spotlight: Adam Cuppy

RailsConf2022 Speaker Spotlight: A Tech outsider’s picks

RailsConf2022 boasts an exciting variety of tracks and talks that highlight the creativity and interdisciplinary nature of the Ruby community. As a tech sector newcomer, I thought it would be fun to curate a series highlighting talks that immediately captured my curiosity, and get to know their respective speakers a little better. Read on for today’s speaker spotlight…

Title of Talk:

Don’t Touch That!

Speaker:

Adam Cuppy

Adam Cuppy Presenter Headshot - Adam Cuppy.jpg

How Did you get into Ruby?

I came from acting/arts and not from computer software engineering. In 2008 I was working in marketing and moonlighting as a PHP software developer. From the outside, I was…

Ruby Together News 

Countdown to RailsConf2022!

Countdown to RailsConf2022!

Welcome to our first dispatch from Ruby Central!

We’re currently coming to you from our temporary home on the Ruby Together Blog. The new Ruby Central blog website is still being developed — but with the conference approaching faster than a train on high speed rails ;), we couldn’t wait to start bringing you content.

Our first posts will be centered on the upcoming in-person RailsConf2022, happening in Portland, Oregon May 17 -19. The program schedule is live and can be found here.

We’re ecstatic to be able to continue to gather live for this conference despite the COVID-19 pandemic. In order to do so safely, we are asking all attendees to please adhere to…

Test Double Blog 

End-to-end Testing with Cypress Series: 07 DRY for Speed

In this video, learn how creating similar Cypress tests can slow down your end-to-end test suite. Find out how to measure the runtime of your end-to-end test suite, consolidate similar Cypress tests to speed up your test suite, and learn the tradeoffs between combining end-to-end tests and keeping them separate.

00:00
(bright music)
00:03
Welcome back to Test Double's intro course
00:06
on end-to-end testing with Cypress.
00:08
In the previous video,
00:10
you learned about the DRY principle,
00:12
learned how duplication affects tests,
00:14
and reduced some duplication
00:16
in the existing Yams test suite.
BootrAils 

Kill Rails server : a how-to guide

Short answer

If you local Rails server is running on port 3000, you have first to discover what PID is used :

$> lsof -wni tcp:3000
COMMAND   PID  USER   FD   TYPE            DEVICE SIZE/OFF NODE NAME
ruby    51195 shino   10u  IPv4 0x3cd31f222cb761f      0t0  TCP 127.0.0.1:hbci (LISTEN)
ruby    51195 shino   11u  IPv6 0x3cd31f215db234f      0t0  TCP [::1]:hbci (LISTEN)

The column that matters is "PID". The relevant number is 51195 here. On your computer it will probably be another number, but for our example, the solution will be

kill -9 51195

Replace 51195 by your own PID and that's it.

Alternative : use the shutup gem

If this is a problem that happends too frequently, you can install a…

Ruby in Better Programming on Medium 

Want to Make API Calls From Your Rails App? Try These 3 HTTP Clients

Want to Make API Calls From Your Rails App? Try These 3 HTTP Clients

Faraday, Excon, and Rest Client

Photo by Michael Dziedzic on Unsplash

If you are developing an application that makes use of APIs then you will have to choose an HTTP client to make the requests. Ruby has its own built-in HTTP client called Net::HTTP but it can be a pain to work with.

Alternatively, there are libraries that make it much easier to make API requests. The sheer amount of these libraries can make finding the right one quite daunting so here are a few gems to help find the right one for your project.

Faraday

While not really a HTTP client in itself, Faraday acts as a wrapper for other clients such as Ruby’s built-in…

Drifting Ruby Screencasts 

Active Record Tricks

In this episode, we look at tips and tricks from read only attributes, inserting and upserting (update or insert) records, toggling booleans, and single table inheritance.
Island94.org 

Weeknotes: Week 0

I started a new job midweek this week at GitHub, managing their Ruby Architecture team. I love the team’s mission:

Making it easy for our engineers to create, deliver, and operate best-of-class Ruby and Rails applications, and sharing the best of it with the world.

I also took about 2.5 weeks in between leaving Code for America and starting this job, so I’m feeling fresh and ready for several weeks of official onboarding, and several months of growing into the role.

Something I learned

GitHub is heavily into written documentation. “If it doesn’t have a URL, it didn’t happen.”. And not just cross-referencing, but emoting and emoji-ing, and being, well, extra. Writing and…

Honeybadger Developer Blog 

How to Avoid Race Conditions in Rails

When two users read and update a database record at the same time, you might run into critical problems that are undesirable. Let's say that for some reason, a customer clicks the pay button on the checkout page of an e-commerce website. It is possible to have a scenario where a particular customer is charged twice for the same order because the two requests to charge the order were made at almost the same time. This situation is called a "race condition."

A race condition occurs when two or more threads can access shared data and try to change it at the same time. Because the thread scheduling algorithm can swap between threads at any time, you don't know the order in which the threads…

Ruby Rogues 

Isolator with Sidekiq - RUBY 543

Anton Ivanopoulos joins the show today to share his approach with using Isolator and Sidekiq to ensure simple, efficient background jobs for Ruby. Discover how Isolator and Sidekiq integrate and how you can have more reliable message processing, group jobs into a set to follow their progress, and ultimately stop worrying about queues and focus on your app. Anton shares his story how he moved from delayed jobs to Sidekiq and why he replaced his backend and why Sidekiq is more effective in the long run.

In this Episode…

What is Isolator and how does it integrate with Sidekiq?
A new way to catch the errors and add confidence and reliability message processing.
How to build good…

Hongli Lai 

Ubuntu 22.04 support for Fullstaq Ruby is here

Fullstaq Ruby distributes server-optimized Ruby binaries. Install the latest Ruby versions with APT/YUM instead of compiling. Easily keep Ruby security patched via auto-tiny version updates. Combat memory bloat (save as much as 50%) with memory allocator improvements.

Ubuntu 22.04 was released a couple of days ago. Fullstaq Ruby now provides packages for this distribution! Here's the corresponding pull request: #96.

Note that we only provide Ruby 3.1 packages for Ubuntu 22.04. This is because Ubuntu 22.04 ships with OpenSSL v3, and only Ruby 3.1 is compatible with that OpenSSL version.

Want to install or upgrade? Check the installation instructions, or run apt upgrade/yum update.

RubySec 

CVE-2022-27311 (gibbon): Server side request forgery in gibbon

Gibbon v3.4.3 and below allows attackers to execute a Server-Side Request Forgery (SSRF) via a crafted URL. This issue has been resolved in version 3.4.4
Shopify Engineering - Shopify Engineering 

React Native Skia—For Us, For You, and For Fun

kukicola.io - Writing about ruby, rails and other web technologies 

Improve your specs quality with branch coverage

Introduction

It’s a common practice to measure the quality of tests to make sure they cover all the code. Most ruby developers are familiar with SimpleCov. By default, it measures only line coverage, which sometimes can make false assurance that our code is fully tested. In Ruby we have many options to write conditional code in single lines:

return if something_happened?
some_var = argument.is_a?(SomeClass) ? argument : SomeClass.new(argument)

In such cases, line coverage will mark lines as covered no matter what’s the result of the condition.

Line coverage

Let’s take a look at a very simple example:

def read_file_if_exists(path)
  return '' unless File.exist?(path)
  
  File.read(path

and spec for it:

require 'simplecov'

SimpleCov.start

require_re…