Rubyland

news, opinion, tutorials, about ruby, aggregated
Sources About
JRuby.org News 

JRuby 9.2.18.0 Released

The JRuby community is pleased to announce the release of JRuby 9.2.18.0

JRuby 9.2.x is compatible with Ruby 2.5.x and stays in sync with C Ruby. As always there is a mix of miscellaneous fixes so be sure to read the issue list below. All users are encouraged to upgrade.

As we are still actively working on 9.3.0.0 we decided to put out another 9.2.x release to fix some of the more recently reported issues.

Thanks to contributor @ahorek for a couple quick-fix PRs this release!

Native Integration

  • Work around a bug in our backend FFI library, jnr-ffi, that broke calls to getsockopt or setsockopt in --dev

Win…

Rails with Jason 

099 - Decoding Ruby's Magical Syntax with Justin Gordon

In this episode, Justin Gordon and I discuss Ruby syntax, reducing the need for testing with Rescript or Rust, the benefits of time tracking, and the multitude of skills needed for running a successful agency.

Links:
Shakacode.com
Hichee.com
Justin Gordon on GitHub
Justin Gordon on Linkedin
Justin Gordon on Twitter

Ruby Yagi 🐐 

Getting started with automated testing workflow and CI on Ruby

If you have been writing Ruby / Rails code for a while, but still can’t grasp on the ‘why’ to write automated test, (eg. why do so many Ruby dev job posting requires automated test skill like Rspec, minitest etc? How does writing automated test makes me a better developer or help the company I work with? )

or if you are not sure on how the CI (continuous integration) stuff works, this article is written to address these questions!

This article won’t go into how to write unit test, but it will let you experience what is it like working on a codebase that has automated testing in place, and how it can speed up the development flow and assure quality (ie. confirm the code works). This…

