Rake is an important part of the Ruby ecosystem. It clocks in at just over 93 million downloads on RubyGems, making it the number one most downloaded gem at the time of writing. Moreover, the Ruby community has worked together to build it—over 100 people have contributed to the project. When using Rake in a project, it is common to list rake tasks. In my experience, the typical way to do this is to use rake -T. This is the abbreviated version of the command rake --tasks. However, this is not always the right tool for the job.
Some rake tasks have long descriptions, and rake -T truncates task descriptions based on the width of the terminal window. This gives the output a clean look by avoiding line wrapping. However, if a project has tasks with long descriptions, a task’s full description is not visible using rake -T. There is a way around this. The rake -D command lists rake tasks with their full description. This is the abbreviated version of the command rake --describe. The output of this command is a formatted list of available rake tasks with their full descriptions.
At SpinDance, our Rails projects often have many custom rake tasks in addition to the standard rake tasks that come baked-in with Rails. As a part of my work, I frequently need to run rake tasks….