Rubyland

news, opinion, tutorials, about ruby, aggregated
Sources About
With a Twist 

Rails Monolith towards Engines spike - Our story

This year my team started working on a new UI for our patient check-in application, with slightly modified rules for specific use cases and forms. It would reuse most of our backend software with few changes. We named it Bariloche.

Bariloche is a new UI for our patient check-in workflows, targeted for Urgent Care facilities. Given that the UI would start from scratch, we’d use it as a testbed to build our frontend entirely with React Components. Everything would be namespaced under the “Bariloche” name.

Such a clear boundary between the monolith and this product made it an ideal case to try an Engine implementation. Given Bariloche would share the data layer declared by the main app and…

Ruby News 

Ruby 3.0.0 Preview 1 Released

We are pleased to announce the release of Ruby 3.0.0-preview1.

It introduces a number of new features and performance improvements.

RBS

RBS is a language to describe the types of Ruby programs. Type checkers including type-profiler and other tools supporting RBS will understand Ruby programs much better with RBS definitions.

You can write down the definition of classes and modules: methods defined in the class, instance variables and their types, and inheritance/mix-in relations. The goal of RBS is to support commonly seen patterns in Ruby programs and it allows writing advanced types including union types, method overloading, and generics. It also supports duck typing with interface…

Alfredo Motta 

Not So Random Software #36 – Explaining Humans

Hello everyone and welcome back to Not So Random Software! After a long summer break, I am back with the usual short collection of weekly …
Awesome Ruby Newsletter 

💎 Issue 227 - We Made Puma Faster With Sleep Sort

Test Double | Our Blog 

5 for 5000: Widen the Goalposts for Success

We got some surprising news this summer: Test Double made the Inc. 5000 list of fastest-growing companies in America, coming in at #2,109. More surprising: somehow, this is the 5th year in a row we’ve made the list.
Planet Argon Blog 

Top 10 Technical Podcasts (as Chosen by the Rails Community)

Top 10 Technical Podcasts (as Chosen by the Rails Community)

In the spring of 2020, we surveyed over 2,000 Ruby on Rails developers from 92 different countries. One of the questions that we asked the community about was, "What are some technical podcasts that you enjoy listening to?"

Here are the top ten!

Continue Reading

Ruby Weekly 

The one where a Silicon Valley character promotes a Ruby library

#520 — September 24, 2020

Read on the Web

Ruby Weekly

▶  Triage with Me: 11 Issues and 2 PRs in 1.5 Hours — The creator of CodeTriage takes us behind the curtain to see how he triages and works with issues on open source projects. Well worth watching if you’re curious how to productively work on open source projects or are just curious how another experienced developer does so.

Richard Schneeman

Under Deconstruction: The State of Shopify’s Monolith — This is a long post about the status of Shopify’s move to modularity with some wonderful lessons learned and insights on how they got here and where they…

Shopify…

Valentino Gagliardi - RSS Feed 

Generating the code challenge for PKCE in OAuth 2

What is the code challenge

For authenticating single-page applications against an OAuth 2 server, the current RFC recommends an authentication code grant with PKCE (Proof Key for Code Exchange). Here's how it works.

When the user initiates an authentication flow, the client should compute a code_verifier. This must be a random, high entropy string between 43 and 128 characters.

Next up, the client computes a code_challenge starting from the code_verifier. This is the result of the following pseudo-code:

code_challenge = base64urlEncode(SHA256(ASCII(code_verifier)))

See also rfc7636, section 4.

The code_challenge must be sent in the first step of the authorization flow.

The code_verifier

Ruby in Source Diving on Medium 

Keeping it 100

We’ve written in the past about how we encourage pull requests with less than 100 additions. In this blog, we take a closer look at where the guideline comes from and how it works in practice.

Origins

It’s worth noting that managing the line count in a pull request itself is not the goal, but more of a means to an end.

We are mainly concerned with the number of concepts.

While a pull request should have enough context to be understandable, we have found that limiting the overall number of concepts has several benefits:

Reduced risk of getting blocked

The more things going on in a pull request, the greater the likelihood of getting blocked.

For example, a pull request containing a refactoring, a…

avdi.codes 

SIGAVDI #88: Endless Beans Edition

Hello friends,

It smells like autumn. This will likely be an autumn without apple-cidering and hayrides, which makes me sad.

I’m still on a dead-tree kick, so more book quotes this week…


In the wake of human history thus far, devastation and destruction point to a misconception about the “way of things” or, as some might say the “order of life”. What are the errors are, they are brutal to our inner worlds in the larger ecology of which we are a part.

Nora Bateson

If I were to compose a keynote right now it would be about values that have turned out to be anti-values, or at least woefully inadequate. Including, but not limited…

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

RubyMine 2020.3 EAP Is Open!

RubyMine 2020.3 EAP Is Open

The RubyMine 2020.3 Early Access Program (EAP) is open!

You can get EAP builds from our website, use the Toolbox App, or update to them using snaps if you’re an Ubuntu user. Note that the EAP builds are free to use but expire within 30 days of the build date.

As usual, we encourage you to participate in the EAP and share your thoughts on the latest improvements and the new functionality so that we can continue to make RubyMine better for you.

Here are the main highlights:

New Welcome screen

The first new thing you’ll see in RubyMine 2020.3 is the redesigned welcome screen:

New Welcome screen

One of the main changes is that you can now arrange your…

Valentino Gagliardi - RSS Feed 

Understanding OAuth 2 with PKCE in Single-Page Applications (2020)

OAuth 2.0 in Single-Page Applications for Mere Mortals

Token-based authentication on the web is one of those things you know exists, but sometimes you're too scared to implement in your projects.

Authentication for SPA (single page applications) is even more scary, but willing or not you should know a bit of theory to work proficiently with any SDK when the time comes.

In this post I hope to clarify for you the current recommended OAuth 2 flow for single-page applications: authorization code grant with PKCE.

ruby – Bibliographic Wilderness 

Delete all S3 key versions with ruby AWS SDK v3

If your S3 bucket is versioned, then deleting an object from s3 will leave a previous version there, as a sort of undo history. You may have a “noncurrent expiration lifecycle policy” set which will delete the old versions after so many days, but within that window, they are there.

What if you were deleting something that accidentally included some kind of sensitive or confidential information, and you really want it gone?

To make matters worse, if your bucket is public, the version is public too, and can be requested by an unauthenticated user that has the URL including a versionID, with a URL that looks something like: https://mybucket.s3.amazonaws.com/path/to/someting.pdf?vers…

Ruby Magic by AppSignal 

Monitoring Any System with StatsD and AppSignal's Standalone Agent

Application monitoring alone is not always enough to get the full picture of your systems. Frequently, services running in satellite apps (or supporting apps) can have an acute impact on your day-to-day operations. Database servers are well-known examples of this. Backup scripts and other background jobs can also slow systems and are often overlooked.

AppSignal does not watch these satellite processes by default. To extend monitoring everywhere and have all your data in a single app, you can install AppSignal’s standalone agent.

AppSignal’s Standalone Agent

The standalone agent is based on the same software with which we usually instrument Ruby, Elixir, or JavaScript applications. This…

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:

Saeloun Blog 

Rails allows a module with extend ActiveSupport::Concern to be prepended

Rails has added support for prepending concerns.

Prepending

If we prepend a module to a class, the module will be inserted at the bottom of the inheritance chain even before the class itself.

