Systems | Development | Analytics | API | Testing

Ruby

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.

Ruby on Rails 7.1: Partial Strict Locals and Their Gotchas

Rails partials have been around for years, but they can be clunky since they're just ERB snippets without a backing object structure. Recently, libraries like ViewComponent and Phlex have tried to improve the view layer by adding more semantic structure to the templates. These are great libraries and I personally reach for ViewComponent on almost every project I work on. That said, I still feel the humble Rails partial still works great for many use cases.

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.

An Introduction to Nix for Ruby Developers

A predictable, stable environment (in terms of your operating system, system libraries, build tools, and programming libraries) is essential to each development step: from onboarding, to collaboration, continuous integration, quality assurance, and deployment. Deviation can cause one-off, intermittent, and even catastrophic failures. However, consistency can be elusive, even with the best intentions, best practices, and tools in place, because: Nix aims to solve some of these issues.

Debugging in Ruby with Debug

Debugging is a valuable skill for any software engineer to have. Unfortunately, most software engineers are not trained in it. And that's not just specific to developers going through boot camps; even in universities, we are not often taught and trained to use a debugger. My teachers and mentors were more interested in getting me to write programs rather than debugging them. If we are fortunate, debugging comes at the end of the semester, in a short, last session.

Parsing CSV files in Ruby

Handling data in various formats is a common task in software, and CSV (Comma-Separated Values) files are among the most prevalent data formats you'll encounter. Whether for data migration, reporting, or simply importing and exporting data, processing CSV files efficiently is a necessary skill for any Ruby developer. In this article, we'll learn the practical aspects of parsing and handling CSV data using Ruby.