Systems | Development | Analytics | API | Testing

Understanding the insertion sort algorithm in Ruby

As we explore different methodologies for sorting data, we turn to the insertion sort algorithm. There are a number of reasons to like insertion sort! First, insertion sort is stable, which means that it does not change the relative order of elements with equal keys. It's also an in-place algorithm, meaning that it does not create a new array to store the sorted elements. Finally, insertion sort is a pretty simple algorithm to implement, as you'll soon see!

Comparing Go vs Ruby

Ruby and Rails are great tools that allow you to create complex web applications quickly. Well, some kinds of complex web applications. While they excel at traditional, monolithic, server-rendered applications, they fail to excel at delivering real-time or distributed services. This is why it's so handy for Rubyists to learn a programming language like Go. Go is designed to write lightweight services that handle lots of inbound connections.

What's new in Ruby 3.4

According to Ruby tradition, the core team will release Ruby 3.4 on December 25—but the preview has been out since May! If you're anticipating the release like we are, you're probably wondering what's new in Ruby 3.4. There aren't any huge changes in this release, but you'll want to be aware of a few really cool things. Let's dig into some of the language changes first.

Server-sent Events and WebSockets in Rack for Ruby

In the previous part of this series, we discovered how to create persistent connections in Rack in theory, but now we'll put what we learned into practice. The web has two formalized specifications for communication over a persistent connection: server-sent events (SSEs) and WebSockets. WebSockets are widely used and highly popular, but SSEs are far less well-known. Let's explore them first.

The Basics of Rack for Ruby

Rack is the foundation for every popular Ruby web framework in existence. It standardizes an interface between a Ruby application and a web server. This mechanism allows us to pair any Rack-compliant web server (such as Puma, Unicorn, or Falcon) with any Rack-compliant web framework (like Rails, Sinatra, Roda, or Hanami). Separating the concerns like this is immensely powerful and provides a lot of flexibility. It does, however, also come with limitations.

The ultimate guide to Sidekiq scheduled jobs

Sidekiq is one of the most popular open-source background job libraries for Ruby. As one of ActiveJob's most popular backends, it's often used to run asynchronous jobs in Rails applications. It leans on Redis to manage queues and jobs, which makes it fast. Developers can run background jobs using Sidekiq with or without ActiveJob, and we'll explore both in this article. Just as useful - Sidekiq scheduled jobs allow you to run a job after a given amount of time or at a given time.

A practical guide to web scraping with Ruby

One of the benefits of Ruby's developer-friendly syntax is that it's straightforward to quickly build scripts to automate tasks. Web scraping with Ruby is fun, useful, and straightforward. In this article, we'll explore using HTTParty to pull a web page and check it for a given string. To be specific, we'll build a cron job in Ruby to check if a product is in stock on a website!

Ruby's hidden gems: Sorbet

The debate between static and dynamically typed languages has long been a subject of contention among developers. Each approach offers its own set of advantages and disadvantages, significantly influencing the software development process. Dynamically typed languages like Ruby provide flexibility by allowing variables to be declared without corresponding types. This approach fosters rapid development and promotes an agile process.

How to Use Azure Blob Storage with Ruby on Rails

Azure Blob Storage is an object storage service that is very similar to AWS S3. ActiveStorage from Rails has built-in support for both ActiveStorage and S3 for file storage, making it easy to integrate and even swap out providers. The Honeybadger Blog has already explored using S3 for file storage in Rails, and in this article, we'll explore using Azure to allow users to upload files in a Rails application. You can find the final code here on Github.