module Rake::DSL

def desc(description) # :doc:

:doc:

end
# ... run tests
task test: [:build] do
desc "Run the Unit Tests"
Example:

sentence) and rake -D (the entire description).
Descriptions are shown with rake -T (up to the first
Describes the next rake task. Duplicate descriptions are discarded.
def desc(description) # :doc:
  Rake.application.last_description = description
end

def directory(*args, &block) # :doc:

:doc:

directory "testdata/doc"
Example:

demand.
Declare a set of files tasks to create the given directories on
def directory(*args, &block) # :doc:
  args = args.flat_map { |arg| arg.is_a?(FileList) ? arg.to_a.flatten : arg }
  result = file_create(*args, &block)
  dir, _ = *Rake.application.resolve_args(args)
  dir = Rake.from_pathname(dir)
  Rake.each_dir_parent(dir) do |d|
    file_create d do |t|
      mkdir_p t.name unless File.exist?(t.name)
    end
  end
  result
end

def file(*args, &block) # :doc:

:doc:

end
end
end
end
outfile.puts line
while line = infile.gets
open("config.template") do |infile|
open("config.cfg", "w") do |outfile|
file "config.cfg" => ["config.template"] do
Example:

Declare a file task.
def file(*args, &block) # :doc:
  Rake::FileTask.define_task(*args, &block)
end

def file_create(*args, &block)

(Mainly used for the directory command).
Declare a file creation task.
def file_create(*args, &block)
  Rake::FileCreationTask.define_task(*args, &block)
end

def import(*fns) # :doc:

:doc:

import ".depend", "my_rules"
Example:

See also the --rakelibdir command line option.

containing dependency declarations.
A common use of the import statement is to include files

importing file.
allowing the imported files to depend on objects defined in the
import statement to appear anywhere in the importing file, and yet
_after_ the current file is completely loaded. This allows the
Import the partial Rakefiles +fn+. Imported files are loaded
def import(*fns) # :doc:
  fns.each do |fn|
    Rake.application.add_import(fn)
  end
end

def multitask(*args, &block) # :doc:

:doc:

multitask deploy: %w[deploy_gem deploy_rdoc]
Example:

about it)
will execute in any given order (which is obvious when you think
parallel. Multitasks does *not* guarantee that its prerequisites
Declare a task that performs its prerequisites in
def multitask(*args, &block) # :doc:
  Rake::MultiTask.define_task(*args, &block)
end

def namespace(name=nil, &block) # :doc:

:doc:

end
# ...
task "nested:test" do

name:
Tasks can also be defined in a namespace by using a ":" in the task

task_run = ns[:run] # find :run in the given namespace.
end
task :run
# the "nested:run" task
ns = namespace "nested" do

Example:

tasks defined in the namespace.
block. Returns a NameSpace object that can be used to lookup
Create a new rake namespace and use it for evaluating the given
def namespace(name=nil, &block) # :doc:
  name = name.to_s if name.kind_of?(Symbol)
  name = name.to_str if name.respond_to?(:to_str)
  unless name.kind_of?(String) || name.nil?
    raise ArgumentError, "Expected a String or Symbol for a namespace name"
  end
  Rake.application.in_namespace(name, &block)
end

def rule(*args, &block) # :doc:

:doc:

end
sh 'cc', '-c', '-o', t.name, t.source
rule '.o' => '.c' do |t|
Example:

Declare a rule for auto-tasks.
def rule(*args, &block) # :doc:
  Rake::Task.create_rule(*args, &block)
end

def task(*args, &block) # :doc:

:doc:

$ rake package[1.2.3]

To invoke this task from the command line:

end
# ...
task :package, [:version] => :test do |t, args|

A task with an argument and a dependency:

end
rm_rf "html"
task clobber: %w[clean] do

A task with a single dependency:

strings.
The task, argument and dependency names may be either symbols or

the arguments provided to the task.
The +argument+ (a single name) or +arguments+ (an Array of names) define
The +dependencies+ may be a single task name or an Array of task names.

the task name contains a ":" it is defined in that namespace.
Declare a basic task. The +task_name+ is always the first argument. If

task(task_name, arguments => dependencies)
task(task_name: dependencies)
task(task_name)
:call-seq:
def task(*args, &block) # :doc:
  Rake::Task.define_task(*args, &block)
end