Posted about 5 years ago. Visible to the public.

Hide a Rake task from the `rake -T` list

A Rake task appears in rake -T if it has a description:

Copy
desc 'Compile assets' task :compile do ... end

To not list it, simply omit the description:

Copy
task :compile do ... end

You can also hide a Rake task that has been defined by someone else (like a gem) by removing the description:

Copy
Rake::Task['compile'].clear_comments

Or you can whitelist which tasks should be listed:

Copy
visible_tasks = %w(compile build package) Rake::Task.tasks.each do |task| visible_tasks.include?(task.name) or task.clear_comments end

Does your version of Ruby on Rails still receive security updates?
Rails LTS provides security patches for old versions of Ruby on Rails (3.2 and 2.3).

Owner of this card:

Avatar
Henning Koch
Last edit:
about 5 years ago
by Henning Koch
Keywords:
afterwards, after, the, fact, hindsight
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Henning Koch to makandra dev
This website uses short-lived cookies to improve usability.
Accept or learn more