Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><a href="http://en.wikipedia.org/wiki/Rake_(software)" rel="nofollow noreferrer">Rake</a> uses Rakefiles (cf. Makefiles) defined in pure Ruby, the build utility created by the late <strong>Jim Weirich</strong>. Rule patterns to synthesize implicit tasks are supported and developers can easily specify pre- and post-task dependency chains. Rake includes a library of pre-packaged tasks to make creating Rakefiles easier.</p> <p>Rake uses Ruby's anonymous function blocks to define various tasks, allowing the use of 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 onward.</p> <h3>Sample Rake file</h3> <pre><code> namespace :pick do desc "Pick a random user as the winner" task :winner =&gt; :environment do puts "Winner: #{pick(User).name}" end desc "Pick a random product as the prize" task :prize =&gt; :environment do puts "Prize: #{pick(Product).name}" end desc "Pick a random prize and winner" task :all =&gt; [:prize, :winner] def pick(model_class) model_class.find(:first, :order =&gt; 'RAND()') end end </code></pre> <h3>Useful links</h3> <ul> <li><a href="https://ruby.github.io/rake/" rel="nofollow noreferrer">Official Rake documentation</a></li> <li><a href="http://lukaszwrobel.pl/blog/rake-tutorial" rel="nofollow noreferrer">Lukasz Wrobel's Rake tutorial</a></li> <li><a href="http://jasonseifer.com/2010/04/06/rake-tutorial" rel="nofollow noreferrer">Jason Seifer's Rake tutorial</a></li> <li><a href="https://github.com/ruby/rake" rel="nofollow noreferrer">Github Link for Rake</a></li> </ul> <h3>Implementation specific tags</h3> <p>You can specify your question by adding the implementation you used as a tag.</p> <ul> <li><a href="/questions/tagged/rake-task" class="post-tag" title="show questions tagged &#39;rake-task&#39;" rel="tag">rake-task</a></li> <li><a href="/questions/tagged/rakefile" class="post-tag" title="show questions tagged &#39;rakefile&#39;" rel="tag">rakefile</a></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload