1
0
mirror of https://github.com/onkelbeh/cheatsheets.git synced 2026-08-15 13:34:53 +02:00

Add Rake.

This commit is contained in:
Rico Sta. Cruz
2014-09-29 16:32:14 +08:00
parent 038f8d893a
commit cbf1fc501e

34
rake.md Normal file
View File

@@ -0,0 +1,34 @@
---
title: Rake
layout: default
---
### Basic syntax
```rb
namespace :foo do
desc "Description"
task :bar do
...
end
task :baz => :dependency do
end
task :baz => [:dep1, :dep2, dep3] do
end
end
# rake foo:bar
```
### Rake task with arguments
```rb
desc "Do something"
task :workit, [:id] => :environment do |_, args|
id = args[:id]
end
# rake workit[234]
```