Changes to positional and keyword args in Ruby 3.0

Posted About 3 years ago by Tobias Kraze.
ruby-lang.org

Ruby 3.0 introduced a breaking change in how it treats keyword arguments. There is an excellent blog post on the...

Ruby: How to convert hex color codes to rgb or rgba

Posted About 3 years ago by Arne Hartherz.

When you have a hex color code, you can easily convert it into its RGB values using plain Ruby.

E-mail deliverability

Posted About 3 years ago by Tobias Kraze.

When your application is open for public sign up and sends out transactional e-mails to a large number of...

The Ruby Object Model

Posted About 3 years ago by Dominic Beger.

In Ruby (almost) everything is an Object. While this enables a lot of powerful features, this concept might be confusing...

makandra/capybara-lockstep

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

capybara-lockstep can help you with flaky end-to-end tests: This Ruby gem synchronizes Capybara commands with client-side...

Ruby: Generating and parsing JSON, or: understanding JSON::ParserError "unexpected token"

Posted About 3 years ago by Dominik Schöler.

json is part of the standard library of Ruby and deals with JSON, obviously. As you know, JSON is the...

Parsing JSON with edge cases

Posted About 3 years ago by Judith Roth.
labs.bishopfox.com

The linked article shows that there are unclear parts in the JSON specification and that different parsers treat them differently...

What is a reduction and why Fibers are the answer for Ruby concurrency | julik live

Posted About 3 years ago by Henning Koch.
live.julik.nl

The linked article provides a good overview of the various concurrency primitives in Ruby, and what's changing in Ruby...

How to list updateable dependencies with Bundler and Yarn

Posted About 3 years ago by Michael Leimstädtner.

bundle outdated [--filter-major|--filter-minor|--filter-patch] Example output for bundle outdated --filter-major Other examples

Some tips for upgrading Bootstrap from 3 to 4

Posted About 3 years ago by Florian Leinsinger.
getbootstrap.com

Recently I made an upgrade from Bootstrap 3 to Bootstrap 4 in a bigger project. Here are some tips how...

How to fix "Command "webpack" not found"

Posted About 3 years ago by Michael Leimstädtner.

I just ran into this deployment error after switching from the asset pipeline to webpack: 01:05 deploy:assets:precompile...

Git: Parsing large diffs as a human

Posted About 3 years ago by Michael Leimstädtner.

I just finished migrating a project from the Asset Pipeline to Webpacker, this is what my diff to master looks...

Ruby: How to load a file with a known encoding

Posted About 3 years ago by Emanuel.

In case Ruby does not detected the expected encoding of a file automatically you can specify the known encoding manually...

How to communicate between processes in Ruby with sockets

Posted About 3 years ago by Emanuel.

In Ruby you can communicate between processes with sockets. This might be helpful in tests that validate parallel executions or...

ExceptionNotification: Fix DNS lookup before plugins call external APIs

Posted About 3 years ago by Jakob Scholz.

The ExceptionNotification has plugins that talk to external APIs rather then just sends emails, like microsoft teams or slack. You...

Call original method when monkey patching

Posted About 3 years ago by Jakob Scholz.

Ruby offers monkey patching methods in order to change the behavior of a library if there's no better way...

Ruby: How to keep split delimiter (separate, or as part of substrings)

Posted Over 3 years ago by Arne Hartherz.

Ruby's String#split returns an array of substrings from the given string. Usually, this is missing the split characters...

Missing certificates for rubygems and bundler in Ruby 1.8.7

Posted Over 3 years ago by Emanuel.

Using Ruby 1.8.7 you will not be able to use the maximum versions Rubygems 1.8.30 and Bundler 1.17.3 with https://...

How to fix: Pasting in IRB 1.2+ is very slow

Posted Over 3 years ago by Arne Hartherz.

IRB 1.2 (shipped with Ruby 2.7, but works on 2.5+) brings pretty syntax highlighting and multiline cursor navigation. However, pasting...

Rails developers: Have better context in Git diffs

Posted Over 3 years ago by Dominik Schöler.
tekin.co.uk

Git diffs show the surrounding contexts for diff hunks. It does so by applying regular expressions to find the beginning...

Show/Hide Rubocop marking in RubyMine

Posted Over 3 years ago by Bruno Sedler.

If you have installed Rubocop in your project, RubyMine can show you Rubocop violations immediately in your editor. You probably...

Convert curl commands to ruby code

Posted Over 3 years ago by Jakob Scholz.

curl-to-ruby is a handy tool that converts your curl command to ruby code that uses the Net::HTTP...

Ruby: Comparing a string or regex with another string

Posted Over 3 years ago by Emanuel.

In Rubocop you might notice the cop Style/CaseEquality for e.g. this example: def foo(expected, actual) expected === actual end

Ruby: A short summary of available hooks in Cucumber

Posted Over 3 years ago by Emanuel.

Here is a short summary of Cucumber hooks in Ruby taken from https://github.com/cucumber/cucumber-ruby. Note that the BeforeStep is...