Prepending instance methods in Ruby

module Population
  def preferred_transport
    "by walk"
  end
end

class Human
  prepend Population

  def preferred_transport
    "by air"
  end
end

Human.new.preferred_transport #=> by walk

In the above example, module Population is prepended to the class Human.

Hence the method preferred_transport of the module Population got precedence over the preferred_transport instance method of the class Human in the lookup chain.

We can verify this by…

Greater Than Code 

201: Real Rebels Pay Their Taxes with Nils Norman Haukås

02:58 - Nils’ Superpower: Storytelling

  • Practicing Presentation
  • Company/Employer-Sponsored Skill Training (such as storytelling/public speaking)
  • Taking Courses Unrelated to Your Own Skillset

09:39 - Deleting Code

  • Tension Around Deleting or Refactoring Others’ Code
  • Etiquette Around ^
  • Sharing Codebases

20:17 - Is it ethical to invest time in learning and using technologies from companies that pay little or no taxes?

29:14 - What Can We Do About the Centralization of Power in Large Corporations?

  • Wanting an…
Josh Software 

Departure.rb

Databases are usually the lifeblood of applications and of dynamic web sites.They manage the information that applications depend on, and a large portion ofapplication development revolves around the care and feeding of the data thatgoes into a database or comes out of the database, as well as the structure ofthe database. When building applications with … Continue reading Departure.rb
Planet Argon Blog 

18 Years of Planet Argon

18 Years of Planet Argon

Planet Argon turned 18 years old last month!

Continue Reading

Schneems - Programming Practices, Performance, and Pedantry 

Triage with Me - 11 issues & 2 PRs in 1.5 hours

Contributing to open-source can be intimidating, especially when you’re getting started. In this post and video series, join me as I triage 11 issues on a repo that I didn’t create and don’t have much experience with.

Rails with Jason 

063 - Turning Around Legacy Projects with Robby Russell, CEO of Planet Argon

In this episode I talk with Robby Russell, CEO of Planet Argon, about improving legacy codebases. Robby and I discuss the "we'll fix it later" fallacy, whether to sacrifice quality for speed, the value of having a test suite, and Robby's and Jason's bands.

All Ruby Podcasts by Devchat.tv 

RR 471: Sorbet with Ufuk Kayserilioglu

In this episode of Ruby Rogues, we talk with Ufuk about how Shopify made the transition to using Sorbet and about the benefits they felt they received from implementing it. Ufuk also reveals a little bit about how Shopify transitioned to fully remote and about how that will be the default moving forward.

Sponsors

Panel

  • Dave Kimura
  • John Epperson
  • Luke Stutters

Guest

  • Ufuk Kayserilioglu

Picks

 

 

Luke Stutters:

 

 

 

 

John Epperson:

 

 

  • Walmart Grocery Pickup

 

 

Dave Kimura::

 

 

 

 

Ufuk Kayserilioglu:

 

 

The Official BigBinary Blog | BigBinary 

Rails 6.1 deprecates rails db:structure:dump and rails db:structure:load

This blog is part of our Rails 6.1 series.

Rails 6.1 deprecates rails db:structure:load and rails db:structure:dump tasks.

Before Rails 6.1, executing rake db:schema:dump would dump db/schema.rb file. And executing rake db:structure:dump would dump db/structure.sql file.

Rails provides config.active_record.schema_format setting for which the valid values are :ruby or :sql. However, since there are specific tasks for db:structure and db:schema this value was not really being used.

Changes in Rails 6.1

In Rails 6.1 the Rails team decided to combine the two different tasks into a single task. In Rails 6.1 rails db:structure:dump and rails db:structure:load have been deprecated and…

