- Rake Task Management Essentials
- Andrey Koleshko
- 322字
- 2021-07-16 12:01:41
The command-line arguments
The most commonly used rake command-line argument is -T
. It shows us a list of available rake tasks that you have already defined.
We have defined the default
rake task, and if we try to show the list of all rake tasks, it should be there. However, take a look at what happens in real life using the following command:
$ rake -T
The list is empty. Why? The answer lies within Rake. Run the rake
command with the -h
option to get the whole list of arguments. Pay attention to the description of the -T
option, as shown in the following command-line output:
-T, --tasks [PATTERN] Display the tasks (matching optional PATTERN) with descriptions, then exit.
Note
You can get more information on Rake in the repository at the following GitHub link at https://github.com/jimweirich/rake.
The word description
is the cornerstone here. It's a new term that we should know. Additionally, there is also an optional description to name a rake task. However, it's recommended that you define it because you won't see the list of all the defined rake tasks that we've already seen. It will be inconvenient for you to read your Rakefile
every time you try to run some rake task. Just accept it as a rule: always leave a description for the defined rake tasks.
Now, add a description to your rake tasks with the desc
method call, as shown in the following lines of code:
desc "Says 'Hello, Rake'" task :default do puts 'Hello, Rake.' end
As you see, it's rather easy. Run the rake -T
command again and you will see an output as shown:
$ rake -T
rake default # Says 'Hello, Rake'
- Web應用系統(tǒng)開發(fā)實踐(C#)
- Mobile Application Development:JavaScript Frameworks
- Visual C++串口通信開發(fā)入門與編程實踐
- 軟件項目管理(第2版)
- Python入門很簡單
- 編程卓越之道(卷3):軟件工程化
- Visual FoxPro 程序設計
- RTC程序設計:實時音視頻權(quán)威指南
- C語言程序設計立體化案例教程
- GameMaker Programming By Example
- 用Python實現(xiàn)深度學習框架
- PhoneGap:Beginner's Guide(Third Edition)
- Java EE企業(yè)級應用開發(fā)教程(Spring+Spring MVC+MyBatis)
- Hands-On Kubernetes on Windows
- Python Linux系統(tǒng)管理與自動化運維