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.