Using `bin/rai…
The Bike Shed 

261: A Jenga Tower of Lets and Context

On this week's episode, Steph and Chris tackle a listener question around composition over inheritance, especially in the context of Rails which makes regular use of inheritance. Dependency injection, OOP vs FP, frameworks vs app code -- they hit it all!

They also chat about burnout and how they've dealt with it, using jq to investigate differences between json responses, refactoring tests and using let, and Steph shares her recent learnings about graphviz.


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
  • ExpressVPN - Click through to get get an extra three months…

Ruby Together News 

August 2020 Monthly Update

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

ruby together news

In August, Ruby Together was supported by 43 different companies, including Sapphire member Stripe and Ruby member Zendesk. 2 companies joined for the first time this month.

In addition to those companies, 2 new developers signed up as members, including Efstathios Stivaros. In total, we were supported by 101 developer members. Thanks to all of our members for making everything that we do possible. <3

rubygems news

This month we made improvements to our man page generation process to ease contribution to the Bundler documentation, and…

Karol Galanciak - Distributed Systems Architect and Ruby on Rails expert 

Tracking All Paper Trail Version From A Single Request With Correlation UUIDs

If you’ve ever had a need to implement an audit log to track all the changes that get persisted for all or at least some models in your application, there is a good chance that you’ve encountered PaperTrail gem that makes it trivial to track all the changes - it might be as easy as adding has_paper_trail to the desired models.

However, storing versions is just one thing. The other one is using them later, which sometimes might be far from obvious. For example, you see that some record was updated, but you don’t exactly know why. Maybe you have whodunnit stored, but it still doesn’t give you the entire picture as there might be multiple ways how a given record can be updated and you are…

The Ruby Blend 

Goodbye, for now

A short episode where Andrew Mason reveals that the show has come to an end. Thank you for all your support!

Show LinksTransistor.fm is now hosting an archive of the podcast for us. Learn how to start your own podcast!
Planet Argon Blog 

Don't Wait Until You're Ready. Start.

Don't Wait Until You're Ready. Start.

Keeping up with tradition, we brought on two interns from Epicodus five weeks ago. This time, the experience was unique in that there was a new challenge of coordinating an internship while the entire team was working remotely. Here's a reflection from Dan Merys on his time with us as a developer intern.

Continue Reading

avdi.codes 

The ultimate software taboo

I have written before about the hidden dangers of unstructured or “flat” organizations. A microcosm of the structure wars is the debate over whether Open Source software projects should adopt explicit codes of conduct. These codes, if not an introduction of true structure, are at least the imposition of a “social API” of sorts.

One objection I’ve seen raised to codes of conduct is that we shouldn’t discriminate against people who write good code but who happen to be assholes. After all, as the argument goes, not everyone is blessed with social graces. And if we exclude those people, we will miss out on their essential technical contributions.

With regard to this argument, a study…

OmbuLabs Blog 

Organizing and Maintaining a Team Knowledge Base

As a distributed, remote team we use different tools to communicate at OmbuLabs, like Slack and Zoom. Those are great for live communication. But every company has information that needs to be kept and stored somewhere. In our case, we started off using the GitHub Wiki and Google Docs. However, documentation and policies need to be maintained, updated and checked regularly. And having information scattered in different tools, formats and accounts became a hassle.

That's where a knowledge base comes in. At OmbuLabs we use Tettra and we will share our experience in a different article. But regardless of what tool you choose, here are some practices that will help you keep your knowledge base…

avdi.codes 

Alternative Ruby Symbol Literals

Periodically I take episodes from the RubyTapas archives and publish them for free. This episode from October 2012 is about symbol literals, and how you can use alternative quoting syntax to embed and interpolate any kind of character sequence in a symbol. And also: why you might not want to take advantage of this. Enjoy!

Video Script

As you know, a Symbol literal is a word with a colon in front of it.
:foo
You may also know that symbols aren’t limited to simple words; anything that can go in a String, can go in a symbol. But how do we get arbitrary characters, like spaces and dashes, into a symbol? One way is to start with a string and use #to_sym to convert it to a…
Remote Ruby 

Right-ward assignments in Ruby 3? View Components for Primer, and Andrew dabbles with RubyMine

[00:07:05] Jason tells us all the cool features Laravel 8 is going to have.
[00:14:08] We hear of glimpse of what the new version of Spark will have which sounds pretty cool. 
[00:17:33] Paddle is talked about and what is does and more people seem to be using it nowadays.  
[00:19:22] Chris mentions to Jason if he saw that Ruby has an experimental support for Rightward assignments and he explains what it does. Andrew says there’s some computer science mathematical thing that addresses this (link in show notes).    
[00:25:14] Andrew tells us that GitHub is taking their primer design system and they are reimplementing their react library with View Component. 
[00:29:04] Andrew has been…
RubyGems Blog 

August 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 and RubyGems.org in August.

RubyGems News

This Month, we made improvements to the man page generation process to ease contribution to the Bundler documentation. We also and reviewed and merged some PRs from various contributors. We’re thankful for our supportive community. <3

We coordinated with the Ruby core team about versioning default gems in (#3937 and #3938), as well as fixing an issue with configuration priority.

We also deprecated bundle cache --all in favor of explicitly…

Everyday Rails 

Thoughts on Everyday Rails 2020 redesign

Everyday Rails gets a fresh coat of paint after five years. Here's what went into the new look.
Awesome Ruby Newsletter 

💎 Issue 226 - dry-system - why? | from manual dependency injection to a full-blown architecture

Speedshop - Ruby on Rails performance consulting 

We Made Puma Faster With Sleep Sort

Puma 5 (codename Spoony Bard1(When Puma gets a new ‘supercontributor’ that submits lots of important work to the project, we let them name the next release. This release features a lot of code from Will Jordan, who named this release ‘Spoony Bard’. Will said: ‘Final Fantasy IV is especially nostalgic for me, the first big open-source project I ever worked on was a fan re-translation of the game back in the late 90s.’)1 When Puma gets a new ‘supercontributor’ that submits lots of important work to the project, we let them name the next release. This release features a lot of code from Will Jordan, who named this release ‘Spoony Bard’. Will said: ‘Final Fantasy IV is especially nostalgic for…

Experimental Performance Features For Cluster Mode on MRI

This is probably the headline of the…

Ruby Yagi 🐐 

Automate Rails server provisioning and deployment using Ansible and Capistrano

One of the hardest thing while learning Rails is to put your Rails application online on the internet so the public can access it. Many tutorials usually recommends Heroku as it is really simple to use, but the downside is that it can get expensive pretty fast, and their free plan has limitation that cold starts your dyno on inactivity and 10k rows limit for database (to force you to buy their paid plan, they need to pay server bills too).

Rails deployment can be hard if you have no prior sysadmin / devops experience, as you are setting up a server from scratch, and bound to came across issue like sudo permission, where to place files, what file to edit, cryptic error messages etc.

Chris…

Ruby Weekly 

The talks from RubyKaigi 2020, and a new Ruby debugger option

#519 — September 17, 2020

Read on the Web

Ruby Weekly

The Life-Changing Magic of Tidying Ruby Object Allocations — A transcription of Richard’s talk at EuRuKo last year that uses a Marie Kondo “Does it bring you joy?” look at allocations and how to remove the joyless offenders. In addition, Richard says: “Follow along as I trace some memory allocation hotspots and clean them up in the Rails codebase,” which sounds good to me.

Richard Schneeman

RubyJard: Just Another Ruby Debugger — It’s early days for this new Byebug and Pry powered debugging system but it already looks pretty cool. Here’s a view of it…

Minh Nguyen

We’…

Valentino Gagliardi - RSS Feed 

Working with FormData in JavaScript

Working with FormData in JavaScript

Use case: how can I grab all the fields of an HTML form at once with JavaScript?

Consider a simple HTML form for saving tasks in a to-do list:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>HTML forms and JavaScript FormData</title>
</head>
<body>
<form>
    <label for="name">Name</label>
    <input type="text" id="name" name="name" required>

    <label for="description">Short description</label>
    <input type="text" id="description" name="description" required>

    <label for="task">Task</label>
    <textarea id="task" name="task" required></textarea>

    <button type="submit">Submit</button>
</form>
</body>
<script src="form.js">

In this form we have:

  • a text input for the name
  • a text input for the description
  • a textarea for the task
  • a submit button

Each field has the appropriate type, id and name attributes, plus the related label. How can we grab all the data from this form once the user clicks the submit button?

There are two ways: one is like a dirty hack, the other is cleaner, and most important idiomatic.

To…

Saeloun Blog 

Rails adds support for adding a default value to the rich text area

Rails has added support for adding a default value to the rich text area.

To specify the default value for a rich text area, we need to pass the value in the form field, as shown below:

<%= form.rich_text_area :description, value: "Default description" %>

value also accepts HTML, as shown below:

<%= form.rich_text_area :description, value: "<div>First point</div><div>Second point</div>" %>

Technical aspect of this change:

Before

When we pass value to the rich text area, it was not set to the hidden input.

This hidden input is used by <trix-editor>.

In our case,

<%= form.rich_text_area :description, value: "<div>First point</div><div>Second point</div>"…

Schneems - Programming Practices, Performance, and Pedantry 

The Life-Changing Magic of Tidying Ruby Object Allocations

Your app is slow. It does not spark joy. This post will show you how to use memory allocation profiling tools to discover performance hotspots, even when they’re coming from inside a library. We will use this technique with a real-world application to identify a piece of optimizable code in Active Record that ultimately leads to a patch with a substantial impact on page speed.

Valentino Gagliardi - RSS Feed 

Understanding asynchronous Python and Django: a roadmap

The asynchronous Python landscape is terribly confusing even for developers coming from other languages where the asynchronous model is strong.

This is a collection of links, ordered as a roadmap by incremental level of difficulty. Enjoy!

Understanding asynchronous Python: the basics

To start off, if you're completely new to the asynchronous vs synchronous model in Python, you should watch Asynchronous Python for the Complete Beginner by Miguel Grinberg. It is one of the most beginner-friendly introductions to the topic.

By the same author Sync vs. Async Python: What is the Difference? is a slimmed down written version of the talk.

Understanding asynchronous Python: digging deeper

After…

Heroku 

The Life-Changing Magic of Tidying Ruby Object Allocations

Your app is slow. It does not spark joy. This post will use memory allocation profiling tools to discover performance hotspots, even when they're coming from inside a library. We will use this technique with a real-world application to identify a piece of optimizable code in Active Record that ultimately leads to a patch with a substantial impact on page speed.

In addition to the talk, I've gone back and written a full technical recap of each section to revisit it any time you want without going through the video.

I make heavy use of theatrics here, including a Japanese voiceover artist, animoji, and some edited clips of Marie Kondo's Netflix TV show. This recording was done at EuRuKo on…

Ruby on Rails Podcast 

336: Brittany Has A New Job(!) && Co-Host Catchup

It's been hinted around but Brittany has a new job! She is the new Backend Engineering Lead at TextUs. She invites Nick back to the show to pepper her with questions about switching, remote work and a new codebase. In turn, Brittany asks Nick for an update on Past Rubies.

Links for this episode:

Ruby Magic by AppSignal 

Rails Concerns: To Concern Or Not To Concern

If you’ve ever used Ruby on Rails, you’ve probably come across the concept of concerns. Whenever you jumpstart a new Rails project, you get a directory app/controllers/concerns and app/models/concerns. But what are concerns? And why do people from the Rails community sometimes talk badly about them?

Quick Overview

A Rails Concern is any module that extends ActiveSupport::Concern module. You might ask — how are concerns so different from modules? The main difference is that Rails concerns allow you to do a bit of magic, like so:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# app/models/concerns/trashable.rb

module Trashable
  extend ActiveSupport::Concern

  included do
    scope :existing, -> { where(

You see…

Saeloun Blog 

Ruby adds support for forwarding arguments to a method, along with the leading arguments

Ruby 2.7 has added a new shorthand syntax ... for forwarding arguments to a method. Here’s a short read on forwarding arguments for a quick refresher.

Before

... was limited to forwarding arguments to a method, as shown below:


def travel(...)
  by_road(...)
end

However there could be use cases where ... can be used along with the leading arguments as shown below:

def travel(preference, ...)
  if preference == "air"
    by_flight(...)
  else
    by_road(...)
  end
end

After

Now, Ruby 3.0 has added support for the forwarding arguments along with the leading arguments.

Let’s understand this with the help of an example:

def transform(a, ...)
  process(a, ...)
end

def process(a, *a…
RubyMine: The Ruby on Rails IDE – RubyMine Blog | JetBrains 

RubyMine 2020.2.2 Is Available

RubyMine 2020.2.2, 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.1.4 from our website.

You’ll find the following improvements in this update:

  • The LightEdit mode now works by default only for *.log, *.md, *.txt, and some other files. Additional configurations are available in Preferences / Editor / File Types: IDEA-248255
  • Fixed an issue with unit tests freezing on exception: RUBY-26937
  • Fixed an issue with incorrect group ordering in Find Usages: RUBY-26897
  • Fixed an issue with the debugger hanging on a breakpoint: RUBY-26462
  • Fixed a couple of issues with debugger gem…

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

Happy developing!
The RubyMine team

Greater Than Code 

200: "Bad Code" with Damien Burke

02:58 - Damien’s Superpower: Being able to hold contradictory beliefs at the same time.

  • Working in VERY Local Government (for the City of Los Angeles)

07:05 - What is “Bad Code”?

16:38 - What should you do with “Bad Code”?

  • Nothing? (I know it’s bad but it’s okay!)
  • Do it later? (If you can put it off and make it better later, put it off!)

19:12 - Working With Others: Agreeing on “Good Code”

  • Go-to Values
    • Can we understand this? Does it…
Sandip Mane 

Zero-Downtime migrations in Rails

Often, we rename a column and deploy to find out the Honeybadger screaming at us with the errors accessing column with the old name!

The Problem

ActiveRecord caches the columns and uses column names from the cache to build INSERT and UPDATE queries. So, when a record is updated, activerecord tries to update all the columns, including the one which we recently renamed.

This is our migration to rename f_name column to first_name.

Upon deployment, the old processes which are still referring to the f_name column in the cache will try to access/write it to the database and raise 500 error.

Solution

The solution involves multiple migrations + deployments for a single change. This…

GoRails Screencasts 

Contributing To Thor

Thor is a tool in Ruby that powers command line tools like the Rails generators. In this video, we're fixing an unexpected situation that we found while using Thor.
The Official BigBinary Blog | BigBinary 

Ruby 2.8 adds endless method definition

This blog is part of our Ruby 2.8 series.

Ruby 2.8 adds endless method definition. It enables us to create method definitions without the need of end keyword. It is marked as an experimental feature.

# endless method definition
>> def raise_to_power(number, power) = number ** power

>> raise_to_power(2, 5)

=> 32

The discussion around it can be found here. Check out the pull request for more details on this.

All Ruby Podcasts by Devchat.tv 

RR 470: Performance Improvement of Ruby 3.0 JIT with Takashi Kokubun

In this episode of Ruby Rogues, the panelists discuss the progress, problems, and strategies for implementing JIT in Ruby for the Ruby 3×3 goal all while being humbled a bit as Takashi improves our understanding around the subject.

Sponsors

Panel

  • John Epperson
  • Matt Smith
  • Luke Stutters

Guest

  • Takashi Kokubun

Links

Picks

Luke Stutters:

Matt Smith:

  • All the Pretty Horses by Cormac McCarthy

John Epperson:

Takashi Kokubun:

  • Animal Crossing

Follow Ruby Rogues on…

The Bike Shed 

260: N+1s For Days

On this week's episode, Chris shares a tale of performance improvements and a recent discussion about replacing a REST API with GraphQL. Steph dives into migrating a database column to restrict input and dropping database columns safely. They also discuss when to abstract code (a topic that surprisingly, they may not agree on) and running "Unused" to identify dead code.


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
  • Indeed - Click through and get started with a free seventy five dollar credit for your first job post

Josh Software 

Using Multiple Databases in Rails 6 to Log Access Requests

Imagine a situation where you need to log every attempt at accessing your application regardless of how many application servers are deployed and when. Text logs aren’t enough and can be difficult to aggregate across multiple disparate filesystems. Not to mention, retrieval of any given text-based record (or series thereof) after several years can be … Continue reading Using Multiple Databases in Rails 6 to Log Access Requests
katafrakt's site 

Seeds-driven development

In my career as a web developer, I created my fair share of what I call content-driven websites. Unlike usual e-commerce or Twitter-like social platforms we talk about, these work differently. Content is not provided by users, they usually only consume it. The content creators are usually a small group of people with access to some kind of admin panel (sometimes it is really only one person!).

“Well, why not just use Wordpress” - is a question I’ve heard a lot. The answer - the content is always pretty specific. Aside from the usual title and body, it has a bunch of properties of relations to other data entities. Modelling it in classic CMS systems, such as Wordpress or Drupal, is…

Martian Chronicles, Evil Martians’ team blog 

PostCSS 8.0: Plugin migration guide

Author: Andrey Sitnik, Author of PostCSS and Autoprefixer, Lead Frontend Developer at Evil Martians

PostCSS received a major update with the release of version 8.0 codenamed “President Ose”. Plugin creators can now opt in for a new API that сan increase build speeds and reduce the size of dependencies for the end-users of their tools. This guide describes steps you need to take as a plugin developer to make the most out of the improved framework.

PostCSS—a framework for processing CSS with JavaScript—is one of the most popular frontend tools for the modern web with over 25 million downloads a week.

The reason why so much code depends on it is the trust from big projects like webpack

avdi.codes 

SIGAVDI #87: Squash Blossom Edition

Hello friends,

First off, real quick: I’m planning a workshop on project automation. Tell me if you’re interested? Thanks!

OK, onward…

I’ve been reading a lot of books lately. So in lieu of the usual links, I give you a throwback to earlier incarnations of SIGAVDI: Fewer links, more quotes.

It was inconceivable for me, as an educated Western man, that cognition, as it is defined in the philosophical discourse of our day, could be anything besides a homogeneous, all-engulfing affair for the totality of mankind. Western man is willing to consider cultural differences that would account for quaint ways of describing phenomena, but…

Justin Collins' Blugh 

Another Reason to Avoid constantize in Rails

Backstory

Recently, a friend asked me if just calling constantize on user input was dangerous, even if subsequent code did not use the result:

1
params[:class].classify.constantize

Brakeman generates a “remote code execution” warning for this code:

Confidence: High
Category: Remote Code Execution
Check: UnsafeReflection
Message: Unsafe reflection method `constantize` called with parameter value
Code: params[:class].classify.constantize
File: app/controllers/users_controller.rb
Line: 7

But why? Surely just converting a string to a constant (if the constant even exists!) can’t be dangerous, right?

Coincidentally, around that same time I was looking at Ruby deserialization gadgets -…

Rails with Jason 

062 - Database Views with Mark Hutter, Lead Engineer at Landing

In this episode I talk with Mark Hutter, Lead Engineer at Landing, about database views. Mark and are discuss what views are, in what scenarios you'd use them, how we handle database modeling in general, and other topics.

Links:

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

How to Run Ruby/Rails Commands from the IDE instead of the Terminal

In the Ruby/Rails community, using a terminal is the most popular way to perform various commands and tasks. These tasks include running scripts, tests, Rails generators, Git and Docker commands, and many other things. We also noticed this ourselves when we did some RubyMine usability testing among developers at RailsConf 2019. We found that most participants ran Bundler commands and tests from the IDE terminal.

In this blog post, we’ll discuss the RubyMine features that can be used instead of running specific terminal commands and the benefits that working with the IDE provides. We’ve divided the commands into several groups to allow you to quickly find a corresponding RubyMine…

JetRockets 

4 Ways To Motivate Your Employees (That Don’t Include A Raise)

At JetRockets we take great pride in our employees and the work they do. Here are a few ways we motivate our employees and make sure they stay happy!
Remote Ruby 

Ruby 3 adds Ractor, Hook Relay, ZSH and more

[00:08:26] Chris has been jumping into the Ruby stuff and mentions there was a Ractor announcement and it was accepted, which will be in the next Ruby.  Chris asks Andrew if he’s written much multithreaded code before and Chris talks about his experience with it and talks about Ractor. 
[00:17:47] Chris and Andrew discuss things they learned and didn’t learn in college classes.  
[00:21:23] Andrew talks about wanting to use the Anyway Config from Palkan which he thinks will solve a lot of his issues. 
[00:28:08] Andrew tweeted that he had to declare GitHub notification bankruptcy having over 2000 notifications! ☺   
[00:31:31] Does starring a repo get any notifications? The guys talk…
Mike Perham 

What's New in Sidekiq, 2020 edition

“Your work doesn’t matter if no one knows about it” – some marketing genius COVID and wildfires have made this year hellish and really difficult to focus. I sympathize with all of my fellow engineers trying to maintain systems and improve apps while dealing with our rapidly changing society. Be kind to each other. ❤️ Let’s distract ourselves with a Sidekiq family update. Sidekiq 6.1 The most visible change in Sidekiq 6.
Emmanuel Hayford 

An SMS Reminder Service With Ruby & A Raspberry Pi

Building An SMS Reminder With Ruby & Raspberry PiPhoto by Emmanuel Hayford

Just about a fortnight ago, I became a father. I acquired new responsibilities, one of which is to make sure our newborn gets his supplements. In our case, I must give a drop of vitamin D to our son every day for a year. My partner asked me to remind her about this. I could use a reminder on my phone, but I miss reminders – I have all notifications turned off.

The Raspberry Pi is a functional computer with modest specs for portability. The official OS on the Raspberry Pi is Raspberry Pi OS which is based on Debian, a Linux distribution. It comes loaded with free and open-source software. Two of which I used for our project: Ruby and systemd.

I just got a Raspber…

Awesome Ruby Newsletter 

💎 Issue 225 - Survey finds only 3% of Ruby on Rails developers use Windows

Ruby Weekly 

Ractors, Sinatra 2.1, and getting symbol names more efficiently

#518 — September 10, 2020

Read on the Web

Ruby Weekly

Writing a Ractor-Based TCP ServerRactor is an actor-like mechanism for getting true parallel execution support in Ruby without any thread safety concerns. An initial implementation has been merged into the main Ruby branch and people are starting to play such as with this attempt at creating an HTTP server. Richard Schneeman’s Twitter thread about ractors is also interesting. The future is coming!

Kir Shatrov

Sinatra v2.1.0 Released — Believe it or not, it’s over three years since Sinatra 2.0 dropped, so a 2.1 is a big deal 😁 The popular web…

Riding Rails 

Rails 5.2.4.4 and 6.0.3.3 have been released

Hi everyone! Rails 5.2.4.4 and 6.0.3.3 have been released! These releases contain an important security fix, so please upgrade when you can.

Both releases contain the following fix:

Here are the checksums for 5.2.4.4:

ddc79ec6c5122c1eda8121b3c75ca53635235427  actioncable-5.2.4.4.gem
caaa2b50e93b71d25e2181a2bf9d7e885fbbb1f6  actionmailer-5.2.4.4.gem
228ea8910bad233edfe78c323c2789f3c6c811bc  actionpack-5.2.4.4.gem
686b82b79ad7a356a19f23738a79f65ee9dcc2a7  actionview-5.2.4.4.gem
cfa1e6f429162076914fce6897389f10541d6316  activejob-5.2.4.4.gem
1d6f19c918b991aca06d1c32de824ec5ed15bbfb …
Saeloun Blog 

Changes to behavior in rails db:migrate:name command

Let us assume we have a multi-database configuration in our Rails app having a primary and secondary database.

default: &default
  adapter: sqlite3
  
development:
  primary:
    <<: *default
    database: db/development.sqlite3
    pool: 10
    timeout: 6000
  secondary:
    <<: *default
    database: db/secondary_development.sqlite3
    pool: 20
    timeout: 10000

Before

In Rails 6, rails db:migrate would dump the schemas of all the databases present in database.yml.

In our case, it would generate the following two schema files.

db/schema.rb
db/secondary_schema.rb

Now, with rails db:migrate:primary, we would expect the primary database schema dump file to be generated. But turns…

ruby – Bibliographic Wilderness 

Github Actions tutorial for ruby CI on Drifting Ruby

I’ve been using travis for free automated testing (“continuous integration”, CI) on my open source projects for a long time. It works pretty well. But it’s got some little annoyances here and there, including with github integration, that I don’t really expect to get fixed after its acquisition by private equity. They also seem to have cut off actual support channels (other than ‘forums’) for free use; I used to get really good (if not rapid) support when having troubles, now I kinda feel on my own.

So after hearing about the pretty flexible and powerful newish Github Actions feature, I was interested in considering that as an alternative. It looks like it should be free for…

Ruby on Rails Podcast 

335: AllTrails is All Rails with James Graham

As the leader of the AllTrails Engineering team, James Graham and his team are responsible for expanding AllTrails beyond a functional tool to a fun and personalized, trail discovery experience all supported by highly scalable web services -- including Ruby on Rails.

Links for this episode:

Brought to you by:

Datadog

Do you have an app in production that is slower…

Saeloun Blog 

Ruby adds `Symbol#name` to return frozen string corresponding to the symbol name

Ruby adds instance method #name to Symbol.

This method returns an instance of String with the same underlying value as the instance of Symbol:

  :test.name
=> "test"

The resultant string is frozen.

irb(main):002:0> :laptop.name
=> "laptop"
irb(main):003:0> :laptop.name.object_id
=> 180
irb(main):004:0> :laptop.name.object_id
=> 180
irb(main):005:0> :laptop.name.frozen?
=> true

In the above example, we could observe that the same object_id is being returned for different invocations of :laptop.name. It indicates that no new instances of String are allocated after the first allocation of “laptop”.

How is it different from #to_s on Symbol?

When we call #to_s on a symbol, the resulting…

Greater Than Code 

199: Toxicity in Tech with Amy Newell

04:31 - Amy’s Superpower: Search Algorithms and Finding Things

  • Finding Things in Code
  • Visual vs Spacial Awareness

08:39 - Toxic Masculinity and Hierarchies in Engineering Roles

14:22 - Measuring Skill Advancement

  • The Individual Contributor (IC) vs Manager Track
  • Management vs Mentorship

21:02 - Congressive vs Ingressive

Blog 

Elixir Phoenix Framework — Tutorial To Build a Blog in 15 Minutes

I suppose everyone can recall blog posts about building your own blog in 15 minutes with Ruby on Rails. Building a simple blog post page with Rails was as easy as writing hello world in any other language. Nowadays, however, there are more and more articles Phoenix framework tutorials and it looks like the Ruby world has started to fall in love with Elixir. Because of that, I took up the challenge and decided to check out how easy (or difficult ;-)) it is to write a blog using the Phoenix framework.

Josh Software 

Searchable logs with Filebeat and Elastic Stack

In a data sensitive application debugging is the most critical and time consuming especially if requests traffic is tremendously high, when it comes to debugging every developer’s last resort is application logs and debugging in large logs file is not an easy task. In this post I will brief you about how we can make … Continue reading Searchable logs with Filebeat and Elastic Stack
Code with Jason 

The difference between let, let! and instance variables in RSpec

The purpose of let and the differences between let and instance variables

RSpec’s let helper method is a way of defining values that are used in tests. Below is a typical example.

require 'rspec'

RSpec.describe User do
  let(:user) { User.new }

  it 'does not have an id when first instantiated' do
    expect(user.id).to be nil
  end
end

Another common way of setting values is to use instance variables in a before block like in the following example.

require 'rspec'

RSpec.describe User do
  before { @user = User.new }

  it 'does not have an id when first instantiated' do
    expect(@user.id).to be nil
  end
end

There are some differences between the let approach and the instance variable…

Honeybadger Developer Blog 

A Gentle Introduction to Web Services With Go

You may have heard that Go is great for web development. This claim is evidenced by several cloud services, such as Cloudflare, Digital Ocean, and others, betting on Go for their cloud infrastructure. But, what makes Go such a compelling option for building network-facing applications?

