November 3

0 comments

Using ‘rake stats’ and ‘rake about’ to get some basic information about a Ruby on Rails application.

By Christopher G Mendla

November 3, 2020


Last Updated on November 3, 2020 by Christopher G Mendla

The simple command, rake stats will show you how the lines of code are distributed in your Ruby on Rails application. ‘rake about’ will show you the ruby and rails versions, the database engine and some other helpful information.

If you are assigned a Ruby on Rails application, there are two simple commands that will give you some valuable information about the application. They are rake stats and rake about

Rake stats

There are times when you might want to find out how many lines of code are in your Rails application and how those lines are distributed.

Stats are invoked simply by issuing the rake stats command in the root of your project folder. The results will look something like the following:

In most applications there should probably be a higher percentage of code in the models compared with the controllers. In this particular application, database functionality hasn’t been implemented yet. 

You can also see how many lines of code are in the tests and a ratio of lines of code to test lines of code. The results in the last line indicate that there should be a lot more testing implemented in this application. 

rake about

The command ‘rake about’ will show some basic information about your application such as:

Most of the information can be requested individually with commands such as ruby -v for the ruby version and rails -v for the rails version. However, this gives you a quick overview with one command.

Summary

This is a quick an easy way to get some basic information about your Rails application. 

Christopher G Mendla

About the author

A web developer living in Southampton, PA

Self motivated critical thinker and problem solver providing technology consulting services.

Leave a Reply

Your email address will not be published. Required fields are marked

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}