Design patterns can help to simplify your codebase so you don't need to reinvent the wheel. In this post, we'll go into how to use Draper. But first, we will start with an overview of the decorator pattern and how to use it with Ruby's standard library. Let's get started!
So far in this series, we have been exploring the capabilities of SQLite for classic HTTP request/response type usage. In this post, we will push the boundary further by also using SQLite as a Pub/Sub adapter for ActionCable, i.e., WebSockets. This is no small feat: WebSocket adapters need to handle thousands of concurrent connections performantly.
When working with money in an application, ensuring everything is accounted for is important. In this post, we will explore some common methods and best practices of handling money in your Ruby app, and see how you can use money-rails to write maintainable money-handling code. Let's get started!
Hello there! My name is Maciej Mensfeld, and some of you might recognize me from my involvement in RubyGems Security, OSS commitments, or perhaps from Karafka: a multi-threaded, efficient Kafka processing framework tailored for Ruby and Rails. While I generally pen my thoughts on my personal blog, today's post is unique. This article results from a collaborative effort with the brilliant people over at AppSignal. To set the record straight, I don't work for AppSignal.
In parts one and two of this series, we only dealt with the pure CRUD aspects of using SQLite as a production database. In this post, we will explore the world of queue mechanisms, using SQLite as the pub/sub adapter for ActiveJob. Let's make use of LiteJob to handle incoming webhooks in our Rails application.
Most websites are built with high-level languages like Ruby. Developers can always optimize their code for improved performance. Yet, even with top-notch optimization practices, what if your website still lags? How could WASM help improve the performance (time and speed) of your Ruby apps? Web Assembly is a technology that allows developers to compile code written in languages other than Javascript and run it on the web browser.
Ruby is an expressive language. This is no accident; Matz very consciously designed Ruby as an intuitive language to more or less read like English. It's safe to say that he succeeded. Methods are named very carefully, and do what they say they do; they also tend to have inverse methods which do the opposite. In this post, we'll look at why expressive code is important and its impact on your productivity as a developer. Then, we'll explore how to best use some of Ruby's methods. Let's get started!
Exceptions are a commonly used feature in the Ruby programming language. The Ruby standard library defines about 30 different subclasses of exceptions, some of which have their own subclasses. The exception mechanism in Ruby is very powerful but often misused. This article will discuss the use of exceptions and show some examples of how to deal with them.
Sinatra is a Ruby web framework that lets you build apps with less code. It has an expressive syntax and is less complex than other frameworks like Rails. In this article, we’ll use Sinatra to make a URL shortening app and learn how to use this powerful tool.