Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get help on a specific rake task?

Is there a standard help command for individual rake tasks?

rake -h displays the options for rake.

rake -D describes the rake tasks.

rake mytask runs mytask.

Is there something like rake -h mytask that would describe mytask, and list its optional and/or required arguments?

For example, the following code will run an individual test in rails:

rake test TEST=path_to_test

How do I discover that TEST=path_to_test is an optional argument to rake test?

like image 777
user1385729 Avatar asked Mar 28 '13 05:03

user1385729


People also ask

How do you call a rake task?

Go to Websites & Domains and click Ruby. After gems installation you can try to run a Rake task by clicking Run rake task. In the opened dialog, you can provide some parameters and click OK - this will be equivalent to running the rake utility with the specified parameters in the command line.

How do I create a custom rake task?

You can create these custom rake tasks with the bin/rails generate task command. If your need to interact with your application models, perform database queries and so on, your task should depend on the environment task, which will load your application code.


1 Answers

The command rake -D test does not on my system. Instead you can use

# list test command with details
rake test -D 

# list all test tasks with description
rake test -T

# list all test tasks even without description(Recommened)
rake test -T -A
like image 181
Billy Chan Avatar answered Sep 22 '22 06:09

Billy Chan