All Articles

Code Coverage Metrics for Ruby on Rails

At FastRuby.io we are constantly looking at code coverage metrics for Ruby on Rails applications. It’s a key indicator for us. We even use that information to decide whether we work on a Rails upgrade project or not opens a new window .

So, I was interested in seeing code coverage metrics for the Ruby on Rails framework opens a new window . I couldn’t find any information about this online, so I decided to generate a few reports for each component.

This is an article about my process and my findings.

Read more of Code Coverage Metrics for Ruby on Rails opens a new window

Is Your Test Suite Ready for a Rails Upgrade?

Having a clear idea of how much test coverage your Rails application has is really important. Especially if you are planning to upgrade to a newer version of Rails. A good test suite will tell you if your application is working as it did before the upgrade.

At FastRuby.io opens a new window , we recommend having at least 80% of your application covered before attempting to upgrade. A number lower than that would require you to make a lot more manual testing to ensure that the application is properly working after the upgrade. If your application doesn’t meet that number, we suggest to first spend some time improving the test suite before starting the upgrade.

In this article, I’ll show you how you can measure your test coverage using SimpleCov opens a new window .

A quick note before starting: SimpleCov doesn’t work in projects with Ruby 1.8.7 or lower. If that’s your case, you can try rcov opens a new window .

Read more of Is Your Test Suite Ready for a Rails Upgrade? opens a new window

OmbuLabs Open Source Guidelines

Contributing to open source projects is a big part of our philosophy at OmbuLabs opens a new window . It’s even written into our values opens a new window . Some of us like to contribute to open source even in our spare time!

Recently we have been thinking about what guidelines we should follow when starting a new open source project, and also about how to organize and keep track of the ones we contribute to.

This article will give you some tips on keeping those open source projects organized, and also how to start them off on the right foot.

Read more of OmbuLabs Open Source Guidelines opens a new window

Upgrading a Large Rails App From 5.0 to 5.1

We recently collaborated with Procore opens a new window on a Rails upgrade opens a new window for their Rails application which allows teams in the construction industry to connect their entire business process.

We spoke with Andy Maltun, Procore’s VP of Software Engineering, about the work performed to help them upgrade their app to version 5.1. According to Maltun, Procore’s R&D department is large and complex. While Procore opens a new window previously had handled their Rails upgrades internally, with so many teams working on the application, it caused a lot of disruption as each team would handle only part of the upgrade. Therefore, Maltun “wanted to take a different approach this time in an effort to centralize the update and minimize the project management overhead and disruption of teams.”

Read more of Upgrading a Large Rails App From 5.0 to 5.1 opens a new window

Two Commonly Used Rails Upgrade Strategies

Rails upgrades can be done in many different ways. Depending on the application that you want to upgrade, some ways make more sense than others. There are factors that determine which Rails upgrade strategy is the best for your case, like how big your application is, or how frequently changes are pushed to the master branch. In this article I’ll be covering two common Rails Upgrade strategies so you can decide which one is the best for your application.

Read more of Two Commonly Used Rails Upgrade Strategies opens a new window

Migrating From Capybara Webkit to Webdrivers

We all know testing is important. We have our unit tests and integration tests to make sure everything is working as expected. At OmbuLabs opens a new window , we use Capybara opens a new window for our integration tests so that we can interact with the app as a real user would.

This is the process we used to replace the capybara-webkit gem in a legacy project with a more modern approach that uses the webdrivers opens a new window gem and a headless browser.

Read more of Migrating From Capybara Webkit to Webdrivers opens a new window

Churn vs. Complexity vs. Code Coverage

Churn vs. Complexity analysis is a great way to find insights about the maintainability of a project. Two of my favorite authors have written great articles about the Churn vs. Complexity graph:

This two-dimensional graph can be very useful in finding the files that are the hardest to maintain in your application. In this article I will explain:

  1. How you can calculate these metrics and use them in your legacy project
  2. How code coverage metrics can guide your technical debt’s collection efforts
Read more of Churn vs. Complexity vs. Code Coverage opens a new window

The Complete Guide to Rails Deprecations

