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. »

How To Test Ruby CLI: Code Generators

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. Code Generators Code generators is a helpful feature that allows to generate code files. The main purpose is to speedup the development process. »