Rubyland

news, opinion, tutorials, about ruby, aggregated
Sources About
Josh Software 

Using Signed URLs With Google Cloud Storage

Imagine that you have a mobile application that needs to store images in Google Cloud Storage. Instead of sending these from your mobile device to your API for storage, it’s more efficient to have your mobile application save these files to cloud storage directly. But how might you do that? The answer: Signed URLs – … Continue reading Using Signed URLs With Google Cloud Storage
avdi.codes 

Re-Use SSH Config Inside Docker Containers with WSL2

Docker and WSL have been getting more and more chummy lately. The Docker Desktop WSL2 backend integrates Docker containers with the “official” integrated Windows/Linux ecosystem (boy that still feels a little weird to write…) and gains performance perks in the process.

However, I ran into some trouble recently getting SSH to work inside of a Docker container. As I’ve written about before, I like to bind-in my credentials from my host machine, rather than proliferating credentials into containers. When a container needs to SSH out to the wider world, that means binding in my .ssh directory from the host, e.g. with a docker-compose.yml:

    volumes: 
      - type: bind
       …
OmbuLabs Blog 

What We Learned Developing Snap Minis (Part 1)

Over the last few months, we developed a couple of Snap Minis. Minis are small static web apps that are run inside a webview within the Snapchat native app.

One important part of the development was to make sure our Mini works well across different devices, especially making sure things work the same in both Android's webview (Chrome by default) and iOS's webview (Safari).

In this post I'll talk about a few things to keep in mind when working with the Snap Canvas SDK and in the next one I'll talk about some common and known issues you'll encounter when making your app cross-mobile-browser compatible.

Working with the SDK

Snapchat provides a JavaScript SDK that you'll have to include…

Long live Ruby 

Ruby Struct

In simple words, Ruby Struct is a built-in class that provides useful functionalities and shortcuts. You can use it for both logic and tests. I will quickly go through its features, compare with other similar stuff, and show some less-known but still useful information about it.
Long live Ruby 

Cable Ready - use websockets in Rails app without custom JavaScript

Cable Ready is a great addition for Action Cable, especially if you don't like to write JavaScript code to interact with your website's DOM in a real-time. It helps us to quickly write real-time applications that work out of the box. To demonstrate the features that the gem provides, we will build a simple chat where new messages will appear on the website without reloading. We will start with creating a brand-new Rails application, creating a little code, adding the Cable Ready gem, and making things real-time.
Long live Ruby 

How Sidekiq really works

Exploring how Sidekiq works to see how it connects to Redis and provides useful features for background job processing
Riding Rails 

New API Docs site, configurable cache coder, bug fixes, and more!

Hi there! This is Andy bringing you the latest on what’s shipped this week in Ruby on Rails!

New API docs back-end

The frames-based Rails API docs site has been replaced with CSS and Turbolinks. Deep linking is now supported! Let’s take a moment and remember the humble 1990s era <frame/>! Check it out at https://edgeapi.rubyonrails.org.

Stable sorting for DatabaseConfigurations#find_db_config

Sorting configuration for multiple databases was not guaranteed to be stable. This PR fixes that, and includes a supporting test with more information.

Handle binary strings in Active Record serialized columns

When binary data is stored in a serialized column, this change ensures that the…

Riding Rails 

Active Record values_at and cache improvements

Hi, it’s Wojtek bringing you the latest changes summary from Ruby on Rails codebase.

Add values_at method to Active Record

Simplifies retrieving values of specific attributes on Active Record model instance, ie person.values_at(:name, :age).

Use environment variable MEMCACHE_SERVERS by default

When no specific configuration is provided, MEMCACHE_SERVERS environment variable will be checked first before falling back to localhost 127.0.0.1:11211 address in ActiveSupport::Cache::MemCacheStore.

Add store name to cache instrumentation

When subscribing to a “cache” instrumentation events, additional parameter with store name is provided to ease recognizing the context.

12 people

Remote Ruby 

Self-care as a developer, Ruby 3.0, Sorbet, and more

[00:01:38] Andrew tells us about his weekend having to truncate 250 million rows and how he had to take care of a few issues.  Jason talks about what he’s been using to search. 
[00:05:14] Jason talks about using a Laravel package called Scout. 
[00:06:50] Andrew tells us about having wrist problems and is trying to come up with solutions to help his situation. He asks Jason if he has any suggestions. They both chat about what they do for self-care and how they could manage stress better. 
[00:18:50] Since Andrew has been eating so terribly, he decided to get Blue Apron, the meal delivery service, and he loves it!  It has transformed his diet. ☺ Jason talks about his difficult…
Awesome Ruby Newsletter 

💎 Issue 231 - RuboCop 1.0

Code with Jason 

How I set up a Rails application for testing

Below is how I set up a fresh Rails application for testing. I’ll describe it in three parts:

  1. An application template that can add all the necessary gems and configuration
  2. My setup process (commands I run to create a new Rails app)
  3. A breakdown of the gems I use

Let’s start with the application template.

My application template

First, if you don’t know, it’s possible to create a file called an application template that you can use to create a Rails application with certain code or configuration included. This is useful if you create a lot of new Rails applications with parts in common.

Here’s an application template I created that will do two things: 1) install a handful of testing-related…

Valentino Gagliardi - RSS Feed 

Pytest cheat sheet

Pytest cheatsheet

Testing file writes with Pytest

Consider a simple class with one or more methods for file write/access:

from pathlib import Path


class UnderTest:
    def __init__(self):
        self.BASE_DIR = Path(__file__).parent

    def save_log(self):
        with open(self.BASE_DIR / "log-file.log", "a") as logfile:
            logfile.write("a dummy line")

To test this code as it is you would probably mock open(), or patch BASE_DIR in your tests, an approach I don't like too much.

NOTE:

BigBinary Blog 

Rails 6.1 supports order DESC for find_each, find_in_batches, and in_batches

This blog is part of our Rails 6.1 series.

Before Rails 6.1, batch processing methods like find_each, find_in_batches and in_batches didn’t support the ORDER BY clause. By default the order was set to id ASC.

> User.find_each{|user| puts user.inspect}

User Load (0.4ms)  SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ?  [["LIMIT", 1000]]

Rails 6.1 now supports ORDER BY id for ActiveRecord batch processing methods like find_each, find_in_batches, and in_batches. This would allow us to retrieve the records in ascending or descending order of ID.

> User.find_each(order: :desc){|user| puts user.inspect}

User Load (0.4ms)  SELECT "users".* FROM "users" ORDER BY "users"."id" D…
> User.find_in_batches(order: :desc) do |users|
>   users.each do |user|
>     pu…
Ruby Weekly 

RuboCop goes 1.0

#524 — October 22, 2020

Read on the Web

💬 If you enjoy the interviews we do from time to time, this issue concludes with a rather perky one with Nick Sutterer of Trailblazer fame!

Ruby Weekly

