avatar

Forwarding all arguments with Ruby 2.7

Ruby 2.7+ deprecates the ability to automatically translate between a hash and keyword arguments for the last argument in a method invocation. This will be removed in Ruby 3.0 due to some ambiguity in various cases. For a more in-depth rundown, you can check the writeup on ruby-lang.org. This post is more about a simple way to solve deprecation warnings of existing code if you are upgrading to Ruby 2.7.

Forwarding all arguments with Ruby 2.7

Ruby 2.7+ deprecates the ability to automatically translate between a hash and keyword arguments for the last argument in a method invocation. This will be removed in Ruby 3.0 due to some ambiguity in various cases. For a more in-depth rundown, you can check the writeup on ruby-lang.org. This post is more about a simple way to solve deprecation warnings of existing code if you are upgrading to Ruby 2.7.

Who Owns This Code

A previous project I worked on was to create an abstraction around various command-line invocations, the context here was automated testing on different platforms. The idea is pretty simple, rather than having to keep track of command-line flags and options, you just call this CLI and get a nice JSON formatted response. I knocked out a handful of commands, as did several other developers, and that's where things got interesting. Despite being both a young project and a simple one, discrepancies had already crept in.

GitArborist Four Month Update

GitArborist.com has now been live for four months. For previous info you can jump to the previous updates at three, two, and one months. June 2020 Stats First, the stats: Total Installations: 9 Scheduled PRs Merged: 16 PRs Merged: 36 (inc. scheduled) Repositories Watched: 1410 What's Changed GitArborist now collects user email during installation (with the required OAuth permission). This should make it easier to contact users with any announcements going forward, and also paves the way for paid plans.

Using Memoization to Speed up Ruby on Rails Applications

What is Memoization? When developing applications we often have methods that run slowly. Perhaps they need to query the database, or hit an external service, both of which can cause them to slow down. We could call the method every time we need that data and just accept the overhead, but if performance is a concern we have some options. For one, we can assign the data to a variable and re-use it, which would speed up the process.

Preparing a Heroku Application for Production

So you've been tinkering away at your side project web app and are now ready to launch it to the world. You fire up a Heroku account, push up the source code et voilĂ , you're on the internet. The thing is now you're running in “production” mode, so you're going to want to set up some infrastructure for your application. I'm going to be using Ruby on Rails here but the general ideas will be the same for virtually any web application on any framework.