Open Source Updates: December 2020

Brief 2020 recap During 2020 due to the pandemic and new job role (software backend architect at Toptal) I had less time to dedicate to Open Source. Luckily enough, other amazing people took care of projects that I care about. Two people above all: Tim Riley for Hanami 2 and Tom Scott for redis-store. Let’s start with the easy one: I don’t actively maintain redis-store anymore, Tom is the main person behind it, but I’m immensely grateful that he’s devoted to the project, which after 12 years is very mature. »

Ruby Method Overloading

Method Overloading is a programming language feature that allows you to define multiple signatures (and implementations) of the same method. Ruby doesn’t have such a feature. It was a shocking discovery when I switched from Java.. a very long time ago. We can somehow trick the language using optional and keyword arguments. But how can we have real isolated implementations of the same method? I wrote a hack to make this possible based on method arity. »

Author image Luca Guidi on #ruby,

Hanami::API on Amazon AWS Lambda

The Hanami team & I, recently announced Hanami::API: a minimal, extremely fast, lightweight Ruby framework for HTTP APIs. Its minimalism, the small memory footprint and its performance, make Hanami::API a good candidate to build microservices. Today, we’re gonna deploy a small service on Amazon AWS Lambda. It’s an Amazon AWS product that allows to deploy an autoscaling HTTP service. You are charged for every 100ms your code executes and the number of times your code is triggered. »

Introducing hanami-cli

Introducing hanami-cli: a general purpose Command Line Interface (CLI) for Ruby. Learn why Hanami replaced thor in favor of hanami-cli and how to use it to build a CLI application in 5 minutes. Why not thor? For long time we used thor 🔨 to build the Command Line Interface (CLI) of Hanami. But as the time passed, we needed more control on the internals of our implementation. The Hanami 🌸 command line needs two crucial features: subcommands and extendibility. »

How To Test Ruby CLI: Console

One of the most interesting challenges I met during Hanami development is to write isolated integration tests. The framework ships with an extensive Command Line Interface (CLI) to generate (or destroy) code, start the server, open a Ruby (or a database) console, create/drop the database, run the migrations, precompile assets, and print informations. Console Hanami console is an interactive REPL based on IRB, which is useful to interact with the objects defined in a project. »