RuboCop 1.0: The Ruby Static Code Analyzer — After seven (yes, 7) years, RuboCop makes 1.0. Bozhidar (we shared this interview with him back in issue #406) and his team have created one of the canonical Ruby tools. Congrats!

Bozhidar Batsov

Three Ruby Performance Myths: GC and Concurrency — Nate debunks three common myths about Ruby’s performance, putting forth a single reason why Ruby isn’t faster, and it has more…

Nate Berkopec

Test Double | Our Blog 

5 for 5000: Find your Leading Indicators

This post is the fifth and final in a five part series celebrating Test Double’s five-year run on the Inc. 5000 list of fastest growing companies: Widen the Goalposts for Success The Customer is Usually Right Profits are Good, Actually Do Right by Everyone Find your Leading Indicators (this post) Turn lagging statistics into leading indicators I mentioned earlier that lists like the Inc.
JetRockets 

Jet Rockets Leads the Pack on Web and Custom Software Development According to Clutch

Our team here at JetRockets has some incredibly exciting news to share with all of you! Clutch just issued a press release where they listed us as one of New York’s top web, custom software, and mobile app developers!
OmbuLabs Blog 

Introducing Points - A blind estimation tool from OmbuLabs

At OmbuLabs our goal is always to smooth processes, and make work easier. Isn’t that what software engineering is really all about in the first place?

When we are getting ready to do a project or to make a proposal one of the questions that we are always asked by clients is “how long will it take”? To come up with an estimate on timing we like to use a system of points and blind estimates by multiple team members to find an average of how complex the project will be. We can then use this information, together with our database of delivered projects, to estimate how long the project will take.

To accomplish this, and make the process smoother we built a tool called Points and now we have m…

Ruby on Rails Podcast 

341: Fearless Principles with Jason Taylor

Jason Taylor is currently a Principal Software Engineer at TextUs. He has been a software engineer for 15 years but it is his first ever podcast appearance! He and Brittany dig into what being a principal means (key: confidence) and discuss some spooky Rails horror stories.

Links for this episode:

Brought to you by:

Scout APM

Give Scout a try for free today and Scout will donate $5 to the open source project of your choice when you deploy.

Greater Than Code 

205: Breaking Silos and Creating Opportunity Via Remote Work with Amir Salihefendić

02:16 - Amir’s Superpower: Learning

  • The Value of Knowledge Work

05:42 - Growing Up As a Refugee

  • Maintaining Focus During Change

11:04 - A Founder’s Mindset

19:06 - Remote Work

  • Opportunities and Implications
  • Handling Skepticism
  • Impact on Local Community
  • Remote-First Companies
  • Salary Transparency
  • Hiring Based on Mission

More Resources on Remote Work From Amir:

Reflections:

John: The impact…

Alfredo Motta 

Not So Random Software #40 – Decisions and Team Topologies

Hello everyone and welcome back to Not So Random Software! This week I have been thinking about teams and specifically about how trust is build …
Martian Chronicles, Evil Martians’ team blog 

Finding growth: how to hack eBaymag with Growth Hacking

Authors: Alena Kirdina, Designer at Evil Martians and Sara Dolgan, Developer at Evil Martians, Open Source activist

In this article, Evil Martians are auditioning for the part of Mythbusters show and destroying the myth that Growth Hacking is a controversial practice based on dark patterns. We have discovered an extremely practical and fair way to use it for engineering processes. Having been tested for several months on the official eBay project, eBaymag, it brought real revenue boost and development resources savings. Busted! 2 Growth Hackers and 0 dark patterns applied.

Growth Hacking, a technique to attain exponential growth for business results, today is a catchword with reams of…

Rails with Jason 

067 - Rails, Ansible and AWS with Axel Kee, Author of RubyYagi.com

In this episode I talk with Axel Kee about Ansible. Axel hosts his Rails application on AWS using Ansible as an infrastructure management tool, and so do I, so Axel and I compared notes on our respective setups. We also raised a recurring topic on the podcast: goats.

Links:

Long live Ruby 

Explaining magic behind popular Ruby code

Ruby language allows us to easily create beautiful DSL's and design complex libraries that anybody can easily use, despite programming experience. The code often looks perfect, but sometimes it is not clear how it was achieved under the hood. In this article, I explain a few solutions that are quite popular among many gems, and you can easily use it in your projects once you understand how you can build a similar code.
The Bike Shed 

265: There Are No Free Lunches

On this week's episode, Steph and Chris chat about database transactions and job queues, building static sites with GatsbyJS and NetlifyCMS, the performance impacts of front end frameworks and static content, and lastly they catch up on Hacktoberfest and the complexities of encouraging and supporting work in open source.


This episode is brought to you by:

  • ScoutAPM - Give Scout a try for free today and Scout will donate $5 to the open source project of your choice when you deploy
  • Datadog. Click through to get a free 14-day trial and a free Datadog t-shirt!

Ruby Together News 

September 2020 Monthly Update

Hello! Welcome to the monthly update. During September, our work was supported by Zendesk, DigitalOcean, Bleacher Report, and many others.

ruby together news

In September, Ruby Together was supported by 42 different companies, including Sapphire member Stripe. One company joined as a new member, and Loic Nageleisen signed up as a developer member. In total, we were supported by 102 developer members. Thanks to all of our members for making everything that we do possible. <3

rubygems news

This month, we did a lot of work triaging issues and so far we’re “winning the pulse” with over 80 issues closed vs only 14 opened, and 44 PRs merged vs 8 opened. We’ve also fixed a couple of new and…

The Rails Tech Debt Blog 

How We Estimate The Size of a Rails Application

When inheriting a project, it is useful to understand how big and complex the application really is. So, what is a good way to understand whether a Rails application is tiny, medium, or huge?

The good news is that there are a couple of gems that make this easy for us.

In this article I will explain how you can use these gems to begin to understand the size and complexity of a Rails application.

In all my examples, I will use our open source, Ruby on Rails 6.0, dashboard application: Dash.

Application Size

When evaluating a Ruby or Rails application, you need to count the codebase and its dependencies:

  • Dependencies: usually, the more dependencies in your application, the harder it…
Ruby Yagi 🐐 

How to integrate HTML / Bootstrap theme into Rails 6

Say you just bought a Bootstrap theme (or any HTML template) and want to integrate it to Rails 6, where do you start? 🤔

This tutorial aims to guide the integration process, outlining a few main steps, the whole integration process might take a few hours to a few days depending on how big or complex for the template you bought.

Table of contents

  1. Install related NPM packages
  2. Bootstrap, Jquery and Popper.js
  3. Install custom (proprietary) Javascript libraries
  4. Copying CSS and Images
  5. Copying HTML Files
  6. Debugging Javascript issues

I will be using the Front Bootstrap Theme for this tutorial, you can use your own theme, I think the steps should be similar.

front bootstrap screenshot

I suggest creating a controller and a view, and route…

Soulcutter 

White Fox Keyboard Project

I wrote this on a forum that was not-necessarily technical, so I tried to be clear and not make assumptions about mechanical keyboard or electronics knowledge. The underlying theme is that this is an approachable project for beginners, like myself. Alright, strap in: this is a nerdy hobby.

I’m a programmer and engineering manager, so I’m on a computer all day. The keyboard is your interface to the computer and so naturally there’s a hobby around building and customizing your personal keyboard. You can buy pre-built keyboards to your specifications or you can buy kits that need varying levels of assembly. If you’re deep down the rabbit hole you can custom design your own or get into the…

OmbuLabs Blog 

The importance of proper time tracking

As a software consulting company, we bill for the time we work on client projects. So it is vital for us to keep track of the time we put into every task. We've had some trouble over the years with our time tracking, and sometimes that led us to work more time than what we finally billed for. We would like to share some of the experience we have collected over the years and the tools that we currently use.

Implications Of Poor Time Tracking

Poor time tracking can cause direct and indirect damage to companies like ours.

Direct

  • Impact in revenue: Less hours tracked for client projects means less hours billed at the end of the billing period for the same amount of work. Over delivering…

avdi.codes 

Controlling superclass argument pass-through in Ruby

In Ruby class-based programming, superclass versions of subclass methods are always invoked explicitly using the super keyword. There are some nuances to using super though, particularly when it comes to passing (or not passing) arguments and blocks along to the base class. In this sample from from the RubyTapas archives, we’ll talk about some of those “gotchas”.

Director’s commentary: This was originally published as RubyTapas #14 in October 2012. I used to have a habit of saying “as you know” in my scripts, I think because I was afraid my audience would see something they already knew at the start of the episode and think “oh this is nothing new”. I don’t say that kind of thing as…

Remote Ruby 

Getting started in Ruby & Rails with Will Johnson

[00:00:25] What have the guys been up to? Jason tells us he’s been working on his editor project with Reflex and Cable Ready, Chris has been working on Stimulus Reflex, and Andrew’s project is trying to truncate a table that has 225 million records in it! Yikes! Fingers crossed for Andrew! 
[00:07:20] Will tells us all about himself and how he got into Rails. 
[00:09:02] Will gives us a synopsis of his E-book, Break Into Tech With Twitter, that was released a few weeks ago. 
[00:10:21] Andrew asks Will, as a newer developer, what it’s like transitioning from JavaScript into Ruby on Rails.
[00:12:40] Chris wonders if going from JavaScript with all the call backs into Ruby if it was hard…
Planet Argon Blog 

Finding Strength and Purpose in Collaboration: GitHub Interview

Awesome Ruby Newsletter 

💎 Issue 230 - The Ruby world beyond Ruby on Rails

Honeybadger Developer Blog 

Conditionally deploying parts of your CloudFormation stack with the Serverless Framework

While working on putting the finishing touches on v1 of Hook Relay, we decided to try using AWS Timestream, AWS' recently-released time series database. This led to a problem with deploying our stack, since we are using the Serverless Framework to deploy the Lambda functions we are using to multiple AWS regions.

The problem was that Timestream isn't yet available in all the regions we are using, so the CloudFormation stack that is being generated by the framework isn't valid in those regions that don't have Timestream. There isn't a built-in way to exclude a portion of the resources block (the portion that creates the Timestream database and table) when deploying to specific regions, so we…

RubyGems Blog 

September 2020 RubyGems Updates

September 2020 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, Ruby Toolbox and RubyGems.org in September.

RubyGems News

This month, we did a lot of work triaging issues and so far we’re “winning the pulse” with over 80 issues closed vs only 14 opened, and 44 PRs merged vs 8 opened. We’ve also fixed a couple of new and outstanding issues some of which include:

  • fixing resolver, which until recently was generating duplicate spec groups, making debug output much more verbose than it should.
  • improving install for a…
Ruby Weekly 

Typing opinions, better Ruby docs, and the world beyond Rails

#523 — October 15, 2020

Read on the Web

💎 Many of you picked up on my lamentations over Ruby vs Rails content last week and I now have a pile of submissions to consider for future issues – thanks! You'll be glad to know none of today's features are Rails specific 😉
___
Peter Cooper (@peterc)

Ruby Weekly

The World Beyond Rails: Other Ruby Web Frameworks — High level overviews of eight alternatives to Rails, most of which have been around for several years already, including Sinatra, Roda, Padrino, and Cuba.

Paweł Dąbrowski

An Opinion on Ruby 3 Typing — Brandur works at Stripe (though not on the Sorbet

Engine Yard Blog 

Containers vs Virtual Machines - Differences, Pros, & Cons

Before the rise of containerization, virtual machines were the way to go if you needed to isolate environments within a physical infrastructure.

Engine Yard Blog 

Best Practices for Application Deployment in 2020

In this age of technology, web applications are everywhere in our lives. There are many hurdles in the application deployment process, and many steps to get a web app to the production environment and onto the end user's device. Software deployment is an essential step in an application's life cycle, so it is imperative to have good habits to deploy the application and develop it.

Valentino Gagliardi - RSS Feed 

Tiny Python refactorings: try/except - with

Scenario: Execute a command based on an id, if this id is present in the given file, otherwise execute a different command and save the resulting id in a file. This will be picked up later in a future execution.

A naive implementation

import subprocess


def do_stuff():
    """
    Execute a command based on an id,
    if a certain id is present in the given file.
    """
    file = open("last_id.txt")
    id = file.readline()
    if id:
        subprocess.run(["echo", id])
        file.close()
        return
    file.close()
    """
    Execute a command and save the resulting id in a file. 
    This will be picked up later in a future execution.
    """
    completed_process = subprocess.

The problem with this is code is that it throws because it can't find the file on the first execution:

FileNotFoundError:…
BigBinary Blog 

Rails 6.1 supports order DESC for find_each, find_in_batches, and in_batches

This blog is part of our Rails 6.1 series.

Before Rails 6.1, batch processing methods like find_each, find_in_batches and in_batches didn’t support order_by clause. By default the order was set to id ASC.

> User.find_each{|user| puts user.inspect}

User Load (0.4ms)  SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ?  [["LIMIT", 1000]]

Rails 6.1 now supports order_by id for the ActiveRecord batch processing methods like find_each, find_in_batches, and in_batches. This would allow us to change the order of the records in ascending or descending order of ID.

> User.find_each(order: :desc){|user| puts user.inspect}

User Load (0.4ms)  SELECT "users".* FROM "users" ORDER BY "us…
> User.find_in_batches(order: :desc) do |users|
>   users.
Test Double | Our Blog 

5 for 5000: Do Right by Everyone

This post is the fourth in a five part series celebrating Test Double’s five-year run on the Inc. 5000 list of fastest growing companies: Widen the Goalposts for Success The Customer is Usually Right Profits are Good, Actually Do Right by Everyone (this post) Find your Leading Indicators Assume every problem has a positive-sum solution By now, you might be picking up on a theme: being a good person gets you half of the way to being a good businessperson.
Josh Software 

Efficient Evenly Distributed Sampling of Time Series Records in PostgreSQL

The Problem I have been working on an application that, at it’s heart, stores a large amount of data that is organized primarily through the use of a foreign key and a timestamp field. The table’s own primary key is UUID based, combining the foreign key with a UUID for the individual record itself, and … Continue reading Efficient Evenly Distributed Sampling of Time Series Records in PostgreSQL
Hi, we're Arkency 

Rails multitenancy story in 11 snippets of code

Story of Postgres schema multitenancy told in 9 snippets of code

Let me tell you the story of how we implemented Postgres-schema based multitenancy in one of the projects we dealt with. It was an existing single tenant system — though definitions vary. We were meant to multitenantize this system. That was the main precondition that made us pick schema-based approach, but overall, the decision is not obvious. We also went for the Apartment gem, as it was the most mature and popular — but it’s not currently maintained, so we ended up on one of the forks.

You can tell a story with a wall of text, but it’s not optimal for everyone. For example, children would rather see some pictures. When it…

Ruby on Rails Podcast 

339: kuby & Rails Deployments with Cameron Dutro

Cameron Dutro believes we need Active Deployment like we have Active Record and Active Storage. That's what kuby is - an easy way to deploy your Ruby on Rails application without getting your dev-ops black belt first.

Links for this episode:

Brought to you by:

Scout APM

Give Scout a try…

Ruby on Rails Podcast 

340: dry-rb, ROM.rb & “My Time with Rails is Up” with Piotr Solnica

Ruby is more than Rails. Brittany welcomed Piotr Solnica, Senior Ruby Backend Engineer at Castle.io and creator of ROM.rb and dry-rb core team member to the show to discuss his new job, OSS contributions and why he left Rails.

Links for this episode:

Brought to you by:

Scout APM

Give Scout a try for…

Greater Than Code 

204: Creating Community Spaces in The Age of COVID with Nicole Archambault

02:04 - Nicole’s Superpower: Empathy and Community Building

15:06 - Overcoming Isolation and Forming Connections in the Age of COVID-19

  • Masking
  • Vulnerability and Transparency

20:42 - Creating a Techincal Community

25:54 - Radiating Love and Compassion and Learning How-To Human

39:45 - Educational Tech Entrepreneurship (EdTech)

  • Non-Verbal Learning Disorders
  • T…
Honeybadger Developer Blog 

Everything You Ever Wanted To Know About View Caching In Rails

Caching is a general term that means storing the result of some code so that we can quickly retrieve it later. This allows us to, for example, avoid hitting the database over and over to get data that rarely changes. Although the general concept is the same for all types of caching, Rails provides us with different aids depending on what we are trying to cache.

For Rails developers, common forms of caching include memoization, low-level caching (both covered in previous parts of this caching series), and view caching, which we will cover here.

How Ruby on Rails Renders Views

First, let's cover some slightly confusing terminology. What the Rails community calls "views" are the files that…

Rails with Jason 

066 - Tom Rossi, Co-Founder of Buzzsprout

In this episode I talk with Tom Rossi, co-founder of Buzzsprout, about his entrepreneurial story. We talk about Tom's agency, Higher Pixels, and the products that grew out of that agency, including the podcasting platform Buzzsprout and the healthcare-related product StreamCare.

Links:

BigBinary Blog 

Ruby 3 adds Symbol#name

This blog is part of our Ruby 3.0 series.

All are excited about what Ruby 3.0 has to offer to the Ruby developers. There is already a lot of buzz that the feature set of Ruby 3.0 will change the perspective of developers how they look at Ruby.

One of the important aspects of Ruby 3.0 is optimization. The part of that optimization is the introduction of name method for Symbol. In this blog, we will take a look at what name method of class Symbol does and why it was introduced. The new name method is introduced on Symbol to simply convert a symbol into a string. Symbol#name returns a string. Let’s see how it works.

irb(main):001:0> :simba.name
=> 'simba'
irb(main):002:0> :simba.name.class

Wait…

Running with Ruby 

Diffend – OSS supply chain security and management platform for Ruby

I’m incredibly excited to announce a security platform for managing Ruby gems dependencies: diffend.io.

This platform is a result of my involvement in Ruby security matters for years. It all started in early 2018 with a tool to review gems versions diffs. While working on it, I’ve noticed that there’s much more that needs to be handled. Versions diffing while inevitable, by itself is insufficient, that’s why we’ve built this platform.

Getting started

If you’re just interested in the gems diffing, go to my.diffend.io and select any gem and versions you want to view. New releases for all the gems are computed in real-time, but for some of the older ones, you will have to wait a bit.

You can…

The Bike Shed 

264: How to Win Friends and Influence Processes

On this week's episode Steph and Chris discuss the ins and outs of joining teams, building trust, and working together to improve processes and communication. They also touch on some lesser used features of bundler, and revisit a discussion around Rails maintenance periods thanks to some listener feedback.


This episode is brought to you by:

  • Indeed - Click through and get started with a free seventy five dollar credit for your first job post
  • ExpressVPN - Click through to can get an extra 3 months free on a one-year package.

Sponsored By:

Supp…

All Ruby Podcasts by Devchat.tv 

RR 474: React on Rails V12 - Don't Shave That Yak! with Justin Gordon

React on Rails version 12 brings major improvements for hot reloading and bundle splitting. Justin Gordon talks about creating a great developer experience with React and Rails, the best way to manage your webpack configuration, simplify server and client-side rendering and avoid shaving those yaks!

Sponsors

Panel

  • John Epperson
  • Luke Stutters
  • Charles Max Wood

Guest

  • Justin Gordon

Links

P…

Alfredo Motta 

Not So Random Software #39 – Make it simple

Hello everyone and welcome back to Not So Random Software! This week I have enjoyed reading this article about complexity and how to think about …
GoRails Screencasts 

How to use Google Analytics gtag.js with Turbolinks & Webpacker

Learn how to add Google Analytics' gtag.js to Webpacker with Turbolinks support
Ruby Yagi 🐐 

Solve slow webpack compilation when using Tailwind @apply

In the introduction to Tailwind post, I mentioned using @apply to extract components like this  :

/* application.scss */
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";


.red-card {
  @apply bg-red-500 my-4 w-3/4 mx-auto p-4;
}

.red-card p {
  @apply text-white text-2xl;
}


Using this worked fine for me, but I started noticing the page would take a while to refresh whenever I made change on the application.scss file, even with just two @apply statements, it took nearly 5 seconds to recompile on webpack!

slow

Means every time I made change on the CSS, I have to wait 5 seconds to see the output, and multiply it with numbers of time I make changes on…

Martian Chronicles, Evil Martians’ team blog 

Figma DIY: Building a color system plugin

Author: Roman Shamin, Art Director at Evil Martians

Learn how to build a missing Figma feature with just some basic knowledge of HTML, CSS, and JavaScript. In this step-by-step tutorial, we draw up a simple mock interface, discover a better way of working with colors and create a small plugin that makes it possible. If you are working at the intersection of design and web development—this post is for you.

Before we jump into coding, we will make a case for a missing Figma feature that could change the way we manage colors in a growing design project. Once we think up a dynamic color system—we will implement it by extending the feature set of Figma with our simple plugin.

If you have…

Long live Ruby 

World beyond Rails - web frameworks

Even though Ruby owes most of its popularity to the Ruby on Rails framework, many other great frameworks and libraries also exist in the community. Because they are not so popular as Rails, you can rarely read about them on blogs or see them being mentioned in the newsletters. This article is an overview of interesting but less hyped solutions that still worth learning and using to build awesomeness with Ruby.
Riding Rails 

A security release, bugfixes and more!

Hey, this is Greg, bringing you the latest news about Ruby on Rails!

Rails 6.0.3.4 has been released!

Rails 6.0.3.4 has been released! It is a security release and addresses a possible XSS attack vector in Actionable Exceptions.
You can read more about the issue here and check the commit with the fix here.

Optimize ActiveRecord::Relation#include? on an unloaded relation

This PR introduces an exists? call instead of loading the entire relation into memory and that makes it better performing.

Fix ActiveRecord::Relation#include? in case where offset is provided

A follow-up PR for the above improvement, because the original solution broke includes? when an offset was provided, but this…

Toxic Elephant 

Some development automation

For a long time, part of my weekend routine has been updating the dependencies of all my open source Ruby projects. I had set up some tooling to automatically run bundle outdated on all my project directories and make a nice report. For good measure, it would also run RuboCop and tell me if any work was needed on that front.

I would then go through the list of needed work, adjust the dependencies (using KeepUp where possible), activate new RuboCop cops, fix new RuboCop offenses, create pull requests, wait for builds to be done and then merge. There actually was a certain satisfaction in keeping things up-to-date, keeping things neat.

A few weeks ago, I’d had enough. The process of keeping…

Planet Argon Blog 

Go the Distance: Navigating My Remote Internship

Go the Distance: Navigating My Remote Internship

Planet Argon recently began offering internships outside of their local region to take advantage of the current remote working environment of the company. Our digital marketing intern, Lucy Zheng, talks about her experience interning for Planet Argon while being based in Georgia.

Continue Reading

avdi.codes 

Ruby Singleton Objects

Here’s another freebie from the deep RubyTapas stacks. This one is about a truth of object modeling that we don’t often talk about: not every object needs to have state. If an object has no state, there’s no need to have more than one of it. And for stateless objects, having a class just to generate a single instance may be superfluous!

Director’s commentary: This one first aired as episode #13 in October 2012. In retrospect I’d tighten up the pacing on. And I hate that the ending monologue on the Singleton pattern has no illustration on the screen. Also, I really hope I don’t sound that bored in more recent videos.


While I was at Ruby DCamp a few weeks ago Sandi Metz

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

RubyMine 2020.2.3 Is Available

RubyMine 2020.2.3, a bug-fix update for v2020.2, is now available!

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

You’ll find the following improvements in this update:

  • Fixed an issue with the built-in terminal not executing commands: RUBY-27030
  • Fixed indexing for projects with the twofish gem: RUBY-26862
  • Fixed an issue causing minitest to fail for tests with spaces in the file path: RUBY-26973
  • The Search Everywhere popup no longer opens partially offscreen: IDEA-230328

Check out the release notes for the complete list of closed tickets. And, as always, please report any issues you find.

Happy developin

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

RubyMine 2020.3 EAP3: Structure.sql Support, Improved Markdown Editing, and More

RubyMine 2020.3 EAP3 is now available! Here are the main highlights of this build:

Support for structure.sql

We’ve added structure.sql support for projects that use it instead of a schema.rb file.

Make sure that you have chosen an SQL dialect for your project. To do so, go to Preferences | Settings | Languages & Frameworks | SQL Dialects. From the drop-down list, choose a dialect – SQLite, for example.

Now you can use autocompletion for models that rely on structure.sql. You can also navigate between your Rails…

Remote Ruby 

Joined by Adam Wathan: TailwindCSS, Tailwind UI, and ActionView Components

In this episode we welcome back a special guest, Adam Wathan, creator of Tailwind CSS. We find out some cool things that have happened in Tailwind, new things that have launched in Tailwind UI, and issues he ran into when building it. Adam tells us about a work system they use called the six-week cycle with a two-week cool down, which really helps with prioritizing things. We also talk with Adam about how he approaches building components in JavaScript libraries like Vue in an effort to apply some of that wisdom to ViewComponent.

[00:04:26] Adam tells us all the cool things happening in Tailwind.
[00:08:09] Jason wonders if Tailwind UI is considered early access.
[00:10:52] Jason is…
Awesome Ruby Newsletter 

💎 Issue 229 - React is Dead. Long live Reactive Rails! Long live StimulusReflex and ViewComponent!

Ruby Weekly 

The one with all the Rails stuff (and Ruby 2.7.2)

#522 — October 8, 2020

Read on the Web

👍 Thanks for all of the feedback you gave last week – we're listening to it all. An occasional complaint was that we don't have enough pure Ruby (read: not Rails) stuff and as a Sinatra fan(!) I'm sensitive to this too. This issue is Rails heavy too, but I'm going to look at redressing this balance ASAP and encourage you to send in as much non-Rails Ruby stuff as you can! 😉
–––
Peter Cooper, your humble editor

Ruby Weekly

How's the Performance of Ruby 3.0.0-Preview1? — When compared to 2.7? It’s not a dramatic difference, but try to focus on the 70%+ speed up between 2.1 and…

Noah Gibbs

Ruby 2.7.2…

Ruby Yagi 🐐 

How to access host database from a docker container (Ubuntu)

I was trying to install self-hosted Plausible analytics for this blog, and got stuck as my current server already has a PostgreSQL database installed. I want the Plausible analytics docker container to access the host database instead of spinning up another database container, searched Stack Overflow for answers but none of them seems to work.

This post would be focusing on PostgreSQL database, and assuming you are using docker on Ubuntu, with UFW firewall switched on.

Assuming you already have installed a database server (PostgreSQL) on your host, with the port 5432 listening for connection.

The first step would be to ask PostgreSQL to listen to all address, edit the PostgreSQL config file…

RubyGems Blog 

3.2.0.rc.2 Released

RubyGems 3.2.0.rc.2 includes minor enhancements, bug fixes, performance, major enhancements, minor enhancements, bug fixes and deprecations.

To update to the latest RubyGems you can run:

gem update --system

If you need to upgrade or downgrade please follow the how to upgrade/downgrade RubyGems instructions. To install RubyGems by hand see the Download RubyGems page.

Minor enhancements:

  • Don’t hit the network when installing dependencyless local gemspec. Pull request #3968 by deivid-rodriguez
  • Add --force option to gem sources command. Pull request #3956 by andy-smith-msm
  • Make –dry-run flag consistent across rubygems commands. Pull request #3867 by bronzdoc
  • Disallow downgrades…
Long live Ruby 

Rails value object design pattern

Regardless of the type of architecture do you like the most in Rails, you will find value objects design pattern useful and, which is just as important, easy to maintain, implement and test. The pattern itself doesn't introduce any unneeded level of abstraction and aims to make your code more isolated, easier to understand and less complicated.
Test Double | Our Blog 

5 for 5000: Profits are Good, Actually

This post is the third in a five part series celebrating Test Double’s five-year run on the Inc. 5000 list of fastest growing companies: Widen the Goalposts for Success The Customer is Usually Right Profits are Good, Actually (this post) Do Right by Everyone Find your Leading Indicators Revenue isn’t the whole story (I can’t believe I have to say this, but) profitable companies are better equipped to survive over the long-term than unprofitable companies.
Planet Argon Blog 

Things I Learned as an Intern that I Did Not Learn in Code Bootcamp

Things I Learned as an Intern that I Did Not Learn in Code Bootcamp

As is tradition, two Epicodus interns joined us in August for a short stint as a part of their bootcamp. Here's a reflection from Josey Kinnaman on her experience with us as a developer intern and what she learned.

Continue Reading

Martian Chronicles, Evil Martians’ team blog 

Easy multi-language, multi-version documentation with Docsify, Git, and GitHub Actions

Author: Vladimir Dementyev, Lead Developer at Evil Martians

Last year, I discussed documentation engines and the reasons why Docsify became my number one choice. Since then, more Evil Martians’ OSS projects have adopted the same approach (imgproxy, Clowne), and some of my projects reached new major versions. This post will show how to deal with multiple versions and translations of your docs and present a Docsify plugin for navigating complex documentation.

Writing documentation is an essential part of open source activities. The better the documentation, the easier it is for users to start working with your library or project. But what is the definition of “better”? Let me narrow it…

Riding Rails 

Rails 6.0.3.4 has been released

Hey everyone! Rails version 6.0.3.4 has been released! This version is a security release and addresses one possible XSS attack vector in Actionable Exceptions.

You can read more about the issue here.

Here are the checksums for the gems:

$ shasum *6.0.3.4*
04ec20fe5d23d9e21ed2dd04139563e4173f6c1b  actioncable-6.0.3.4.gem
c96926a293abcb63a9471e9064824160b7348683  actionmailbox-6.0.3.4.gem
e2a0221f78f260b93ac57c1d40f2c0cabe82b1c9  actionmailer-6.0.3.4.gem
83a4fc7ebb7e7b41795149e1d1879e2bce4540f2  actionpack-6.0.3.4.gem
b080d368861b406b2b78ae46f905476d66b8ba4b  actiontext-6.0.3.4.gem
27ecb9befa64104c7b27bc547f4f58de4ba25d9c  actionview-6.0.3.4.gem
5405baf9298cc3af01a5160ebed4ebb79eec0a69 …
Ruby Yagi 🐐 

Getting started with Tailwind CSS on Rails 6

If you haven't heard of Tailwind CSS yet, it is a CSS framework filled with a lot of preset CSS classes, which you can apply to your HTML elements, without the need to write custom CSS for them most of the time!

I have experimented with Tailwind CSS in this demo job Rails app : https://kldev.herokuapp.com , you can view source on the page see that each elements used a lot of CSS classes.

For example this div :

<div class="w-full bg-blue-900">
</div>

The w-full class :

.w-full {
  width: 100%;
}

The bg-blue-900 class :

.bg-blue-900 {
  background-color: #2a4365;
}

The w-full and bg-blue-900 classes are provided by Tailwind CSS, we can just insert these into the class name to style the element,…

Hi, we're Arkency 

Multitenancy with Postgres schemas: key concepts explained

Multitenancy with Postgres schemas: key concepts explained

PostgreSQL schemas let you hold multiple instances of the same set of tables inside a single database. They’re essentially namespaces for tables. Sounds like a compelling way to implement multitenancy — at least in specific cases. But if you’re like me, you’d rather know exactly how it works before you rush to implement it. Let’s explain some basic concepts first: schema itself, search_path and session.

PostgreSQL schema

As I said before schema is basically a collection of tables (and other db “objects”). Schema is not the most fortunate name for it, as it can be confused with db schema in the sense of db structure. Namespace would…

The Rails Tech Debt Blog 

How’s the Performance of Ruby 3.0.0-preview1?

The new Ruby 3.0 preview is out! Woo-hoo!

If you've heard of me, you know performance is kinda my thing, especially Rails performance on large apps. I do other stuff too, but I got paid to do that for years (thanks, AppFolio!), so I've written a lot about it.

How does the new preview's performance stack up on Rails? And how reliable are these numbers?

Pitfalls

First off, not every gem is ready for Ruby 3. For instance, the latest version of ruby_dep (1.5.0) has a "~>2.2" dependency on Ruby. I'm not trying to pick on it! Tilde-dependencies are usually a really good idea! And now a bunch of them are going to need to change.

I'm also using ancient code for this benchmark, frankly. I…

Ruby on Rails Podcast 

339: kuby & Rails Deployments with Cameron Dutro

Cameron Dutro believes we need Active Deployment like we have Active Record and Active Storage. That's what kuby is - an easy way to deploy your Ruby on Rails application without getting your dev-ops black belt first.

Links for this episode:

Brought to you by:

Scout APM

Give Scout a try…

Code with Jason 

How I make sure I really understand a feature before building it

The very real danger of misinterpreting a feature requirement

When I was a young and inexperienced developer I often failed to build a feature the right way the first time.

My memory is that, often, I would show what I built to my stakeholder (stakeholder meaning boss or freelance client) and the stakeholder would say that what I built didn’t really resemble what we had talked about.

I would then go away, embarrassed and surprised, and make another attempt. Sometimes this process would be repeated multiple times before we finally got on the same page. It sucked. It was obviously a bad experience for both myself and my stakeholder. Yet, unfortunately, this was the way things normally went.

T…

Greater Than Code 

203: Algorithmic Auditing and Accountability with Matthew Zhou

01:54 - Matt’s Superpower: Letting Things Go Easily

  • Nonattachment and Immigration

08:35 - Matt’s Journey From Anthropology to Tech

  • The Intersection of Technology and Social Science

13:42 - Algorithmic Auditing and Accountability

29:38 - Data Surveillance: Gathering Enough Data vs Gathering Too Much Data (and particularly the effect on Black and Brown people)

Rémi Mercier 

Scoped Active Record Associations

Active Record Associations are a great feature of Rails. Associations allow you to declare - well - associations between your models. AR Associations also allow you to write operations when several models are linked (e.g., Author.first.books.create(title: 'I love Rails!')).

But I had never thought of using them as scopes until last week! So let me show you a neat little trick that’ll make your code much much more expressive (and keep your N+1 queries in check).

Defining basic associations

I won’t dig into the basics of Active Record Associations. If you don’t know your way around them, go and read the doc first.

Let’s define a couple of models with their associations.

  class Author < 
OmbuLabs Blog 

How to Open Source a Private Project

Open Source is one of the things that we value as a company. Our philosophy is that “everything we do should be open by default”. This is why in the past few months we decided to open source two of our internal projects. We built Dash and Points to make our daily processes smoother, and then we thought “hey, why not share them with everyone?”. Now we also want to share the process of how we turned them from private to open source.

Making a list

Before we began the process of open sourcing we decided to make a list. We thought about what it would take to move the projects into the eyes of the public. We thought about what we wanted the app to look like, if there were any “secrets” in the…

Honeybadger Developer Blog 

Test-Commit-Revert: A Useful Workflow for Testing Legacy Code in Ruby

It happens to all of us. As software projects grow, parts of the codebase end up in production without a comprehensive test suite. When you take another look at the same area of code after a few months, it may be difficult to understand; even worse, there might be a bug, and we don't know where to begin fixing it.

Modifying code without tests is a major challenge. We can't be sure if we'll break anything in the process, and checking everything manually is, at best, prone to mistakes; usually, it's impossible.

Dealing with this kind of code is one of the most common tasks we perform as developers, and many techniques have focused on this issue over the years, such as characterization tests

Rails with Jason 

065 - [How I'd Build It] Poker Turn Enforcement with Tyler Williams, Software Engineer at Home Game Poker

In this How I'd Build It episode I talk with Tyler Williams about an interesting challenge in an online poker program. Tyler and I discuss what would need to happen in order to ensure that a player only gets a specific amount of time on his or her turn without the player being able to cheat the system. We talk not only about the technical implementation but also the costs of preventing cheating relative to the likelihood that someone would have the willingness and ability to cheat.

All Ruby Podcasts by Devchat.tv 

RR 473: GraphQL Doesn't Need To Be Hell with Dmitry Tsepelev

Different doesn’t need to be worse. Dmitry Tsepelev tells us how to make the most of using GraphQL with Rails, the advantages over REST-based API queries and best practices for security and schemas.

Sponsors

Panel

  • Dave Kimura
  • John Epperson
  • Charles Max Wood
  • Luke Stutters

Guest

  • Dmitry Tsepelev

Links

Picks

Luke Stutters:

Kir Shatrov 

bpftrace, uprobe and containers

Couple days ago at work I found myself needing to trace BPF’s uprobes while investigating an issue with libzookeeper.

Normally, running a uprobe / uretprobe is as easy as passing the path to the library and the function name:

$ bpftrace -e 'uretprobe:/usr/lib/x86_64-linux-gnu/libzookeeper_mt.so.2.0.0:zoo_set2 { printf("%d\n", retval); }'

In my case, Zookeeper client was running in a container. How do I figure out the path to the library if the process is in Docker?

Turns out it’s not too hard, but I tend to forget things, so I decided to write this post for myself in the future in case I need to do this again.


First, let’s get container’s ID:

$ docker ps | grep…
Rails Performance Audit and Tuning Consultant for Hire 

Why You Should Migrate your Heroku Postgres Database to AWS RDS

Heroku PostgreSQL addon is excellent for a quick start setup of a new project. Once your web app matures, then migrating to an alternative database engine like Amazon RDS should be considered.

In this blog post, I’ll describe the benefits and drawbacks of using AWS RDS instead of the default Heroku addon. I’ll also compare the pricing and explain why projects that care about EU GDRP compliance should avoid using the Heroku database.

I write this blog post in the context of the default Heroku public spaces. Private spaces are an enterprise feature, and the pricing starts from $1000/month.

Heroku PostgreSQL addon and GDPR

Disclaimer: I am not a lawyer, and this article does not constitute…

Alfredo Motta 

Not So Random Software #38 – Is Technical debt just bullshit? And How to play the Piano

Hello everyone and welcome back to Not So Random Software! This week I have enjoyed reading this article commenting on technical debt and why today …
Long live Ruby 

Rails 6 and Stimulus.js - a quick launch

Stimulus.js is a JavaScript framework created by the founders of Basecamp. It's easy to integrate but powerful and allows us to manipulate the HTML we already have in our application. It's a perfect addition to your Rails application if you don't want to use React or Vue but still make your app to be interactive. In this article, we are going to create a simple Rails application for adding pets to the database and add the framework along with some example code but you can easily repeat all steps mentioned here to add the framework to your existing application.
The Bike Shed 

263: Keeping The Night Brain At Bay (Dave Rupert)

Steph's taking a quick break this week, but in her absence, Chris is joined by Dave Rupert. Dave is the lead developer at Paravel, co-host of the Shop Talk Show podcast, creator of The Accessibility Project, and an all-around prolific and thoughtful maker of digital things.

Chris and Dave chat about creating and sharing content like podcasts and blogs and how to get past your inner editor. They discuss the web platform and accessibility, and finally, they round out the conversation with a chat about design systems as an intersection between design and development.


This episode is brought to you by:

  • Indeed - Click through and get started with a free seventy five dollar credit…
Engine Yard Blog 

Docker Vs Kubernetes Explained for 2020 - Engine Yard

If you’re aiming for a microservices-based architecture, you might have heard about Docker and Kubernetes. Docker and Kubernetes are tools you use in the lifecycle of a containerized application.

Drifting Ruby Screencasts 

Benchmark Ruby Code

It's easy to accidentally write slow code in our applications. In this episode, we look at how we can benchmark our code and examples of some methods which are slower than others.
avdi.codes 

Why and how to use Ruby’s Hash#fetch for default values

Here’s another classic from the early days of RubyTapas. Originally published as Episode #11 in October 2012, it’s a complement to the episode on using fetch as an assertion. This episode digs into the difference between using the || operator for defaults vs. using Hash#fetch.

Director’s commentary: I can see some tiny advancements in quality here. At this point I’d realized that my original comment color was nearly unreadable on the dark background, and brightened it up a bit.

But my voiceover still sounds kind of bored. And was still content to have long sections of silence while I put new code on the screen. These days, I try to always accompany coding with simultaneous…

Prathamesh Sonpatki 

Puma installation issue due to missing ctype.h on Mac OS X

puma_http11.c:203:22: note: include the header <ctype.h> or explicitly provide a declaration for 'isspace'

Are you facing this error recently while trying to install puma gem 4.3.5 on Mac OS X?

This issue is reported on Puma issue tracker here and fixed in version 4.3.6 and in the latest 5.0.0 release.

But if you want to fix it without updating the Puma gem version from 4.3.5, you can use run following command to update your Bundler configuration.

bundle config build.puma --with-cflags="-Wno-error=implicit-function-declaration"

bundle install will run successfully after this.

Even better is to just update Puma to latest version which also fixes this issue.

Riding Rails 

Destroying associations asynchronously, interval datatype and more

Hi, Wojtek from this side. We are coming back with newsletter! Here are the changes in Ruby on Rails codebase from the last week.

Destroy associations via background job

Destroying associated records can now be done in background job by setting dependent: :destroy_async option.

Support for PostgreSQL interval datatype

Add support for PostgreSQL interval data type with conversion to ActiveSupport::Duration when loading records from database and serialization to ISO 8601 formatted duration string on save.

Per environment Active Storage config files

Active Storage configuration files for specific environment like config/storage/production.yml will take precedence over config/storage.yml.

Ruby News 

Ruby 2.7.2 Released

Ruby 2.7.2 has been released.

This release contains intentional incompatibility. Deprecation warnings are off by default on 2.7.2 and later. You can turn on deprecation warnings by specifying the -w or -W:deprecated option at the command-line. Please check the topics below for details.

This release contains the new version of webrick with a security fix described in the article.

See the commit logs for other changes.

Download

Remote Ruby 

Managing Technical Debt, Vue 3, and Adding Linters to Legacy Code Bases

[00:01:49] Chris tells us he had somebody using Jumpstart that couldn’t get into his app, so he explains how he solved the problem. He also talks about how he used yarn link.
[00:10:10] Chris talks about how he was trying to improve administrates navigation, which is actually based off your routes. 
[00:15:38] The guys chat about how the official version of Vue 3.0.0 was released! 
[00:18:14] Jason’s been busy writing SQL at work doing campaign emails and what’s been going on with that. Chris asks Jason if he’s been adding new features to it or just cleaning things up and improving it. 
[00:23:20] Jason tells us he’s still working on his site editor at work, but it’s his bug rotation…
RubyMine: The Ruby on Rails IDE – RubyMine Blog | JetBrains 

RubyMine 2020.3 EAP2: Support for Pry Console, Changes to Default Code Style Settings, and More

RubyMine 2020.3 EAP2 is now available! Here are the main highlights of this build:

Pry console support

One of the most voted features is here! You can now use Pry instead of IRB in RubyMine.

To do so, make sure that you have the pry gem installed in your project. Then, go to Tools | Run Pry to launch the console.

Run Pry

Default code style settings now match RuboCop

RuboCop bases its checks (cops) on the community Ruby style guide. Previously, some of RubyMine’s default style settings didn’t match the rubocop gem, which could have caused conflicting style warnings.

We’ve updated several of RubyMine’s…

Valentino Gagliardi - RSS Feed 

Deploying Django > 3.1 (async) with Uvicorn and Nginx

Deploying Django async with Uvicorn and Nginx

Django async

Django 3.1 shipped with async views. This means we can start using async/await in Django views:

async def index(request):
    res = await do_stuff_async()
    # return your view

To reap all the benefits of this feature, you have to run Django under an ASGI server like Daphne, Uvicorn, or Hypercorn. In this guide I use Uvicorn.

The setup

The stack uses battle-tested components:

  • PostgreSQL
  • Nginx
  • Uvicorn with Gunicorn

Install and configure Postgres

First off, head over PostgreSQL Downloads and…

Awesome Ruby Newsletter 

💎 Issue 228 - Building a Ractor based logger that will work with non-Ractor compatible code

ruby – Bibliographic Wilderness 

faster_s3_url: Optimized S3 url generation in ruby

Subsequent to my previous investigation about S3 URL generation performance, I ended up writing a gem with optimized implementations of S3 URL generation.

github: faster_s3_url

It has no dependencies (not even aws-sdk). It can speed up both public and presigned URL generation by around an order of magnitude. In benchmarks on my 2015 MacBook compared to aws-sdk-s3: public URLs from 180 in 10ms to 2200 in 10ms; presigned URLs from 10 in 10ms to 300 in 10ms (!!).

While if you are only generating a couple S3 URLs at a time you probably wouldn’t notice aws-sdk-ruby’s poor performance, if you are generating even just hundreds at a time, and especially for presigned URLs, it can…

Ruby Weekly 

The first preview release of Ruby 3.0 is here

#521 — October 1, 2020

Read on the Web

Ruby Weekly

Ruby 3.0.0 Preview 1 Released — Fingers crossed for a final Ruby 3.0 release this Christmas, but in the meantime we have the first preview release to play with! So if you’ve wanted to get playing with Ractor, the RBS type profiling approach, or even cute syntactical features like rightward assignments, now is a great to try it out as tools like RVM and rbenv make it really easy to get going.

Yui Naruse

A Ruby One-Liners Cookbook — Ruby is a fantastic language for one-liners, whether in IRB or even from the command line, and two years ago we featured this…

Engine Yard Blog 

What is Platform as a Service (PaaS) - Definition, Pros &amp; Cons

If you’re developing a web application, you might have heard of the three primary models of cloud computing: IaaS, PaaS, and SaaS. IaaS gets you an infrastructure, PaaS provides a development environment to go with it, and SaaS is cloud applications for end users.

Engine Yard Blog 

What is Platform as a Service (PaaS) - Definition, Pros & Cons

If you’re developing a web application, you might have heard of the three primary models of cloud computing: IaaS, PaaS, and SaaS. IaaS gets you an infrastructure, PaaS provides a development environment to go with it, and SaaS is cloud applications for end users.

Hi, we're Arkency 

What surprised us in Postgres-schema multitenancy

What surprised us in Postgres-schema multitenancy

You can implement multitenancy in various ways. In one of our projects we went for schema-based multitenancy, where each tenant has its own PostgreSQL schema - i.e. its own namespaced set of tables. This approach has many pros and cons, but we found it viable in certain situations. Apartment is a popular gem assisting with that (currently not actively maintained though).

I like this particular feature of Postgres, but one has to admit it introduces a little bit of complexity - after all it’s not a conventional feature everyone uses.

The thing is that complexity compounds. One unconventional feature is not a big deal, but if there’s more…

Long live Ruby 

Rails procedure design pattern

Have you ever came across a code that verifies a lot of conditions to allow for some action? In normal life, we would name such process as a procedure. Programming is no different. Let's have a quick look at the procedure definition: The definition of procedure is order of the steps to be taken to make something happen, or how something is done. An example of a procedure is cracking eggs into a bowl and beating them before scrambling them in a pan Knowing the definition, we can consider a simple example of a procedure in a typical Ruby on Rails application
Test Double | Our Blog 

5 for 5000: The Customer is Usually Right

This post is the second in a five part series celebrating Test Double’s five-year run on the Inc. 5000 list of fastest growing companies: Widen the Goalposts for Success The Customer is Usually Right (this post) Profits are Good, Actually Do Right by Everyone Find your Leading Indicators Give the people what they say they want Let’s talk about designing your products and services, establishing product-market fit, and iterating in response to your company’s successes and failures.
Honeybadger Developer Blog 

Currency Calculations in Ruby

Money, regardless of the currency it is in, seems like a floating-point number. But it's a mistake to use floats for currency.

Float numbers (hence, float objects) are, by definition, inexact real numbers that make use of the double-precision floating-point representation characteristic of the native architecture. Inexact numbers make accountants unhappy.

In this article, you’ll be guided through some quick examples that will help you to address the available options for dealing with money data in Ruby and Rails.

What's a Float?

As we said, float objects have different arithmetic. This is the main reason they are inexact numbers, especially because Ruby (like most languages) uses a…

OmbuLabs Blog 

Using Tettra to Keep our Content Organized

At OmbuLabs we use Tettra to power our knowledge base. As a remote, distributed team it is very important to us to have our content structured and organized. We follow some good practices to keep it organized and up to date, which we describe here, and we use Tettra to keep our knowledge organized and integrated with the tools we use on a daily basis.

Getting Started

To make sure every team member knows how to navigate and use Tettra, we have a Using Tettra category. Under this category, we have created content to help team members get started with the tool, the integrations available and to get familiar with the structure of the knowledge base and how to navigate it.

Here we have a…

Saeloun Blog 

Rails deprecates `db:structure:load` and `db:structure:dump` tasks

Rails has deprecated db:structure:load and db:structure:dump tasks.

Before

config.active_record.schema_format controls the format for dumping the database schema to a file. :ruby(default) and :sql are the valid options for this config.

Running rails db:schema:{dump,load} will dump or load db/schema.rb file and rails db:structure:{dump,load} will dump or load db/structure.sql file, regardless of value specified for config.active_record.schema_format.

After

Both the commands, rails db:schema:{dump,load} and rails db:structure:{dump,load} will run rails db:schema:{dump,load} depending on the value specified for config.active_record.schema_format.

So running, rails db:schema:dump or rails…

Ruby on Rails Podcast 

337: Chipping Away at a Monolith with Tori Huang

Tori Huang, software engineer at Gusto, and her team recently embarked on a journey toward unbundling part of Gusto’s monolithic Ruby on Rails app. She and Brittany discuss knowing when to uncouple a service and how to identify orphan code.

Links for this episode: