We use CarrierWave in many of our projects to store and serve files of various formats - mostly images. A common...

tl;dr Don't forget require 'English' if you use a named global such as $LAST_MATCH_INFO. Otherwise this...

betterspecs.org

betterspecs.org is a documentation on how to write better RSpec tests. Note that there are also other approaches like The...

makandra dev
thoughtbot.com

One of the earliest pieces of wisdom we are given as programmers is to not write duplicate code: Don’t...

This seems to be obvious, but you can expect Rake tasks to be called in RSpec. it 'deletes all Users...

makandra dev

Using git fixup helps you to speed up appending changes further back in the git history of your feature branch...

In case you want to use pry with an older version of Ruby, you can try the following configurations.

Ruby and Rails have several methods for creating a new object that looks like another: clone, dup, deep_dup. When...

You can install rubygems 3.0.8 (released on February 18, 2020) to keep all the Gem::Specification#rubyforge_project deprecation warnings...

You can run bundle install in parallel. This might be helpful for development, where you often install many new gems...

When you have many changes, and you want to spread them across different commits, here is a way to stage...

github.com

The linked GitHub repository is a bit like our "dev" cards deck, but groomed from a single person (Josh Branchaud...

With puma you can have concurrent requests. There are two concepts on how Puma can handle two incoming requests: Workers...

Test-Driven Development (TDD) in its most dogmatic form (red-green-refactor in micro-iterations) can be tedious. It does...

Simplecov is a code coverage tool. This helps you to find out which parts of your application are not tested...

"Everything in Ruby is an object". This is also true for nested hashes and arrays. If you copy a hash...

A recent patch level Ruby update caused troubles to some of us as applications started to complain about incompatible gem...

Turns out, Cucumber::MultilineArgument::DataTable#diff! caches some stuff. Code of the following form will not work as intended:

Embedding videos on a website is very easy, add a tag to your source code and it just works...

github.com

Because colors improve readability so much. On Ubuntu 18.04 you can install it with sudo apt install grc

By default, Devise redirects to a sign-in form when accessing a route that requires authentication. If for some reason...

makandra dev

Code comments allow for adding human readable text right next to the code: notes for other developers, and for your...

developer.mozilla.org

Heads up: transparent is not a real color, but black with 0% opacity. In transparent gradients, this adds some gray...

In applications without a sign-up, user accounts are usually created by an admin. This imposes two challenges: