Rake (software)

from Wikipedia, the free encyclopedia
Basic data

developer Jim Weirich
Current  version 13.0.1
( November 12, 2019 )
operating system platform independent
programming language Ruby
category Programming tool
License MIT license

Rake (German: "rake" ) is a software - task management - and build management -tool which mainly programmers use in the programming language Ruby develop. Rake can be used to define tasks and describe dependencies. The tasks can be grouped in namespaces .

Rake is similar to SCons and make , but also has some crucial differences compared to them. The tool is written in Ruby and the rakefiles (equivalent to make Makefiles) use Ruby syntax. The original author was Jim Weirich (1956-2014).

Rake uses Ruby's anonymous function blocks to define various tasks, which enables the use of Ruby syntax. It has a library of frequently used tasks, for example functionality for typical file manipulation tasks and a library for tidying up compiled files (clean task). Similar to make, rake can also synthesize tasks on the basis of patterns, for example to generate a compilation task from patterns for filename extensions. Rake is now part of the standard scope of Ruby from version 1.9.


The following is a simple rakefile for building a HelloWorld program developed in the C programming language as an example:

  file 'hello.o' => ['hello.c'] do
    sh 'cc -c -o hello.o hello.c'
  file 'hello' => ['hello.o'] do
    sh 'cc -o hello hello.o'

The next example shows how to use it for a simple recipe:

namespace :cake do
  desc 'make pancakes'
  task :pancake => [:flour,:milk,:egg,:baking_powder] do
     puts "sizzle"
  task :butter do
    puts "cut 3 tablespoons of butter into tiny squares"
  task :flour => :butter do
    puts "use hands to knead butter squares into 1{{frac|1|2}} cup flour"
  task :milk do
    puts "add 1{{frac|1|4}} cup milk"
  task :egg do
   puts "add 1 egg"
  task :baking_powder do
   puts "add 3{{frac|1|2}} teaspoons baking powder"

See also

Web links

Individual evidence

  1. Release 13.0.1 . November 12, 2019 (accessed November 12, 2019).
  2. RAKE - Ruby Make. Accessed October 4, 2018 .
  3. Rak: Simple Example. Accessed October 4, 2018 .
  4. ^ Rake: Glossary. Accessed October 4, 2018 .