Deprecation warnings are a common thing in our industry. They are warnings that notify us that a specific feature (e.g. a method) will be removed soon (usually in the next minor or major opens a new window version) and should be replaced with something else. Features are deprecated rather than immediately removed, in order to provide backward compatibility (a solution that works in both the current and the future version), and to give programmers time to implement the code in a way that follows the new standard.

In this guide we’ll show you what the workflow is that we use at FastRuby.io opens a new window to address deprecation warnings when we upgrade Rails applications opens a new window .

Read more of The Complete Guide to Rails Deprecations opens a new window

Our Rails Upgrade Process Explained

We know that there are many challenges involved in a Rails upgrade project. Depending on how big your application is, how old your Rails version is and how well structured your code is, it can be difficult to perform that job and keep your sanity. If you don’t find a reliable and trustable process to guide you from version X to version Y, you can end-up in a nightmare.

The good news is that here at OmbuLabs opens a new window , we have been upgrading Rails applications for over 10 years now and this gave us a know-how to define a process that has proven to be very effective. And today I want to share Our Rails Upgrade Process with you.

Read more of Our Rails Upgrade Process Explained opens a new window

Guide for Unmaintained Open Source Projects

There are some really great guides for starting a new open source projects opens a new window , yet when it comes to dealing with a possibly abandoned, unmaintained project, there is no definitive guide for users, contributors, or maintainers.

I hope that this can be a useful guide for our community.

Problem

When do you declare that an open source project has been abandoned? How many days have to go by until you start maintaining your own fork? What’s the standard for communicating with maintainers, contributors, and users? How do you avoid n competing OSS forks of popular projects? How do you avoid duplicated work by people who want to maintain popular, but unmaintained OSS projects? What’s the best way to find that one fork everybody is using?

Read more of Guide for Unmaintained Open Source Projects opens a new window

Calculate Tech Debt Using Skunk on GitHub

Right before my talk at RubyConf Australia opens a new window , I worked on a way to make it easy for anyone to run skunk opens a new window in their Ruby projects. In order to do that I decided to use GitHub Actions opens a new window . It’s a powerful service by GitHub and it’s quite easy to set up.

This article is about the process that I followed and how you can use it in your own application.

Read more of Calculate Tech Debt Using Skunk on GitHub opens a new window

Gemifying Your Style Guide to DRY Your CSS

At OmbuLabs we like to follow a style guide to drive our own products. A style guide is a document that provides guidelines for the way your brand should be presented from both a graphic and language perspective. You can see FastRuby.io’s style guide at this link opens a new window .

Since we have a few applications in place and it’s important to make sure that they all use the same style, we need to ensure that they will all inherit the same CSS files. One way to do this is to copy the above style guide and paste it inside all of our apps, but this would end up causing a lot of duplicated code. If we decided to change the font-style, for example, we would need to change it in all apps individually.

Something else we are super fans of at OmbuLabs is to follow good code and development practices. One of our favorites is the DRY (Don’t Repeat Yourself) opens a new window principle, which states that duplication in logic should be eliminated via abstraction. So to avoid the duplicated code here, we decided to create a gem to encapsulate our style guide and to be bundled in all of our products.

In this article, I’ll show you how we did it!

Read more of Gemifying Your Style Guide to DRY Your CSS opens a new window

Why You Should Upgrade Your Rails App

Technology evolves quickly. When you first created your Rails application, it’s likely you did it using the latest version of Rails opens a new window . As time passes, however, new Rails opens a new window versions come out and your application becomes more and more out of touch with the latest version. But why is this important? Why does it matter?

There are several different reasons to upgrade your Rails application opens a new window . In this article, I’ll list what we consider to be the most important ones.

Read more of Why You Should Upgrade Your Rails App opens a new window

Escaping the Tar Pit: Skunk v0.3.2 at RubyConf

This year I had the honor to speak at RubyConf opens a new window in Nashville. It was my second time attending the conference and first time as a speaker. I talked about skunk, a gem to calculate the SkunkScore opens a new window of a module or set of modules.

Since its inception, skunk has changed quite a bit based on real usage in our productized service for Rails upgrades opens a new window . As a matter of fact, the night before my talk I realized there was a BIG error in our formula.

Here is a description of the problem and solution.

Read more of Escaping the Tar Pit: Skunk v0.3.2 at RubyConf opens a new window