method
task
![Moderate documentation Importance_2](https://d2vfyqvduarcvs.cloudfront.net/images/importance_2.png?1349367920)
Ruby latest stable (v2_5_5)
-
0 notes -
Class: DSL
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9 (34)
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
task(*args, &block)
private
Declare a basic task. The task_name is always the first argument. If the task name contains a “:” it is defined in that namespace.
The dependencies may be a single task name or an Array of task names. The argument (a single name) or arguments (an Array of names) define the arguments provided to the task.
The task, argument and dependency names may be either symbols or strings.
A task with a single dependency:
task clobber: %w[clean] do rm_rf "html" end
A task with an argument and a dependency:
task :package, [:version] => :test do |t, args| # ... end
To invoke this task from the command line:
$ rake package[1.2.3]
Alternate definition:
task :package, :version, needs: :test do |t, args| # ... end