One reason is the built-in concurrency in the language through goroutines and channels, which makes programs effectively use the resources of the hardware its running on. Ruby and other web-centered languages are usually single-threaded. Going beyond that can be done with the help of threads, but these feel like an add-on rather than a first-class citizen of the language.

Go also boasts a great standard…

The Official BigBinary Blog | BigBinary 

Rails 6.1 adds --minimal option support

This blog is part of our Rails 6.1 series.

rails new my_app creates a new Rails application fully loaded with all the features.

If we want to omit some of the features then we needed to skip them like this.

# before Rails 6.1

$ rails new tiny_app
    --skip-action-cable
    --skip-action-mailer
    --skip-action-mailbox
    --skip-action-text
    --skip-active-storage
    --skip-bootsnap
    --skip-javascript
    --skip-spring
    --skip-system-test
    --skip-webpack-install
    --skip-turbolinks

Before Rails 6.1 it was not possible to skip things like active_job and jbuilder.

Rails 6.1

Rails 6.1 added a new option --minimal.

$ rails new tiny_app --minimal

All the following are…

Kir Shatrov 

Writing a Ractor-based web server

Ractor, the new concurrency primitive in Ruby, has been merged to the upstream few days ago. I’ve been following that PR and watching the author’s talk at RubyKaigi (in Japanese, I wasn’t able to find the translated version but it should be available somewhere), which got me excited to try Ractor myself.

A web application server is the first thing that comes to mind when playing with concurrency. On top of that, not too long ago I’ve implemented TCP servers in Rust and Go, so I got curious to write a simple web server using Ractor.

Let’s dive in!

What’s in a web server?

A web server is something that accepts a TCP socket, reads from it, parses HTTP headers and responds with HTTP body.…

rossta.net 

These Rails apps are overpacking their JavaScript bundles

You might think dividing your JavaScript into multiple bundles will help improve page load performance. When done incorrectly with Webpacker, it's possible to make things worse.

This mistake appears relatively common. As I'll share in this post, I've discovered several of my favorite Rails applications are making browsers download and parse more JavaScript than necessary even while attempting to send less.

I believe Rails developers may think the mechanics of packaging JavaScript for the browsers work similarly in Webpacker as it does with the Rails asset pipeline. This assumption is fraught with peril!

Crash bang warehouse accident

As we'll see, Webpacker is a very different beast than the Rails asset pipeline. We…

Valentino Gagliardi - RSS Feed 

React Context API is not a state management tool

This may sound obvious, but React Context API is not a state management tool per-se.

What I mean is that the Context alone is not enough to manage application's state without a companion hook like useState or useReducer.

Creating a Context

To create a new Context in React we call createContext():

const MyContext = React.createContext();

Once a Context is in place we can provide an initial value to the Context Provider on the value prop:

import React from "react";

const MyContext = React.createContext();

function App() {

  const userName = "Juliana";

  return (
    <MyContext.Provider value={userName}>
    {/* Some children */}
    </MyContext.Provider>
  );
}

However, this value is…

The Bike Shed 

259: That's Not How Numbers Work

On this week's episode, Steph and Chris tackle the thorny topic of 10X engineers. Do we think they really exist? What characteristics make an individual more effective, and more importantly, what can they do for a team?

To round out the conversation, they chat about rewrites and when they do and don't make sense, Ruby 2.7 keyword argument deprecation warnings, and a listener question revisiting Ruby popularity and what languages would we learn if we couldn't write Ruby anymore.


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
  • Indeed - Click through and get started…

Rails with Jason 

061 - SRE and Incident Response with Erin Dees, Principal Software Engineer at Stitch Fix

In this episode I talk with Erin Dees, Principal Engineer at Stitch Fix, about Site Reliability Engineering. Topics discussed include being on-call, incident response, SLAs and SLOs, incident severity levels, recovering from incidents, and more.

Sandip Mane 

Hash With Indifferent Access in Rails

When I found out how the params could be accessed using both symbol and string as keys, I dived deep to figure out about ActiveSupport::HashWithIndifferentAccess class in Rails.

In this blog, we will go through it’s implemention. Check the Source Code and Documentation.

> rgb = ActiveSupport::HashWithIndifferentAccess.new
> rgb[:black] = '#000000'
> rgb[:black]  # => '#000000'
> rgb['black'] # => '#000000'

So, this is what it is, we can use both symbols and strings as keys to access the Hash.

Then, in what type the keys are actually stored?

> rgb.keys    # => ["black"]

Strings! Let’s see how its done.

Write

Above, we have a method which is used to add a key value pair to the…

Drifting Ruby Screencasts 

GitHub Actions

GitHub Actions makes it easy to automate all your software workflows, now with world-class CI/CD. Build, test, and deploy your code right from GitHub. In this episode, learn to set up GitHub Actions on your Ruby on Rails application with automated tests, code coverage reporting, and security testings.
Running with Ruby 

Karafka framework 1.4.0 Release Notes (Ruby + Kafka)

This release mostly solves problems related to message deserialization and normalizes some of the naming conventions to ease during the upgrade to the upcoming 2.0 version.

Note: This release is the last release with ruby-kafka under the hood. We’ve already started the process of moving to rdkafka-ruby.

Note: If you are using Sidekiq-Backend plugin, please make sure that you’ve processed all the jobs from your Sidekiq queue before upgrading Karafka gems.

Changes (features, incompatibilities, etc)

consumer#metadata is now consumer#batch_metadata

This change is trivial: if you use batch consuming mode and you use the Consumer#metadata method, replace it with Consumer#batch_metadata.

#…
Sinatra 

Sinatra v2.1.0

Today we would like to inform you that we have released Sinatra v2.1.0. It’s a big milestore for us and contains some bug fixes and new features.

Releases

This release includes the release of the following gems:

  • sinatra: v2.1.0
  • sinatra-contrib: v2.1.0
  • rack-protection: v2.1.0

Key Updates

Ruby 2.2. support was dropped

Ruby 2.2 support is dropped from this version. We will no longer check the operation on Ruby 2.2. Please upgrade your ruby version if you’re still using Ruby 2.2.

Migrating from Thin to Rainbows in our development environment

From this version, we migrated from thin to rainbows in our development environment. This does not mean that the stream block will be…

Valentino Gagliardi - RSS Feed 

Design patterns and refactorings in JavaScript, notes

Design patterns and refactorings in JavaScript

Even though JavaScript lacks strong types and interfaces, or has fake classes, that doesn't mean we shouldn't strive for better code.

There are always occasions for making our code cleaner, understandable, and maintainable, one step at a time.

Following, a collection of (work in progress) notes on software design patterns and refactorings applied to JavaScript. Feel free to peruse them.

Creational patterns

Factory function

Factory function, also known as factory method is a pattern aiming at making collaborating part of the code…

It consists in…

Remote Ruby 

Rails Hosting Survey results & Junk Drawers for Code

[00:00:55] Jason explains his absence last week because he was trying to trace down a bug with CableReady and morphed them how they worked together.
[00:10:05] Chris has been working on a new course which he’ll announce soon. He wants to get into the meta programming, classes and modules, class variables, just more advanced Ruby stuff. He mentions how he did a screencast on “The Gilded Rose Kata.” 
[00:13:40] Andrew tells us he’s been drowning at work, working on the podcast app for Rebase, and diving into the world of podcast hosting and podcast statistics. Andrew makes an AWESOME announcement about this podcast! ☺
[00:17:45] This past weekend Chris installed Rails version 1.0 and…
solnic.codes 

Open Source Status Update – August 2020

Hey y’all! It’s time for another OSS update. I was quite busy with my “normal work” in August so unfortunately I didn’t manage to work on rom-rb like I planned. I focused mostly on dry-rb maintenance work and growing my YouTube channel.

OK let’s see what happened!

Saying “good bye” to dry-web!

That’s right! We officially discontinued our work on dry-web as well as dry-web-roda, which was its companion gem that integrated Roda with dry-web.

The reason is quite simple – we’re focusing our efforts on Hanami 2.0 and there’s no real need to continue maintaining dry-web and dry-web-roda. If you’ve got apps running on dry-web-roda, don’t worry – transitioning to Hanami 2.0 shouldn’t…

Valentino Gagliardi - RSS Feed 

My inclusive tech manifesto

I have the privilege to spend most of my time teaching coding and technology.

The values I try to pass to other people are technical notions at the least, but positive and inclusive teachings first of all.

These are the rules I try to abide to and convey every single day. I hope you do too.

Rule number 0: always be humble

We all have been beginners at some point, and we continue to be beginners every day: technology changes constantly.

The goal when teaching technology and programming languages to beginners is not to inflate your ego by making them appear less smart than you.

Instead, always make them comfortable, as you were re-learning again with them. Always be humble.

Rule number 1:…

Awesome Ruby Newsletter 

💎 Issue 224 - Ruby Creator Yukihiro Matsumoto on the challenges of updating a programming language

Code with Jason 

When to refactor

As a system grows, constant refactoring is needed in order to keep the code understandable.

There are four possible times to perform any piece of refactoring.

  1. During a change
  2. Independently of changes
  3. After a change
  4. Before a change

Some of these times to perform refactorings are good and some are less good. Let’s evaluate each of these times.

Evaluating the various times to refactor

Refactoring during a change

Of the four possible times to refactor, refactoring during a change is the worst time to do it. The reason is because when you look back at the changes you made, you have no easy way to see what’s a behavior change and what’s a refactoring. If you introduce a bug during your work,…

The Ruby Blend 

Episode 21: Do you really need two cans of Play-Doh?

The Ruby Blend - Episode 21

Welcome to The Ruby Blend! Dave had a great idea for our topic today, which we'll be talking about our development setups, our environments, and some of the equipment we are using. Dave tells us about Elgato Steam Deck that he's getting soon and pingVerse. We will learn the guys favorite fonts, browsers they are using, specific equipment that is in their office, and what applications they can't live without. Dave makes a point about keeping your desk clean and why does Andrew disagree? Download this episode to find out more!
Sponsored by:Panelists:Guests:
  • None
Show Notes

[00:01:06] Dave tells us about the Elgato…
Ruby Weekly 

Experimental support for rightward assignments

#517 — September 3, 2020

Read on the Web

Ruby Weekly

Ruby Adds Experimental Support for Rightward Assignments — I might be wrong, but I think this curious bit of syntax which may end up in Ruby 3 may prove to be controversial! Essentially you’ll be able to write 1 => a and a will equal 1. Here’s the actual change but of more interest will be the bugs.ruby-lang.org discussion about it complete with more thorough examples.

Vamsi Pavan Mahesh

2020 Ruby on Rails Community Survey Results — Based on the results, the typical Rails developer is self-taught, works for a product company, been working with Rails…

Hi, we're Arkency 

Anti-IF framework - if/else based on type

I have to admit that I’m a bit crazy when it comes to IF statements.

I know that they’re the foundation of programming. I know that it’s impossible to completely eliminate them. Still, I know we can do better than if/else-driven development.

IEDD - If/Else Driven Development

To me IEDD is all about emotions.

The fear of adding new classes. The pain of changing the existing nested IFs code structure. The shame of adding Yet Another IF. The challenge of adding a new feature with a minimal number of keystrokes. The hope of not getting caught on code review.

YAI - Yet Another IF

My goal is to help you improve the design of the if/else based codebases.

Yes, that probably means creating…

GoRails Screencasts 

How to Test Gem Dependencies with Appraisal

Appraisal lets us test our code against different versions of dependencies. This is fantastic if you're building Rubygems that must work with multiple versions of Rails or other dependencies
The Rails Tech Debt Blog 

What are the Code Coverage Metrics for Ruby on Rails?