I have written a small Ruby Sinatra app (with automated test written using Rspec,…

Ruby Football Week 2021, June 11th to June 17th - 7 Days of Ruby (Sports) Gems 

Day 5 - footty Gem - Who's Playing Today? Print Upcoming or Yesterday's Matches for the European Football Championship ("Euro") 2020 (in 2021) Using the Shell / Command Line

Written by Gerald Bauer What’s the footty gem? The footty gem ships with the footty command line tool that lets you query the online football.db HTTP JSON API services for upcoming or past matches. Euro 2020 - 24 National Teams, 6 Groups - June 11th to July 11th 2021 - Who’s Playing Today? Let’s try: $ footty # Defaults to today's euro 2020 (in 2021) matches prints on Jun/14 2021: #20 Mon Jun/14 Scotland (SCO) vs Czech Republic (CZE) Group D / Matchday 1 #25 Mon Jun/14 Poland (POL) vs Slovakia (SVK) Group E / Matchday 1 #26 Mon Jun/14 Spain (ESP) vs Sweden (SWE) Group E / Matchday 1 and on the next day…
Long live Ruby 

How to quickly familiarize with any legacy Rails app

Ruby on Rails is a mature technology, and probably that’s why many people say that it’s a dead technology. But it’s not. Fewer developers start new projects with Rails, but hundreds of thousands of applications are in the maintenance mode. This is the reason why the skill of quickly adapting to the legacy code is so essential for you as a Rails developer. Joining the legacy project is not easy, and the reality might overwhelm you if the documentation is not well-maintained (which is the case in many projects). That’s why I decided to create a list that would help you familiarize the business logic of the legacy application made with Rails. Thanks to this list, I successfully joined…
Saeloun Blog 

Ruby 3.1 adds Enumerable#compact and Enumerator::Lazy#compact

Enumerable mixin in Ruby provides several searching and sorting methods to classes. The Enumerable module is useful in classes where there are collections of data that might require sorting or searching collections.

However #compact method was not available in Enumerable even though classes like Array already has the #compact method.

Ruby 3.1 adds #compact directly to the Enumerable module and Enumerator::Lazy class.

To understand the use case of Enumerable, let’s assume we have a Reviews class with the reviews attribute. Few reviews may be empty. Now let’s assume we want the first five non-empty reviews.

The Ruby implementation of this Reviews class will be something like this.

#…
The Bike Shed 

296: Speedy Performance with Nate Berkopec

Nate Berkopec is the author of the Complete Guide to Rails Performance, the creator of the Rails Performance Workshop, and the co-maintainer of Puma. He talks with Steph about being known as "The Rails Speed Guy," and how he ended up with that title, publishing content, working on workshops, and also contributing to open source projects. (You could say he's kind of a busy guy!)

Transcript:

STEPH: All right. I'll kick us off with…

GoRails Screencasts 

How to create Custom Elements with Web Components

Web Components are a great way to encapsulate Javascript logic around an element in your HTML. We'll explore how to create Custom Elements and see how Hotwire uses them for Turbo Stream actions.
Ruby Football Week 2021, June 11th to June 17th - 7 Days of Ruby (Sports) Gems 

Day 4 - football-to-sqlite Gem - Read the European Football Championship ("Euro") 2020 Match Schedule in the Football.TXT Format Into euro.db Using the Shell / Command Line

Written by Gerald Bauer What’s the football-to-sqlite gem? The football-to-sqlite gem ships with the football-to-sqlite (or football2sqlite) command line tool that lets you read match files in the (structured) Football.TXT format into a single-file SQLite database. Let’s try: $ football-to-sqlite --help resulting in Usage: football-to-sqlite [options] DATABASE PATHS... Yes, that’s it. Pass along the database name e.g. euro2020.db and one or more match files e.g. euro2020.txt and you’re done. Euro 2020 - 24 National Teams, 6 Groups - June 11th to July 11th 2021 Let’s building up an SQLite database from scratch / zero for the European Football Championship (“Euro”) 2020 reading…
Honeybadger Developer Blog 

Adding Typescript to your Existing Rails App

TypeScript is a strongly typed superset of JavaScript developed and maintained by Microsoft. Strong typing helps you write cleaner code and detect and fix potential errors much earlier in the development process.

Because TypeScript is a superset of JavaScript, any existing JavaScript program is also a valid TypeScript program. This means TypeScript can interface seamlessly with any existing JavaScript code. It also means migrating from JavaScript to TypeScript can be done incrementally.

Although TypeScript and JavaScript can work well together, there are a number of important factors to consider when planning a migration. This article will give you a firm footing, so you can decide if a…

Ruby Football Week 2021, June 11th to June 17th - 7 Days of Ruby (Sports) Gems 

Day 3 - sportdb-readers Gem - Read the European Football Championship ("Euro") 2020 Match Schedule in the Football.TXT Format Into euro.db - A Single-File SQLite Database

Written by Gerald Bauer What’s the sportdb-readers gem? The sportdb-readers gem let’s you read in football match schedules and results, teams, groups, and more in the (structured) Football.TXT format into any SQL database of your choice (e.g. SQLite, PostgreSQL, etc.) Euro 2020 - 24 National Teams, 6 Groups - June 11th to July 11th 2021 Let’s get started with building up an SQL database from scratch for the European Football Championship (“Euro”) 2020 and let’s read in the match schedule in the Football.TXT format. Step 0 - Auto-Migrate the SQL Database. Let’s build a single-file SQLite database, that is, euro.db, from scratch / zero: require 'sportdb/readers' SportDb.connect!(…
Ruby Football Week 2021, June 11th to June 17th - 7 Days of Ruby (Sports) Gems 

Day 2 - sportdb-models Gem - Football SQL Schema and ActiveRecord Models for Easy (Re)Use - Inserting the Euro 2020 Opening Match - Turkey vs Italy 0:3 (0:0) - Into the Database "by Hand"

Written by Gerald Bauer What’s the sportdb-models gem? The sportdb-models gem ships with an ready-to-use sport.db SQL schema and ActiveRecord models. Euro 2020 Kick Off Match Sample - Turkey vs Italy 0:3 (0:0) Let’s get started with building up an SQL database from scratch for the European Football Championship (“Euro”) 2020 and let’s add the opening match that reads in the Football.TXT format: (1) June/11 21:00 Turkey 0-3 (0-0) Italy @ Stadio Olimpico, Rome [Merih Demiral 53' (o.g.) Ciro Immobile 66' Lorenzo Insigne 79'] Step 0 - Auto-Migrate the SQL Database. Let’s build a single-file SQLite database, that is, euro.db, from scratch / zero: require…
Riding Rails 

Active Storage audio improvements and more

Hi, Wojtek here with the summary of changes from the last week.

Add audio analyzer to Active Storage

It extracts duration and bit rate of audio files and stores it in the record metadata column.

Recognize audio presence in the video blobs

The metadata attribute of video blobs has a new boolean key named audio that is set to true if the file has an audio channel and false if it doesn’t.

Add attributes_for_database to Active Record

Returns attributes with values for assignment to the database. It works both for Active Record and Active Model objects.

Get rid of cattr_accessor in ActiveRecord::Base

More work on improving performance by eliminating class variables. This is a followup to …

RubyGems Blog 

3.2.20 Released

RubyGems 3.2.20 includes security fixes and enhancements.

To update to the latest RubyGems you can run:

gem update --system

To install RubyGems by hand see the Download RubyGems page.

## Security fixes:

  • Verify plaform before installing to avoid potential remote code execution. Pull request #4667 by sonalkr132

## Enhancements:

  • Add better specification policy error description. Pull request #4658 by ceritium

SHA256 Checksums:

  • rubygems-3.2.20.tgz
    0c4d73a0554f53980e996a14053a57e2611b49dbc1d4140f6b0f1226a252a24f
  • rubygems-3.2.20.zip
    536bd92110ad5a1491e8ad704b3ebf67f101de5f1af01d2bdc4317157c18d80a
  • rubygems-update-3.2.20.gem
    4f0cd0d3f83243d84bb0c5edf46eec5f34558c76a33bd070b…
Saeloun Blog 

React 17 runs useEffect cleanup functions asynchronously

Effect cleanup functions

React performs the cleanup when the component unmounts. The useEffect hook is built in a way that if we return a function within the method, it gets executed when the component unmounts.

useEffect(() => {
  // This is the effect itself.
  return () => {
    // This is its cleanup.
  };
});

Until React 17, the useEffect cleanup mechanism used to run during commit phase. This implies that when a component is unmounting, React would execute the cleanup functions and then update the screen. It is similar to the behavior of componentWillUnmount in classes.

This is not ideal for larger apps because it slows down large screen transitions (e.g., switching tabs).

In…

Remote Ruby 

Rails' new Request.js library, Ruby Radar, and CSS for Email

[00:00:50] Andrew fills us in on the Ruby Radar stuff and if anyone is interested in being a part of it or helping out you can reach out to him! 

 

[00:03:25] Andrew tells us about using elink which is like a bookmarking tool.


[00:05:03] Chris tells us about doing email work for the job board he wants to set up and we find out what happens since it’s been awhile that he did any CSS work in email.


[00:07:32] Andrew explains what Maizzle does and how it works.

 

[00:12:07] Chris tells us about Rails Request.JS which is a brand new Rails library.


[00:16:13] We learn more about the WWW-Authenticate header.


[00:23:42] Andrew talks about a really cool Web Component thing that Rails people like…

Notes to self 

Moving ActionCable over to Webpacker

This week, I upgraded a little demo application for my book Deployment from Scratch from Rails 6 to Rails 6.1. Since I showcase WebSockets with ActionCable and Redis, I needed to move the ActionCable CoffeeScript from Sprockets to Webpacker.

I started with dependencies. The original application could lose uglifier as Sprockets’ JavaScript processor and coffee-rails in favour of JavaScript. I replaced them with webpacker gem in Gemfile:

gem 'webpacker', '~> 5.4'

Once I generated a new Gemfile.lock, I could run a webpacker:install tasks that creates many files (which I won’t get into here):

$ rails webpacker:install

In case you won’t see the new Webpacker tasks, make sure to delete the…

Ruby Football Week 2021, June 11th to June 17th - 7 Days of Ruby (Sports) Gems 

Day 1 - fifa Gem - The World's Football Countries and Codes (Incl. Non-Member Countries and Irregular Codes)

Written by Gerald Bauer Let’s start with a triva quiz. The United Nations has 193 member countries: Q: How many member countries has the world football federation (FIFA)? (A) 193 (B) 211 (C) 312 (D) Other, please tell. What’s the fifa Gem? The fifa gem ships with all the world’s countries (incl. non-members or historic) and the countries’ official (or irregular) three-letter codes. Example: Get and pretty print (pp) all countries require 'fifa' pp Fifa.countries resulting in: [#, #, #, #, #, #, #, #, #, #, #, #, #, #, ... ] Note: If you prefer you can use the all-upcase FIFA name as an alias for Fifa. Let’s lookup some countries by the fifa…
Awesome Ruby Newsletter 

💎 Issue 264 - Virtus was released 10 years ago and here's what I've learned about Open Source work

RubyGems Blog 

May 2021 RubyGems Updates

Welcome to the RubyGems monthly update! As part of our efforts at Ruby Together, 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 May.

RubyGems News

This month in RubyGems, we released new versions for Bundler 2.2.18, 2.2.19 and RubyGems 3.2.18, 3.2.19 and focused on shipping a definitive fix for the dependency confusion issues that have been affecting Bundler for years. We finally managed to provide a fix (#4609) with bundler 2.2.18.

In addition to that, RubyGems saw several bug fixes and updates this month, some of which include the following:

  • fixed a resolution issue where gems were being…
OmbuLabs Blog 

Sharing knowledge: where to hear from our experts

At OmbuLabs one of our core values is Open by Default, which means that we want to have open communications, contribute to open source projects, give back to our community, and become thought leaders in our industry. We also believe that one great way to give back to the community is sharing our knowledge, especially the things that we discover as developers in our day-to-day.

That's why we try to keep consistency in this blog and also encourage every team member to speak at conferences, on podcasts and at meetups. I want to share with you things that are working for us as an "open by default" team.

The Contribution Goal

One way to incentivize our team to contribute to theses…

Ruby Weekly 

Matz talks about Ruby 3.0 and beyond

#​556 — June 10, 2021

Read on the Web

Jemma is back with another tip of the week - check it out at the end of this issue. The only problem is I can never remember the syntax for heredocs off the top of my head as it is.. :-)
__
Peter Cooper and Glenn Goodrich

Ruby Weekly

▶  Matz's Euruko Keynote: Beyond Ruby 3.0 — The founder and chief designer of our favorite language recently gave a virtual keynote and focused on what Ruby has achieved with version 3, and where efforts are headed next. It’s quite long but easily skimmed, or you can enjoy Matheus Richard's Twitter notes of what Matz covered. Ruby 3.1 is due…

The RubyMine Blog : The Ruby on Rails IDE | JetBrains Blog 

RubyMine 2021.2 EAP3

The third EAP build is available! This time, we’ve got several new features for version control systems, the built-in terminal, and the project copyright notice. Check out the post below to learn the details:

Unified behavior for the Show Diff action

Starting from v2021.2, RubyMine will display the difference between the initial and changed files in the editor. However you invoke the Show Diff action, the IDE will open the diff in the editor by default.

Unified Show diff

If you prefer tracking changes in a separate window, you can drag the desired file from the editor. If you do, the IDE…

Building & Sharing with Unathi 

ActiveRecord Optimistic Locking

ActiveRecord Optimistic Locking and Counter Caching

In this post, we will discuss optimistic locking and how it can help us when building applications. This guide is targeted at Ruby on Rails developers, but similar strategies can be applied in other frameworks.

What is Optimistic Locking

Optimistic locking is a strategy used to verify that a database record has not been changed since the last time you read/fetched it. Locking gives you some certainty that any updates you are making are based on the most recent version.

So how do we use this, and how could it help ?

TL;DR: A Quick Practical Guide

GoRails Screencasts 

How to use Rails Request.js

Learn how to use Rails' brand new Request.js library for making AJAX requests in your Javascript
Josh Software 

Understanding gotchas with un-mounting using useEffect hook— React

In2021, I can say many developers are loving the functional components implementation with the help of hooks. Recently in one of my projects, while implementing Unmount lifecycle method using useEffect, we faced issue like our unmount (return function inside useEffect) was getting executed whereas component was still in mounted phase. While solving it I got … Continue reading Understanding gotchas with un-mounting using useEffect hook— React
Ruby Magic by AppSignal 

Performance, Stress, and Load Tests in Rails

Tests are an integral part of most well-working Rails applications where maintenance isn’t a nightmare and new features are consistently added, or existing ones are improved. Unfortunately, for many applications, a production environment is where they are put under heavy workload or significant traffic for the first time. This is understandable as such tests are costly.

Thankfully, Rails has good support not only for unit, end-to-end, and integration tests but also for tests related to performance and loading. I’ll cover all of them in the article and show some practical examples that will help you understand how to efficiently use tools that test the performance level of your application.

Notes to self 

Removing assets dependencies from Rails applications for runtime

Rails provides a smooth assets:precompile task to prepare application assets but keeps all required gems for assets generation as a standard part of the generated Gemfile. Let’s see if we can avoid these dependencies for runtime.

A new Rails application comes with various gems concerning assets compilation and minification:

$ cat Gemfile
...
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 5.0'

We might see other gems in older versions of Rails, like uglifier or coffee-rails.

It makes sense since the Rails’s assets:precompile tasks is usually run within the PRODUCTION environment,…

All Ruby Podcasts by Devchat.tv 

The 3 Essentials for Successful Job Outcomes - BONUS

Chuck dives into the 3 essentials for getting the next successful outcome you want in your career. Whether that's something simple like a raise or something more complex like going freelance, you can achieve it by working on 3 main areas.

First, building skills. The most obvious type of skills you'll need is technical skills. However, don't neglect your people skills and your organizational skills as well since you're often paid for how you work with people and enhance their work and how you put your work together in the most efficient ways.

Second, building relationships. Often other people will be able to help you find the opportunities or will be the ones to make the decisions…

All Ruby Podcasts by Devchat.tv 

Can Active Storage Serve Images for the Modern Web? by Mark Hutter - RUBY 501

Dave Kimura and Luke Stutters talk with Mark Hutter about Active Storage and his experience building a large image driven application. We talk about some of the issues and workarounds when implementing Active Storage.

Panel

  • Dave Kimura
  • Luke Stutters

Guest

  • Mark Hutter

Sponsors

Links

Picks

Saeloun Blog 

Rails 7 adds encryption to ActiveRecord

Before Rails 7, we used a lot of gems like attr_encrypted to encrypt and decrypt data in Active record models.

Let’s take an example of a User model, where we want to store the email in an encrypted format.

class User < ApplicationRecord
  validates_presence_of :email
end

Previously, using attr_encrypted gem we would do something like this:

class User < ApplicationRecord
  validates_presence_of :email
  attr_encrypted :email, key: :encryption_key
end

This increases the dependency on third-party gem for critical functionality like encryption.

To handle this problem, Rails 7 adds encrypted attributes to ActiveRecord models.

Basic setup

  • Firstly, we need to add some keys to our Rails…
Greater Than Code 

238: Contributing to Humanity and Mutual Aid – Solidarity, Not Charity

01:00 - Mae’s Superpower: Being Able to Relate to Other People and Finding Ways to Support Them

03:42 - Contributing to Humanity (Specifically American Culture)

  • Title Track Michigan
    • Climate Change
    • Clean, Accessible Water
    • Hate & Divisiveness; Understanding Racial Justice

07:01 - Somatics and The Effects of Yoga, Meditation, and Self-Awareness

12:20 - Mutual Aid: Solidarity, Not Charity

33:17 - Giving vs Accepting Help; Extending and Accepting Love,…

BigBinary Blog 

Rails 7 adds method calls for nested secrets

Rails stores secrets in config/credentials.yml.enc,which is encryptedand cannot be edited directly.You can read more about credentials management here:Rails security guide.

Rails 7 allows access to nested encrypted secrets (credentials) by method calls.We can easily access the nested secrets present in the credentials YAML filelike we've accessed top-level secrets previously:

# config/credentials.yml.encsecret_key_base: "47327396e32dc8ac825760bb31f079225c5c0"aws:  access_key_id: "A6AMOGVNQKCWLNQ"  secret_access_key: "jfm6b9530tPu/h8v93W4TkUJN+b/ZMKkG"
=> Rails.application.credentials.aws=> {:access_key_id=>"A6AMOGVNQKCWLNQ", :secret_access_key=>"jfm6b9530tPu/h8v93W4TkUJN+b/ZMKkG"}

Before Rails 7

Julia Evans 

Reasons why bugs might feel "impossible"

Hello! I’m very slowly working on writing a zine about debugging, so I asked on Twitter the other day:

If you’ve run into a bug where it felt “impossible” to understand what was happening – what made it feel that way?

Of course, bugs always happen for logical reasons, but I’ve definitely run into bugs that felt like they might be impossible for me to understand (until I figured them out!)

I got about 400 responses, which I’ll try to summarize here. I’m not going to talk about how to deal with these various kinds of “impossible” bugs in this post, I’ll just try to classify them.

Here are the categories I came up with for ways a bug might feel impossible to understand. Each one of…

JRuby.org News 

JRuby 9.2.18.0 Released

The JRuby community is pleased to announce the release of JRuby 9.2.18.0

JRuby 9.2.x is compatible with Ruby 2.5.x and stays in sync with C Ruby. As always there is a mix of miscellaneous fixes so be sure to read the issue list below. All users are encouraged to upgrade.

As we are still actively working on 9.3.0.0 we decided to put out another 9.2.x release to fix some of the more recently reported issues.

Special thanks to our external contributors this release: @ahorek, @xaptronic

Compatibility

  • Improved support for subprocess launching on pure-Java environments (primarily Windows). (#6654, #6655, #6678
  • Con…
Depfu 

Depfu for PHP

For all the work that goes into supporting a new ecosystem, the blog posts are suprisingly boring, so let’s keep this one short:

Depfu now fully supports PHP with Composer.

That includes

  • Individual and Grouped Updates.
  • Our reasonably up-to-date strategy to get significantly fewer PRs.
  • Private package registries from your self-hosted Satis to Private Packagist.
  • Tracking of Security Vulnerabilities.
  • And everything else, of course.

We’ve been running this in production for quite some time now so we’ve ironed out most bugs and it’s stable and ready to be used.

Enjoy!

Depfu 

Assigning and reviewing PRs

We just shipped a few improvements to how you can assign PRs and request reviews.

The goal was to support all features that were introduced by Github and Gitlab since we last worked on this, which was quite some time ago.

⚠️ We’ll be requesting one additional permission on our Github App in order to make these features possible: read-only access to organization members and teams.

Github

Request reviews from teams

Github allows you to request reviews from individuals and teams. We’ve long supported requesting reviews from users, but now you can also configure Depfu to request from one or multiple of your teams.

In order to do this with the Github API we need the additional…

Rails Performance Audit and Tuning Consultant for Hire 

Deploying My First Ethereum Smart Contract for Fun and Profit

I’m the kind of person that buys $500 worth of Dogecoin, and one day later, panic sells with a 30% loss. Recently, I’ve deployed my first Ethereum smart contract to help optimize this buy high, sell low investment strategy. Read on if you want to learn about my first steps in the ETH and blockchain ecosystem.

Disclaimer: The information provided in this blog post is for educational purposes only and should not be treated as investment advice.

How to forget about your cryptocurrencies?

I’ve been buying small amounts of different crypto coins for a couple of years now. I can never stand the pressure of losing 5% of an investment, compulsively check prices every day, and usually sell just…

Saeloun Blog 

Rails 7 ensures has_one autosave association callbacks get called once

ActiveRecord AutosaveAssociation is a module that takes care of automatically saving associated records when their parent is saved. In addition to saving, it also destroys any associated records that were marked for destruction.

Association with autosave option defines several callbacks on your model (around_save, before_save, after_create, after_update). When saving a record, autosave adds callbacks to save its associations.

Since the associations can have similar callbacks for the inverse, endless loops could occur. To prevent these endless loops, the callbacks for has_many and belongs_to are made non-cyclic (methods that only execute once). This is implemented in the Ruby define_non_cy…

Long live Ruby 

Sidekiq good practices

It seems that writing Sidekiq’s workers it’s quite an effortless task. Still, during my eight-year journey with this great library, I experienced too many issues caused by poorly designed background jobs to believe that it’s an easy thing to do. This article is my list of good practices that help me write better classes and design more reliable systems that heavily depend on the background job processing.
Code with Jason 

Close your f–ing browser tabs

When I teach programming classes or pair program with colleagues, I often encounter people with a whole bunch of browser tabs open at once.

I want to explain to you why having too many tabs open is bad.

The cost of tabs

Tabs cost mental RAM

As we work, we’re always juggling thoughts in our head. I call this our “mental RAM”. It’s a finite resource.

Each tab you have open occupies some space not only on your browser screen but also in your brain. There’s a part of you that wants to remember “don’t forget, I had that one Stack Overflow answer open in a tab in case I need to go back to it”. You might not be consciously aware of it but that open tab is taking up part of your precious mental…

code.dblock.org | tech blog 

To Wrap or Not to Wrap in Markdown?

I keep antagonizing OSS contributors trying to wrap text in Markdown files, e.g. here and here.

Should one wrap text in .markdown files at 80 columns or should one not?

First, let me say that I don’t care. Except that I do. Wrapped text in markdown really feeds my OCD in the worst possible way, right behind missing periods at the end of sentences, and two spaces. Oddly, I don’t care about tabs vs. spaces.

Here’s a logical argument for not wrapping text in markdown.

Markdown doesn’t use line the breaks: whether you include a line break in your markdown or not the rendered result is the same, unless you use 2 line breaks.

For example, consider the following text wrapped at 23 characters…

Prathamesh Sonpatki 

Confident coding principles - Let it break (loudly) edition

Confident coding principles - Let it break (loudly) edition

A lot of times I see code like this:

if alert_type == 'static'
  do_something
else
  do_something_else
end

When this code was written, we only had two types of alerts - static and dynamic. This code looks innocent but has a major issue. If tomorrow, we add a new alert_type, then the code needs to change, otherwise we will process the new alert as

dynamic alert. Worse thing is that one has to remember to change this code. Now think about such code being present at multiple places and the developer has to remember to change all the occurrences.

As programmers, we know that we are bad at remembering the code after few weeks even if it is written by ourselves. If we can forget code so quickly,…

Posts on solnic.codes 

10 Years of Open Source

On June 4th, 2011 I released the first version of Virtus, a ruby gem that I extracted from the DataMapper project. I remember how I felt about Open Source back then, and I have to tell you that my perspective has changed a lot. 10 years, a freaking decade, is a lot of time…I’ve gone through a lot of ups-and-downs during that time, as my open-source contributions sky-rocketed, and that changing perspective is something I continuously think about.
Drifting Ruby Screencasts 

10 Tips and Tricks

I don't get around to doing these too often, but they are always a lot of fun. In this episode, we'll look at ten different Ruby on Rails tips and tricks.
The Bike Shed 

295: To the Left, to the Left

After the last episode where database switching was discussed, a number of listeners reached out with thoughts. In particular, one listener gave a reproducible example of how to make things better. Chris talks about why he always moves errors to the left, and Steph gives a hot take where she admits that she is not a fan of hackathons and explains why.

Steph and Chris also share exciting Bike Shed show news in that we now have transcripts for each episode, and tackle another listener question asking, "How do you properly implement a multi-step form in a boring Rails way?” Chris talks about his experiences with multi-step forms and gives his own hot take on refactoring: he doesn't…

Honeybadger Developer Blog 

Building A New Programming Language In Ruby: The Interpreter

Full Source on Github

A complete implementation of the Stoffle programming language is available at GitHub. Feel free to open an issue if you find bugs or have questions.

In this blog post, we're going to start implementing the interpreter for Stoffle, a toy programming language built entirely in Ruby. You can read more about this project in the first part of this series.

The interpreter we are going to build is commonly referred to as a tree-walk interpreter. In the previous post of this series, we built a parser to transform a flat sequence of tokens into a tree data structure (an abstract syntax tree, or AST for short). As you might be imagining, our interpreter has the job of going…

Rich Stone Input Output 

First Mixed Thoughts Newsletter: Hi Alan, Let's talk Ruby APIs tomorrow, and much more

First Mixed Thoughts Newsletter: Hi Alan, Let's talk Ruby APIs tomorrow, and much more

Lots of ground to cover in this very first mixed thoughts newsletter:

  • Hi Alan
  • Let's talk Ruby APIs tomorrow (7th June)
  • Magic Bootcamp student questions
  • New endeavors
  • 1 life-changer
  • React template for your portfolio website?

First things first. Let's start with a big shoutout to Alan who joined the newsletter subscriber list. He just joined the list. Nothing more, nothing less. But this triggered the creation process of this very first richstone.io mixed thoughts newsletter. So, thanks Alan, wherever you are right now. And of course a huge thanks to the other 25 subscribers here. Including my mom.

Newest endeavor: I'm becoming a father soon. The second time. I'll be a serial father so to say. Not…

Peter Zhu 

A Rubyist’s Walk Along the C-side (Part 4): Primitive Data Types

The primitive data types in the Ruby C API and how to use them.
Code with Jason 

How to generate a public SSH key from a private key

If you have a private RSA key but not its public key, you can generate the public key by running the following.

sh-keygen -y -f ~/.ssh/my-key.pem > ~/.ssh/my-key.pub

The post How to generate a public SSH key from a private key appeared first on Code with Jason.

On the Edge of Ruby 

Review: Ruby Installers and Ruby Switchers

In this post I review the most popular Ruby installers (making it easier to install a Ruby) and Ruby switchers (to switch between different Rubies conveniently).

I contributed to all 3 Ruby installers when adding support for TruffleRuby, and so I have experience both with their codebase and their usage.

I am not reviewing Ruby installers or switchers for Windows as I have no experience with them.

TLDR: feel free to jump to the Conclusion and Recommendation.

Ruby Installers

RVM

RVM is probably the oldest and certainly the Ruby installer with the most features. That’s actually a doubled-edged sword, as it means RVM has a much larger codebase than all the others (25000 SLOC of Bash), and…

Remote Ruby 

Announcing RubyRadar, new Rails 7 features, and Turbo Native Registration

[00:00:49] Andrew tells us Brittany Martin released a great podcast episode with Evan Phoenix and Marty Haught, about behind the scenes of Railsconf, and a story about how a man’s submarine was running Ruby. 


[00:04:56] We hear about Andrew’s move and the crazy things that happened before he moved, which included his house catching on fire and finding a place to live in Arizona during a housing shortage, and his experience shopping for furniture at IKEA for the first time in his life! ☺


[00:11:40] Andrew talks about smart home he lives in now, getting Raspberry Pi 3, and going all out Apple buying an iPad, TV, an HomePod mini. Also, Chris and Andrew talk about the Nanoleaf shape…

Saeloun Blog 

Redux 4.1.0 converts error messages from strings to error code indexes

Providing helpful error messages when things go wrong, makes debugging easier and results in a better developer experience.

But, showing full error messages in the production increases the overhead of sending extra bytes over the wire.

Let’s check out a simple counter example. Here is the CodeSandBox link from the Redux Toolkit tutorial.

The below code defines a string name to identify the slice, an initial state value, and one or more reducer functions to define updating the state.

//counterSlice.js

import { createSlice } from '@reduxjs/toolkit'

export const counterSlice = createSlice({
  name: 'counter',
  initialState: {
    value: 0,
  },
  reducers: {
    increment: (state) => {
Awesome Ruby Newsletter 

💎 Issue 263 - Represent Ruby in the Stack Overflow Developer Survey!

Test Double Blog 

How to Find and Remove Dead CSS

Do you have a pile of old CSS styles that you’re pretty sure are no longer referenced anywhere, but that you’re nevertheless afraid to delete because you have no way to be sure that no musty corners of your site somehow depend on them to render correctly?
Ruby Weekly 

More work on making Ruby faster

#​555 — June 3, 2021

Read on the Web

😶 A curiously quiet week in Ruby land! We hope you're enjoying the weather where you are right now, especially as summer begins to rear its head in the northern hemisphere.. :-) Psst.. feel free to send in your submissions!
__
Peter Cooper and Glenn Goodrich

Ruby Weekly

YJIT: Building a New JIT Compiler Inside CRuby — Even if you can’t follow along with the technicalities, it’s reassuring to know a lot of work is still going into making Ruby (and Rails, as we featured last week) faster. YJIT is still in its ‘early stages’ but the speedups achieved already are encouraging.

Maxim…

The RubyMine Blog : The Ruby on Rails IDE | JetBrains Blog 

RubyMine 2021.2 EAP2: Usability Improvements

The second EAP build is available now, and it comes with a load of usability improvements. We encourage you to check them out and tell us what you think!

Search the Local History

Local History helps you constantly track all changes made to a project independent of version control. It automatically records your project’s state as you edit code, run tests, deploy applications, and so on.

In this release, we’ve added search functionality to Local History. Now, if you…

Martian Chronicles, Evil Martians’ team blog 

Premium design: Building a mobile app for Loewe

Authors: Anton Lovchikov, Product Designer and Olga Rusakova, Writer at Evil Martians

In this customer project with Loewe, a nearly 100-year-old German television and entertainment electronics pioneer, Evil Martians have implemented part of the brand-new corporate business strategy. Teaming up with Loewe, we built a cross-platform mobile application for users to access Loewe smart devices’ manuals and key information instantly. In 2021, the “my Loewe” app became an iF DESIGN AWARD winner in the “Communication Design” category, featuring 2021’s most cutting-edge design of services and applications.

A milestone in the television history

Loewe is a leading international brand for…

Getaround Engineering 

What's a good team process?

You may have heard about the five monkeys experiment, a cautionary tale sometimes used to illustrate how we can get locked up in an organisational harness without sufficient hindsight, power or leeway to change the way things are.

This comparison may sound unflattering, but I have seen similar situations in previous lives, where a process I don’t understand is enforced, and I simply end up complying and assimilating it as normal. No-one is really responsible for that process, it may not even be relevant anymore, but it’s still there and is so much part of the habits that nobody thinks of questioning it, or the ones who do get dismissed with a “that’s how it is”.

Of course not all…

All Ruby Podcasts by Devchat.tv 

How to Get Hired at a FANG Company - BONUS

Chuck explains what he taught Nathan last week when we asked how to get hired at a FANG (Facebook Apple/Amazon Netflix Google) company. Essentially, it boils down to how to build the skills and knowledge needed to pass the interview. How to build the relationships to get into the door and have the interviewer want you to succeed. And how to build the reputation that has the company wanting you regardless of the outcome.
This approach also works for speaking at conferences, selling courses, and other outcomes as well as it's the core of building a successful career as an influencer.

Panel

  • Charles Max Wood

All Ruby Podcasts by Devchat.tv 

Episode 500 - RUBY 500

Chuck, Luke, and Dave are joined by Eric Berry for a roundtable chat and celebration of 500 episodes and 10 years of Ruby Rogues. They start out discussing where each of them are at these days. Then talk about their favorite episodes of the show. They talk about what they see for the future of Ruby and then discuss the future of the show and where they go from here.

Panel

  • Charles Max Wood
  • Dave Kimura
  • Luke Stutters

Guest

  • Eric Berry

Sponsors

Links

Picks

Test Double Blog 

Double Agent Profile: Neal Lindsay

Name: Neal Lindsay Designation: Agent 008 Double Agent Role: Senior Software Consultant Special Skills: Solving logic puzzles, broad trivia knowledge. Aliases: @neall Location: Hilliard, OH Favorite Emoji: 🎊 What are you proudest of doing in the past year at work?
Rich Stone Input Output 

Ruby multi-line string hell 1

Ruby multi-line string hell 1

Ruby developers don't usually hate things about Ruby. But there's one thing that seems to be more complicated at times than necessary in Ruby.

Ruby multi-line string hell 1Here I am again, every now and then... Those purple links...

As you can see, I'm a frequent guest at some fellow sufferers' confessions.

I even blocked the deployment once, because we didn't have tests for rake tasks and CI didn't detect that this is not a multi-line string:

logger.log "A very long sentence" /
		   "that ends here"
# => NoMethodError (undefined method `/' for "A very long sentence":String)
Can you guess what other mistake is hidden here that no one of the PR reviewers will notice? 😈 

For the IDE this syntax is just fine too, so no warnings…

Passenger - Phusion Blog 

Passenger 6.0.9

Passenger 6.0.9

Version 6.0.9 of the Passenger application server has been released. This release mostly improves compatibility with supported systems.

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

Updates & improvements

  • Upgrades Boost to 1.76. Fixes a regression where some boost headers for comatibility with older distros were missing.

  • Make building on Apple Silcon using homebrew openssl work. Contributed by TheBerg.

  • Properly support HTTP 418. Contributed by Thomas Pfister.

  • Fix several C++ warnings about implicit copy operators/constructors.

  • Bump preferred nginx 1.18.0 → 1.20.1.

  • Updated various library versions used in precompiled…

Ubuntu Packages

Passenger 6.0.9 adds…

Julia Evans 

You can now buy print version of my zines!

Hello! Quick announcement: I opened a new print zine store last week, so now you can buy print copies of my zines! To start I’ve printed 350 copies of each of the “Bite Size…” zines.

Here’s a photo of the front of the zines and some stickers:

and the back covers:

Here are some notes about how the store works:

great print quality!

I worked with a really good print company (Girlie Press) and printed the zines on some nice paper, so they look WAY nicer than they do when printed on a home printer :). I’m delighted with how they turned out.

When I originally started working on this project I thought about using a print-on-demand company briefly (it sounds so convenient!) but I…

The Rails Tech Debt Blog 

Upgrade Rails from 6.0 to 6.1

This article is part of our Upgrade Rails series. To see more of them, click here.

This article will cover the most important aspects that you need to know to get your Ruby on Rails application from version 6.0 to 6.1.

  1. Preparations
  2. Ruby version
  3. Gems
  4. Config files
  5. Rails Guides
  6. Removals
  7. Next steps

1. Preparations

Before beginning with the upgrade process, we have some recommended preparations:

  • Your Rails app should have the latest patch version before you move to the next major/minor version.
  • You should have at least 80% test coverage unless you have a dedicated QA team.
  • Follow a Git flow…
The RubyMine Blog : The Ruby on Rails IDE | JetBrains Blog 

RubyMine 2021.1.2 Is Available

RubyMine 2021.1.2 is now available! 

You can update using the Toolbox App or right from inside the IDE. You can also download RubyMine 2021.1.2 from our website.

Bug-fixes

You’ll find the following important fixes in this update:

  • Fixed the issue with the IDE freeze on startup: IDEA-266474 
  • Fixed several bugs affecting shortcuts that include the Option key on macOS: JBR-3409 
  • Fixed the issue causing the color scheme to change unexpectedly: IDEA-265169 
  • Chinese characters are now displayed correctly when the Quick Documentation action is invoked: IDEA-268158 
  • Fixed the issue with the tab and indent settings: IDEA-267368  

Check out the release notes for the complete list of closed…

Greater Than Code 

237: Empathy is Critical with Andrea Goulet

01:13 - Andrea’s Superpower: Distilling Complexity

  • Approaching Copywriting in a Programmatic Way
  • Word-land vs Abstract-land

09:00 - “Technical” vs “Non-Technical”

  • This or That Thinking

16:20 - Empathy is Critical

  • Communication Artifacts
  • Audience/User Impact
  • Programmer Aptitude Test (PAT)

33:00 - Reforming Hiring Practices and Systems

39:28 - Performance Reviews

“Start where you are. Use what you have. Do what you can.” ~ Arthur Ashe

Empathy In Tech
Corgibytes

Reflections:

Saeloun Blog 

Rails 7 allows access to nested encrypted secrets by method calls

Since Rails 5.2 was released, we can make use of the Credentials API to manage our secrets.

Check out our previous blog on Rails credentials to learn more about the working of the API.

Example

Consider config/credentials.yml.enc contains the following configuration:

aws:
  access_key_id: 123
  secret_access_key: 345
github:
  app_id: 123
  app_secret: 345
secret_key_base:

Before

Earlier we could only access the top-level key using the dot (.) syntax (i.e., Using a method call).

The nested keys had to be accessed using the [] syntax.

# Using the [] syntax
> Rails.application.credentials[:aws]
#=> { :access_key_id => 123, :secret_access_key => 345 }

# Using the dot(.) syntax for…
RubySec 

CVE-2021-33564 (dragonfly): Remote code execution in Dragonfly

An argument injection vulnerability in the Dragonfly gem before 1.4.0 for Ruby allows remote attackers to read and write to arbitrary files via a crafted URL when the verify_url option is disabled. This may lead to code execution. The problem occurs because the generate and process features mishandle use of the ImageMagick convert utility.
Long live Ruby 

Handle API response with value objects

This article is a quick tip for anyone working with APIs in a Rails application and parsing the data without modeling it. Let’s assume that we request the API to get the list of the users from which we would like to pull only active users and save some data for later usage.
Notes to self 

I am selling the pre-release of my book

This was a long time coming. 2.5+ years in the making, still unfinished, but it had to go out!

I started my book Deployment from Scratch around October 2018 with a validation and 5 months of full time work before going part-time so I have something to eat ;). Many months later, I am now again working more on the book than for clients and doubling down on finishing it.

I was telling myself there is no point in selling an unpolished version of the product but got feedback from an early mailing list poll I did, and enough people showed interest in getting a beta product sooner.

Still, I was waiting for a more solid version and at least 500 people on the mailing list.

Starting April 2021, I…

BigBinary Blog 

Using Cookies with Postgraphile

This blog details usage of cookies on a Postgraphile-based application. We will be using Postgraphile with Express for processing the cookies, but any similar library can be used.

Cookies can be a very safe method for storage on the client side.They can be set as:

  • HTTP only: cannot be accessed through client-side JavaScript, saving it from any third party client-side scripts or web extensions.
  • Secure: The web browser ensures that the cookies are set only on a secure channel.
  • Signed: We can sign the content to make sure it isn't changed on the client side.
  • Same Site: Make sure that the cookie is sent only if the site matches your domain/subdomain(details)

Prerequisites

  • Postgraphile - Generates an…
Test Double Blog 

Celebrating Agent 00100 Milestone

One of the things I underestimated when starting Test Double was how important it is to have a meaningful purpose for the business and a vision for achieving it. If you have no purpose, your people will inevitably show up for a paycheck and when the next better offer comes along, seek those greener pastures.
Rails with Jason 

098 - Turbo on iOS, Freelancing, and Mugshot Bot with Joe Masilotti

In this wide-ranging episode I talk with Joe Masilotti on a number of sundry topics including using Turbo on iOS, methods of pricing for freelancing work, and Joe's tool for creating social media preview cards, Mugshot Bot.

Links:

Code with Jason 

How I organize my Rails apps

Overview

Influenced by the experiences I’ve had last ten years of building and maintaining Rails applications, combined with my experiences using other technologies, I’ve developed some ways of structuring Rails applications that have worked out pretty well for me.

Some of my organizational tactics follow conventional wisdom, like keeping controllers thin. Other of my tactics are ones I haven’t really seen in others’ applications but wish I would.

Here’s an overview of the topics I touch on in this post.

  • Controllers
  • Namespaces
  • Models
  • The lib folder
  • Concerns
  • Background jobs
  • JavaScript
  • Tests
  • Service objects
  • How I think about Rails code organization in general

Let’s start with controllers.

C…

Notes to self 

Benchmarking programs with /usr/bin/time

If you ever used the time to measure the program’s execution, you might want to know how to improve your results by running with a higher process priority.

time vs /usr/bin/time

First of all, it’s important to realize that running time and /usr/bin/time might not be the same thing. While time should be running the first program on $PATH, it doesn’t necessarily end up running /usr/bin/time:

$ time

real  0m0.000s
user  0m0.000s
sys 0m0.000s

$ /usr/bin/time
/usr/bin/time: missing program to run
Try '/usr/bin/time --help' for more information.

That is because time is also a Bash function (on Fedora-based systems), which can also benchmark your program run, but lacks the detailed -v (as…

Saeloun Blog 

Rails 7 adds disable_joins: true option to has_one :through association

In our previous post, we’ve shown how to use the disable_joins option for has_many: :through association. In this post, we would like to show, how that works for the has_one: :through association as well.

Let’s consider the use case where:

  • Users can create multiple posts.
  • Anyone looking at the post can add a comment - crowd-sourced comments.

In this case, we can store the crowd-sourced comments in a separate database, as comments can grow quickly and may need a different kind of data management approach.

The database.yml can be like below:

default: &default
  adapter: postgresql
  encoding: unicode
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  username: root
  password: pa…
Notes to self 

Puma graceful restarts

How to configure Puma 5 application server for graceful restarts, and what is the difference between regular, hot, and phased restarts?

Application restarts are necessary when things go wrong or whenever we need to push a new application version. But a regular restart isn’t usually anything more than stopping and starting the server again. To keep clients connected or even keep serving requests, we need a better strategy.

Graceful restarts

Because Puma 5 is a multi-process application server, it allows for a few strategies we can choose from when we run Puma in a multi-process mode (which we almost always should):

  • regular restarts: connections are lost, and new ones are established…
zverok with ruby 

Using Wikipedia as an Impromptu RottenTomatoes API

Last week I posted an errhm Tweetstorm making a few quite important points:

To rehash the two most important points:

  1. It will be generally good (for the development community and humanity and progress) to have programmatic access to common-sense knowledge.
  2. The best candidate for the source of this knowledge is Wikipedia—however chaotic and irregular it sometimes might be.

(The thread makes a lot of other good points, go read it!)

The task

To make a practical…

RubyGems Blog 

3.2.19 Released

RubyGems 3.2.19 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:

  • Fix gem help build output format. Pull request #4613 by tnir

SHA256 Checksums:

  • rubygems-3.2.19.tgz
    785c3eee9eb6f9081ae22b803a402b84e09567b2484cb36290d0c82ecdd050e5
  • rubygems-3.2.19.zip
    d7d5d435e7559e3436c954f2262adb7fb60c9a1db2d52abdbf318e9290f72572
  • rubygems-update-3.2.19.gem
    252d6e96a1b8857b3e2d027523407a2ed498d623dcdc2b67e5e5965da460b71a
Frank’s blog 

My Second Month as a Solo Founder

I’m writing this on the last day of my second month as a solo founder. Read about my first month if you haven’t already. This month was a month with much less coding and more marketing. The most important pieces of Callcounter were finished last month, so this month I more actively started promoting it.

Attracting More Visitors

Besides using Bing Ads to attract visitors to the website, I also started to do this with Google Ads. Before starting Webindie I had a strong objection against this, but this was just the simplest way to get visitors to the site.

This was also the month where I started a blog on the Callcounter domain. I wrote something about Ruby XML serializers there for…

Tom Dalling 

Monologue On End-To-End Testing

I wanted to write down some of my thoughts on end-to-end testing, mainly to help clarify my own thinking.

Honeybadger Developer Blog 

Understanding RBS, Ruby's new Type Annotation System

RBS is the name of a new type syntax format language for Ruby. RBS lets you add type annotations to your Ruby code in files with a new extension called .rbs. They look like this:

class MyClass
  def my_method : (my_param: String) -> String
end

By providing type annotations with RBS you get benefits such as:

  • a clean and concise way to define the structure of your codebase.
  • a safer way to add types to your legacy code via files rather than changing the classes directly.
  • the potential to universally integrate with static and dynamic type checkers.
  • new features to deal with method overloading, duck typing, dynamic interfaces, and more.

But wait! Aren't there already static type checkers…

Honeybadger Developer Blog 

Using Redis as a Cache in Laravel

Laravel is a web application framework built with PHP. It’s a framework that uses providers and dependency injections for code organization. It follows a model-view-controller design pattern. Laravel reuses the existing components of different frameworks, which helps in creating a web application. The web application thus designed is more structured and pragmatic.

Redis is a disk-persistent key-value database with support for multiple data structures or data types, which means that while it supports mapped key-value-based strings to store and retrieve data (analogous to the data model supported in traditional kinds of databases), it also supports other complex data structures, such as…

Laravel supports the use…

Everyday Rails 

Automatic code review with Pronto and GitHub Actions

Nobody likes to be the one to pick through your pull request for style guide and security violations. Here's how to ask robots to do the work for you, automatically!
Riding Rails 

Active Record Encrytion, several performance optimizations, and much MORE!

Hi, zzak here! お久しぶりです! This time I will be recapping the past month or so of Rails. Hang on! There’s a ton of stuff to catch up on!!

Active Record Encryption

Originally extracted from HEY, this feature adds encrypted attributes to Active Record models. You can find out more in the guide.

Optimize Cache::Entry coder

Active Support’s cache has received a significant speed bump that was well overdue.

Optimize Active Model generated attribute methods

This optimization should reduce memory overhead and speed up boot times.

7x speed up for ActiveRecord::Base.logger

By converting AR::Base.logger to a class_attribute we had significant performance gains.

Allow nesting locales for Engines

Test Double Blog 

To Reach Diversity, Focus on Equity

The world of business has long talked about DEI: Diversity, Equity, and Inclusion. This is an acronym that many people know, and many companies have talked about even more in the last year.
Remote Ruby 

Joined by CJ Avilla from Stripe

[00:03:26] CJ tells us about himself and what he does at Stripe.


[00:07:18] We learn about two different paths and what Stripe does beyond card payments.


[00:09:21] Chris wonders since CJ knows Ruby, if he ends up doing every language and every front-end framework too. Chris talks about using Sinatra as well.


[00:12:48] CJ asks Chris how much Swift code he had to write or if he was using SwiftUI for his newly released iOS app for Jumpstart. 


[00:15:32] CJ helps Chris out with how he can do payment stuff for iOS versus the web with Stripe, and he tells us new things that are coming up with Stripe very soon. 


[00:16:52] Chris brings up the publishable key and then tells us about…

The RubyMine Blog : The Ruby on Rails IDE | JetBrains Blog 

RubyMine 2021.2 EAP Is Open!

Hello and welcome to RubyMine’s second Early Access Program of 2021!

Over the next couple of months, we will be publishing posts about the new features of the upcoming 2021.2 version. To learn about them as they come out, feel free to subscribe to the blog updates or follow us on Twitter.

RubyMine 2021.2 EAP

As always, you are welcome to try the new features before the official release, and we are looking forward to hearing your feedback!

DOWNLOAD RUBYMINE 2021.2 EAP

Here are the main highlights of this week’s build.

Ruby 3 RBS support

In this release, we aim to make working with RBS code more intuitive and efficient. Specifically, we’re making essential RubyMine features that you already use for regular Ruby…

AppFolio Engineering 

Quality Assurance at AppFolio Property Manager 2021

QA-logo.png

An AppFolio engineering team typically consists of three to five software engineers, a product manager, a UX designer, and a QA engineer. Within our agile-based teams, the QA Engineer is in a unique position. The QA engineer can have a wide range of experience across different domains due to the cross-functional responsibilities that the role requires. Depending on the team and situation, the role’s breadth of knowledge overlaps with the product expert, voice of the customer, developer, product manager, agile coach,…

Notes to self 

Tailwind is an interesting concept, but I am not convinced yet

Tailwind 2 is all the rage now. With a beautiful landing page, promising productivity, and thousands of people swearing by it, could Tailwind be the future of front-end design? I am still not convinced.

What is Tailwind? Tailwind is a Tachyons school of thinking that preaches the utility-first approach to CSS. Whereas frameworks like Bootstrap and Bulma give you basic styling, pre-designed components, and utility classes, Tailwind gives you only the utility classes that you can combine to components yourself with just HTML extraction.

There is a lot of praise published on Tailwind – and some critics as well. I don’t feel like repeating it. Rather, I will make this post about my personal…

Awesome Ruby Newsletter 

💎 Issue 262 - Ruby 3 JIT can make Rails faster

Ruby Weekly 

JIT to the future

#​554 — May 27, 2021

Read on the Web

Ruby Weekly

Ruby 3 JIT Can Make Rails Faster — Ruby introducing its own JIT compiler got people pretty excited at the potential performance increases, but it hasn't suited many real world situations, such as Rails apps, so far. But things are changing. Taking a “compile all the things” approach with Ruby 3.0 can bring performance improvements (modest for now, but it’s promising).

Takashi Kokubun

ObjectTracer 1.0: Tracks Objects and Records Their Activities — Formerly known as tapping_device (we linked to it in #473) you’d use this to ‘listen’ to the events taking…

Stan Lo

Free eBook: Efficient Search in…

OmbuLabs Blog 

The L in SOLID

This post is the third one in the SOLID principles series. The first post discussed the single responsibility principle and in the second post we discussed the open / closed principle. Next, as the title suggests, we will take a look at the principle represented by the letter L from the SOLID acronym. L is for the Liskov Substitution Principle (LSP).

In simple terms LSP requires that supertypes and subtypes be swappable without affecting the correctness of a program.

What

Barbara Liskov is an ACM Turing Award receiver and she introduced LSP during a keynote in 1987. LSP is a principle, similar to Design by Contract, where emphasis is placed on the contract a base class defines for its…

Engine Yard Blog 

Homemade Kubernetes: Liberation or Burden?

 

Frank’s blog 

My favorite Ruby gems

I’m always hesistant when it comes to using gems. Every gem you add to a project is a bit of added risk, what if it contains a security bug? What if the developers stop maitaining it? What if it doesn’t work with the next Ruby version? Of course, building everything yourself is not an option either. Through the years I’ve built a list of gems I trust and use. So far I’ve never shared these anywhere public. I’m changing that with this post.

Authentication and authorization

  • devise

    Authentication with features like locking, forgot password, remembering sign in.

  • pundit

    A much clearer manner of authorizing users when compared to cancan.

  • acts_as_tenant

Output generation

Saeloun Blog 

Rails 7 adds `Enumerable#sole` to return a sole item in the enumerable

Rails 6.1 added two query options, namely #sole and #find_sole_by to the ActiveRecord::FinderMethods. These methods assert that only one unique record is returned from the database.

In Rails 7, Enumerable#sole was added to the Enumerable module which behaves similar to ActiveRecord::FinderMethods methods - #sole and #find_sole_by.

Before

Let’s say we have an app where User can have multiple api_keys associated with their accounts. Each api_key will be associated with a particular type. To implement the above scenario we will design our User and ApiKey models as shown below:


# app/models/user.rb
class User < ApplicationRecord
  has_many :api_keys
end


# app/models/api_key.rb
class Ap…
Ruby on Rails Podcast 

372: The Railsconf 2021 Story with Marty Haught and Evan Phoenix

Marty Haught and Evan Phoenix, Directors of Ruby Central, guested on the show to explain Ruby Central's place in our community, how Railsconf 2021 came together and what we can expect from the upcoming Rubyconf 2021 as a dual virtual and in-person conference.

Links for this episode:

All Ruby Podcasts by Devchat.tv 

Upgrading from Sprockets to Webpacker with Ariel Juodziukynas - RUBY 499

Ariel Juodziukynas joins the Rogues to talk about how to upgrade your Ruby on Rails application from Sprockets to Webpacker.

Sprockets was introduced in Rails 3.1 to help you manage your static assets including JavaScript. Webpack came along to help manage JavaScript and eventually other assets later on and was adopted into Rails in version 5 and is now the preferred way to manage JavaScript assets in Ruby on Rails applications.

Ariel has written a guide on how to move from Sprockets to Webpacker and discussed with the Rogues the pros, cons, and pitfalls of such a move in your applications.

Panel

  • John Epperson
  • Luke Stutters

Guest

  • Ariel Juodziukynas

Sponsors

Greater Than Code 

236: Connecting Arts and Technology – The Power of Print with Marlena Compton

01:07 - Marlena’s Superpower: Bringing the Arts to Tech

  • Coming Into Tech as a Creative

04:42 - Parallels Between Art and Computer Science/Software Engineering

09:33 - Sketchnoting and Zines

14:19 - DIY Publishing and Physicality – The Power of Print

20:33 - Zines at Work & Zines in Professional Settings

  • Slowing Down Our Thought Processes
  • Using Diagrams to Ask Questions & For Exploration
  • Graphic…

31:11 - Target Audiences, Codeswitching, & People Are Not Robots

37:5…

RubyGems Blog 

3.2.18 Released

RubyGems 3.2.18 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:

  • Don’t leave temporary directory around when building extensions to improve build reproducibility. Pull request #4610 by baloo

SHA256 Checksums:

  • rubygems-3.2.18.tgz
    745715dba662237345a5c1fd893cde2d58c08f5874961c05c7b0d9d2be340323
  • rubygems-3.2.18.zip
    920670887c43ee1e3440e9ef654182ce7b4694caa69e9344c1d74502401f667e
  • rubygems-update-3.2.18.gem
    92c6a06ff1a960b5fe82c0a4e06f368a92e8702d7732fa34b0f12cce1fc511d9
Rails with Jason 

097 - Chris Oliver, Creator of GoRails

In this episode I talk with Chris Oliver, creator of GoRails, HatchBox and Jumpstart Pro. We talk about the GoRails story, the challenges of deploying apps, and Chris's new house.

Links:

Dmitry Ishkov 

Track Opened Emails In Rails

article logo

Tracking opened emails is a technique that, if used responsibly, can provide utility to both you and your users.
Here a few use cases where it makes sense to me:

  • Appointment updates. If your appointment in a car dealership was rescheduled an email is sent. If the email is not read in the next couple of hours a repeat email can be sent or a CS agent may follow up with a call.
  • Uber-style fulfillment, where contractors are notified of lucrative jobs available to them. If nobody claims a job, a CS agent can go through users who are known not to have read the email.
  • Providing estimates to event organizers how many people are going to show up based a on number of opened…

In this article, we are going to implement such a system for transactional emails using Rails and Postmark (a service that sends emails). We are going to use the Postmark gem.

Usage

First of all, let's see how the code usage of the tool we are building is going to look like:

def new_blog_post(blog_post, subscriber)
store_message(
email_name: 'new_blog_post',
entity: blog_post,
Saeloun Blog 

Rails 7 adds range serializer for ActiveJob

When using Rails, we often need to run tasks in the background without affecting website performance. Rails 4.2 introduced the ActiveJob framework to standardize scheduling background jobs.

A simple example where the ActiveJob use-case fits correctly is sending an email verification when a user signs up as shown below.

class EmailVerificationJob < ActiveJob::Base

  def perform(user_id:, email_verification_code:)
    # send verification code to user email
  end
end

In the above example, we have passed user_id and email_verification_code as arguments to the perform method. ActiveJob performs serialization and deserialization on these arguments. The below argument types are supported…

Basic types (
BigBinary Blog 

Debug Node.js app running in a Docker container

A Docker container is a standard unit of software that packages up code and allits dependencies so the application runs quickly and reliably from one computingenvironment to another. One who have dealt with it would have wanted to debugtheir application like they do it normally, but it often feels difficult toconfigure. Let's do it in a simple way.

1. Install Docker Extension for VSCode

<img width="1791" alt="VSCode_Docker_Extension" src="/blog_images/docker/vscode_docker_extension.png">

This extension will be responsible for VSCode to debug an app inside the Dockercontainer. It will also enable us to manage Docker images and containers.

2. Expose port 9229 in the docker-compose.yml

Port 9229 is…

The Bike Shed 

294: Perfect Duplication

On this week's episode, Steph and Chris respond to a listener question about how to know if we're improving as developers. They discuss the heuristics they think about when it comes to improving, how they've helped the teams they've worked with plan for and measure their growth, and some specific tips for improving.

Transcript

CHRIS: There's something intriguing about the fact that we're having this conversation, but the thing that's recorded just starts at this…

Josh Software 

Simple and Powerful ReverseProxy in Go

In this article we will learn about reverse proxy, where to use it and how to implement it in Golang.  A reverse proxy is a server that sits in front of web servers and forwards client (e.g. web browser) requests to web servers. They give you control over the request from clients and responses from … Continue reading Simple and Powerful ReverseProxy in Go
Test Double Blog 

Equity, Diversity, and Inclusion: the temptation in 2020 to sabotage our own efforts

We’ve recently switched from using the term DEI to EDI as a point of clarification around our strategy. DEI—diversity, equity, and inclusion—is more widely used, but EDI—putting equity first—is gaining traction, and for good reason.
Julia Evans 

Blog about what you've struggled with

I was talking to Jemma recently about what stops people from blogging. One barrier that stood out to me was: it’s hard to identify which things you know will be useful to other people!

The process I use for a lot of my blog posts is:

  1. Struggle with something (usually computer-related)
  2. Eventually (days or months or years later), figure out how to solve some of the problems I had
  3. Write a blog post about what helped me

I think this approach is effective because if I struggled with something, there’s a pretty good chance that other people are struggling with it too, and what I learned is likely to be useful to at least some of them!

Obviously this isn’t the only approach to blogging, but…