Rake (software)
| This article does not cite any references or sources. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed. (September 2010) |
|
|
The topic of this article may not meet Wikipedia's general notability guideline. Please help to establish notability by adding reliable, secondary sources about the topic. If notability cannot be established, the article is likely to be merged, redirected, or deleted. (September 2010) |
| Developer(s) | Jim Weirich |
|---|---|
| Stable release | 0.8.7 / May 15, 2009 |
| Written in | Ruby |
| Operating system | Cross-platform |
| Type | Software development tools |
| License | MIT License |
| Website | http://rake.rubyforge.org/ |
Rake is a software task management tool. It allows you to specify tasks and describe dependencies as well as to group tasks in a namespace.
It is similar to SCons and make, but has a number of differences. The tool is written in the Ruby programming language, and the Rakefiles (equivalent of Makefiles in make) use Ruby syntax. It was originated by Jim Weirich.
Rake uses Ruby's anonymous function blocks to define various tasks, allowing the use of the Ruby syntax. It has a library of common tasks: for example, functions to do common file-manipulation tasks and a library to remove compiled files (the "clean" task). Like Make, Rake can also synthesize tasks based on patterns (for example, automatically building a file compilation task based on filename patterns). Rake is now part of the standard library from Ruby version 1.9.
[edit] Example
Below is an example of a simple Rake script to build a C HelloWorld program.
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
Below is an example of a simple Rake 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
[edit] See also
[edit] External links
- (English) Rake documentation
- (English) RubyForge project page for Rake
- (English) Using the Rake build language by Martin Fowler
- (English) Ruby on Rails Rake tutorial at railsenvy.com
- (English) Custom Rake Tasks at railscasts.com
- (English) Rake Tutorial at lukaszwrobel.pl
|
|||||||||||||||||||||||