At FastRuby.io we are constantly looking at code coverage metrics for Ruby on Rails applications. It's a key indicator for us. We even use that information to decide whether we work on a Rails upgrade project or not.

So, I was interested in seeing code coverage metrics for the Ruby on Rails framework. I couldn't find any information about this online, so I decided to generate a few reports for each component.

This is an article about my process and my findings.

Process

In order to calculate code coverage, I used SimpleCov and analyzed Rails at f22dd39.

I didn't run the entire test suite from its root directory, I went into each component and ran the test suite for that component.

I…

Valentino Gagliardi - RSS Feed 

var, let, and const in JavaScript: a cheatsheet.

var, let, and const in JavaScript: a cheatsheet

var

The var statement declares a variable in JavaScript which abides to the following rules:

  • is function-scoped or globally-scoped.
  • is not subject to the temporal dead zone.
  • it creates a global property on window with the same name.
  • is reassignable.
  • is redeclarable.

Function-scoped or globally-scoped

var creates a global variable when appears in the global scope. In addition, it creates a global property on window

var
Ruby on Rails Podcast 

334: Simple Lovable Complete with Michael Springer

The announcer of the podcast, Michael Springer guested on the show. Michael is a software engineer at JazzHR and he spends his free time tinkering on hobbyist projects ranging from writing chat bots to building plastic robots.

Links for this episode:

Saeloun Blog 

Rails adds a minimal flag to generate a new application

Before

When we generate a new Rails application, Rails includes all the possible frameworks that are needed to build a modern-day full-stack web application by default.

However, not everyone who’s using Rails needs all of them. For example, if we have an application that does not need Action Cable, Action Mailbox, and Action Text, we would generate a new application, by passing flags to skip these frameworks as shown below:

rails new my_awesome_app --skip-action-text --skip-action-cable \
--skip-action-mailbox

Nonetheless, there are some users, who want a bare minimum version of Rails without all frameworks. It’s not uncommon for some of the minimalists to do something like this:

rails
Greater Than Code 

198: Learning From Failure with Ravs Kaur

02:30 - Rav’s Superpower: Learning to Learn

  • Success and Failure
  • Creating Environments Where It’s Safe to Fail
  • Exploring Ideas and Collecting Datapoints
  • Celebrating Feedback Cycles and Experiments

07:12 - Failing Fast – Getting Early Feedback Along the Way

  • Getting Over the “Being Polished” Hump
  • Learning for Self-Fulfilment

17:02 - Empathy as a Life Skill

  • Simulation
  • Empathy is Necessary to Learn Through Failure

26:40 - Uplevel: Empowering Engineers to do Their Best Work

31:49 - Productivity and Judgement Value

  • The Effect the Pandemic Has Had ^
  • Capturing Interruptions and Mitigating Responses
  • The “is work happening?” panic and fear and the worry “is innovation at the…
Honeybadger Developer Blog 

Mastering Low Level Caching in Rails

Caching is a general term which means storing the result of some code so that we can quickly retrieve it later. This allows us to, for example, perform some heavy number-crunching once and then just re-use the value without having to recalculate it again. Although the general concept is the same for all types of caching, there are various mechanisms we can use depending on what we are trying to cache.

For Rails developers the most common forms of caching are things like memoization (covered in a previous part of this caching series), view caching (stay tuned for the next article), and low-level caching, which we will cover here.

What is Low-Level Caching

What Rails calls low level caching

Engine Yard Blog 

How NoOps Improves Development Productivity and Operational Agility

A NoOps platform can be a benefit to application development teams and address challenges around improving productivity and operational agility. 

 

Rails with Jason 

060 - Andy Croll, Organizer of Brighton Ruby Conference and CTO of CoverageBook

In this wide-ranging episode I talk with Andy Croll about tech conferences, living in Singapore, spicy food, Andy's employer CoverageBook, and legacy code.

code.dblock.org | tech blog 

Keeping a CHANGELOG at Work

What did you do at work today? How about last week? I spent a couple of days in quarterly business reviews, and wrapped up yearly planning activities for AWS Data Exchange and AWS Marketplace. I also added some unit tests to a project that I am onboarding into.

Since my first day in AWS, just over a year ago, I’ve been experimenting with keeping a CHANGELOG of everything I do, available for everyone at the company to see. I think you should too!

Keeping track of humanly readable changes in the open-source world has been a long established best practice. It shows that maintainers truly care about customers - making it accessible and easy to understand the changes across multiple…

The Official BigBinary Blog | BigBinary 

Rails 6 adds support to persist timezones of Active Job

This blog is part of our Rails 6 series. Rails 6.0 was recently released.

When a job is enqueued in Rails 6 using Active Job, the current timezone of a job is preserved and then this preserved timezone is restored when the job is finished executing.

Let’s take an example of sale at Amazon.

Amazon would like to remind users across different timezones about its upcoming sale by sending an email. This task of sending a reminder would be processed as a background job.

Before:

Before Rails 6, we had to pass timezone explicitly to the perform method of the job as shown below.

timezone = "Eastern Time (US & Canada)"

AmazonSaleJob.perform_later(Time.now, timezone)

class AmazonSaleJob < Appl…
All Ruby Podcasts by Devchat.tv 

RR 469: Refactoring with James Dabbs

In this episode of Ruby Rogues, we talk to James Dabbs as we explore a number of subjects and topics around refactoring

Sponsor

Panel

  • Dave Kimura
  • John Epperson
  • Matt Smith
  • Luke Stutters

Guest

  • James Dabbs

Links

Picks

John Epperson:

James Dabbs:

Luke Stutters:

Dave Kimura::

Matt Smith:

Follow Ruby Rogues on Twitter > @rubyrogues

The Bike Shed 

258: Digital Gardeners

On this week's episode, Steph and Chris discuss a git-blame feature that supports bypassing less helpful commits. They also revisit a discussion about Dependabot PRs and recent performance adjustments, sharing which strategies worked and which ones didn't. They also discuss the dreaded three-state boolean, designing a system for cacheability, and using Ruby's magic comment to freeze string literals.


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
  • Indeed - Click through and get started with a free seventy five dollar credit for your first job post

Martian Chronicles, Evil Martians’ team blog 

System of a test II: Robust Rails browser testing with SitePrism

Author: Vladimir Dementyev, Lead Developer at Evil Martians

Tired of seeing your Rails system tests go red every time there’s a minor change to the application frontend? See how we solve this problem with SitePrism that allows to abstract out page implementation details, making our Capybara code more generic and less error-prone. Learn advanced techniques for organizing and DRYing out your browser testing code, based on Evil Martians’ commercial work.

In the first part of our Rails system tests series, we only covered the topic of setting up the environment for browser tests in Rails. We didn’t even show a piece of an actual test, or scenario. Why so? First, the article couldn’t fit…

Saeloun Blog 

Ruby adds experimental support for Rightward assignments

This blog post discusses the support for Rightward assignments in ruby.

Before

Historically, all of the early programming languages were designed by Mathematicians. It’s a common practice in mathematics to say let x = 4y + z, which is read as let x be equal to 4y + z.

So the same pattern is followed in programming languages as well.

For assigning a value to a variable, we typically do age = 42 in ruby. Here we are assigning the Rvalue 42 to an Lvalue age.

While the above pattern has become standardized, it feels somewhat unnatural as we read most of the spoken languages from left to right.

We were not able to do something like 42 => age.

After

With the recent changes, Ruby supports…