Home » Ruby

Ruby

Ruby on Rails Developer Series: Power of Strong APIs using JSON and Postgres Database

Welcome to the second of four Ruby on Rails Developer Series. In this series, the goal is to outline how to strengthen your API with Postgres, how to dockerize your project and add security layers to mitigate attacks to your application. In this article, we’ll cycle through strengthening our API-based application that uses the JSON API from Active Model Serializer. ...

Read More »

Ruby on Rails Developer Series: Spinning Up a JSON API in Minutes

Welcome to the first of four Ruby on Rails Developer Series. In this series, the goal is to outline how to strengthen your API with Postgres, how to dockerize your project and add security layers to mitigate attacks to your application. In this article, we’ll cycle through building a quick API-only application uses the JSON API from Active Model Serializer. ...

Read More »

SyncEm: Thread-Safe Decorators in Ruby

I wrote some time ago about thread-safety in OOP and how it can be achieved with decorators. It was also said that it’s very important to make sure objects are thread-safe (in Ruby and in Java), especially in web apps, which are multi-threaded (well, in most cases anyway). Well, here is SyncEm, a primitive Ruby gem which makes the above ...

Read More »

Optimize CI Using a Strong Testing Suite with Ruby on Rails

When it comes to testing suites, it’s imperative to have a strong suite with all the tools to make your teams life easier. Once your team has a strong testing suite, automating the suite with continuous integration (CI) will bring less defects in your production environments. Currently, the industry has some best practices for testing: BDD, TDD, etc. – although ...

Read More »

Zache: A Simple Ruby In-Memory Cache

A month ago I stumbled upon a problem: I wasn’t able to find a Ruby gem which would do in-memory caching with the capability to expire on timeout. After some quick research I decided to implement my own and called it Zache (as in “zero cache,” since there is no back end). Here is how it works: First, you create ...

Read More »

How to Use Ruby on Rails for Local SMTP Email Testing

When it comes to testing email templates for production; I think it is fair to say testing is key. Action Mailer is one of the most recognized frameworks for sending out emails. With Action Mailer you can send out emails through different providers easily, preview templates, and so forth. (Although from my work experience, I have always found it extremely ...

Read More »

Do You Test Ruby Code for Thread Safety?

Are you a Ruby developer? If you are, I’m pretty sure you have a very vague idea of what concurrency and thread safety are. No offense, but this is what I’ve figured out after dealing with Ruby code and speaking with Ruby programmers over the last half a year. I’ve been writing in Ruby pretty actively recently and I do ...

Read More »