Rake (software)

from Wikipedia, the free encyclopedia
Rake
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
github.com/ruby/rake

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.

Examples

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'
  end
  file 'hello' => ['hello.o'] do
    sh 'cc -o hello hello.o'
  end

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"
  end
  task :butter do
    puts "cut 3 tablespoons of butter into tiny squares"
  end
  task :flour => :butter do
    puts "use hands to knead butter squares into 1{{frac|1|2}} cup flour"
  end
  task :milk do
    puts "add 1{{frac|1|4}} cup milk"
  end
  task :egg do
   puts "add 1 egg"
  end
  task :baking_powder do
   puts "add 3{{frac|1|2}} teaspoons baking powder"
  end
end

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 .