makandra tech survey - results

Posted Over 1 year ago by Tobias Kraze.

These are the results of the "personal tech stack survey". I've included only the most popular mentions, maybe it...

Double loading issue with Ruby default gems

Posted Almost 2 years ago by Emanuel.

Ruby includes many standard gems that are bundled into the Ruby installation. Here is an example for the gem strscan...

You are not using filter_map often enough

Posted Almost 2 years ago by Arne Hartherz.

Somewhat regularly, you will need to filter a list down to some items and then map them to another value...

Capybara: Most okayest helper to download and inspect files

Posted Almost 2 years ago by Henning Koch.

Testing file download links in an end-to-end test can be painful, especially with Selenium. The attached download_helpers.rb provides...

JavaScript: New Features in ES2021

Posted About 2 years ago by Julian.

tl;dr With ES2021 you now can use str.replaceAll(), Promise.any(), logical assignment operators, numeric separators and WeakRef on all major...

net-ssh and openssl-3.0.0

Posted About 2 years ago by Stefan Langenmaier.

You'll need openssl-3 or newer for servers running 22.04 Ruby version 3.1 uses by default the gem openssl...

Use DatabaseCleaner with multiple test databases

Posted About 2 years ago by Dominic Beger.

There is a way to use multiple databases in Rails. You may have asked yourself how you're able to...

Gem development: recommended gem metadata

Posted About 2 years ago by Daniel Straßner.

The gemspec for gems allows to add metadata to your gem, some of which have a special meaning and are...

How to get information about a gem (via CLI or at runtime from Ruby)

Posted About 2 years ago by Arne Hartherz.

When you need information about a gem (like version(s) or install path(s)), you can use the gem binary...

jeremyevans/ruby-warning: Add custom processing for warnings

Posted About 2 years ago by Henning Koch.
github.com

ruby-warning adds custom processing for warnings, including the ability to ignore specific warning messages, ignore warnings in specific files/directories...

Version 5 of the Ruby Redis gem removes Redis.current

Posted About 2 years ago by Arne Hartherz.

Redis.current will be removed without replacement in redis-rb 5.0. Version 4.6.0 adds deprecation warnings for Redis.current and Redis.current=: `Redis.current...

Integrating ESLint

Posted About 2 years ago.

To ensure a consistent code style for JavaScript code, we use ESLint. The workflow is similar to integrating rubocop...

How to add esbuild to the rails asset pipeline

Posted Over 2 years ago.

This are the steps I needed to do to add esbuild to an application that used the vanilla rails asset...

Understanding Ruby's def keyword

Posted Over 2 years ago by Dominik Schöler.
stackoverflow.com

This StackOverflow question about nested function definitions in Ruby imparts a good understanding of Ruby's def.

Ensure passing Jasmine specs from your Ruby E2E tests

Posted Over 2 years ago by Henning Koch.

Jasmine is a great way to unit test your JavaScript components without writing an expensive end-to-end test for...

RSpec: automatic creation of VCR cassettes

Posted Over 2 years ago by Klaus Weidinger.

This RailsCast demonstrated a very convenient method to activate VCR for a spec by simply tagging it with :vcr.

Better numeric inputs in desktop browsers

Posted Over 2 years ago by Arne Hartherz.

You want to use fields in your applications. However, your desktop users may encounter some weird quirks: Aside from allowing...

Fix REPL of better_errors page

Posted Over 2 years ago.

The gem better_errors offers a detailed error page with an interactive REPL for better debugging. I had the issue...

Ruby: You can nest regular expressions

Posted Over 2 years ago by Henning Koch.

Ruby lets you re-use existing RegExp objects by interpolating it into new patterns: locales_pattern = /de|en|fr|es/i...

RSpec matcher to compare two HTML fragments

Posted Over 2 years ago by Henning Koch.

The RSpec matcher tests if two HTML fragments are equivalent. Equivalency means: Whitespace is ignored Types of attribute quotes are...

How to extract a Ruby gem

Posted Over 2 years ago by Emanuel.

The rubygems binary gem allows to extract a local gem with gem unpack GEMNAME. For more details see the official...

Heads up: Byebug has problems with zeitwerk

Posted Almost 3 years ago.

I encountered a unlucky behavior of byebug 11.1.3 (the most recent version at time of writing) when using it with...

Ruby: Fixing strings with invalid encoding and converting to UTF-8

Posted Almost 3 years ago by Arne Hartherz.

When dealing with external data sources, you may have to deal with improperly encoded strings. While you should prefer deciding...

Pre-releasing an npm package

Posted Almost 3 years ago by Henning Koch.

You can publish pre-release versions of an npm package. Naming convention for pre-release versions An npm package must...