In Ruby, you have a choice: define classes or modules either inline or nested within another module. While both approaches achieve similar results, there are key functional differences to consider, making nesting the preferred approach. The Subtle Distinction in Referencing Let’s look at an example using User and Admin::User classes: module Admin class Nested #…
An easy way to have a local “Github Copilot” for free
I tried copilot some time ago and it wasn’t really good with Ruby, so I abandoned it, and I wanted to try it again, but didn’t want to pay for it so I simply gave up. Then I found out about this amazing plugin for VSCode that does most of what copilot does, the plugin…
SPA without touching Javascript – The magic of Ruby on rails and Hotwire
It’s been a while since I wrote the last post here, so I decided to write something fun and maybe a good sample for anyone that is learning rails or is a little outdated. The idea here is to write a simple CRUD from scratch, I’ll use a Grid layout to keep everything in the…
I see Dead Jobs everywhere (sidekiq DeadSet)
When you are using Sidekiq to handle asynchronous jobs, some times there are exceptions and jobs failing, and I say sometimes because your environment is probably perfect, there is no lag, all services your jobs depend on are always on and responsive, and you probably write better code than most other developers 😛 otherwise it…
Quick tips that help: rails notes
This is actually not new, the command is there for a long time, but it is one of those things that help and you keep forgetting about. It works by searching your code for comments with specific keywords, the default is searching for FIXME, OPTIMIZE and TODO. You can add more tags either by using…
Ruby 3.2.0 released with WASI, YJIT, RegExp improvements, …
Last 25 of December while we were all celebrating with our families the Ruby core team released our Christmas gift. The release 3.2.0 of Ruby is faster and brought some amazing tools for us. WebAssembly support Ruby 3.2.0 added initial support for WebAssembly through WASI, this allows running CRuby in a web browser, for example…
Rubyconf Thailand quick summary and slides
Early this December happened the second edition of one of the best ruby conferences I’ve participated up to now! The Bangkok.rb team did an amazing job of organizing 4 amazing keynote speakers and a total of 19 speakers and attendees from over 20 diferent countries. The organization team did an amazing job of receiving the…
Testing download contents with Cucumber+Capybara and chromedriver
Working on a project these days where I work with Cucumber and Capybara, I had to test the contents of filed downloaded from the application, the downloads were being sent using “send_file” and chrome was adding them directly to the user Downloads folder, and the capybara tests had no access to the file contents after…
When Kubernetes is not the right choice?
As with anything in the technology field, there is no one size fits all solution… And even kubernetes solving a big amount of problems you might have when exposing and scaling your application, it also brings some problems that you need to weight before deciding if this is the right technology for you or not….
Rails from “zero” to kubernetes – ingress reverse proxy
Following up on the ‘Rails from “zero” to kubernetes’ series, we’ll see today how to expose your service to the internet, since I think we all agree that mapping directly the port of your rails app to the internet is not a really wise choice.
Kubernetes has a “simple but works” solution called ingress, ingress is an HTTP proxy, it will work as a reverse proxy for HTTP and HTTPS for any service that exposes one one port.