Created
February 28, 2012 09:30
-
-
Save ukitazume/1931523 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rake' | |
| task :create do | |
| p 'created' | |
| end | |
| task :create_all do | |
| Rake::Task['create'].invoke | |
| end | |
| task :create_by, :tool do |task, args| | |
| p "created by #{args[:tool]}" | |
| end | |
| task :create_by_select do | |
| Rake::Task['create_by'].invoke("paper") # 引数が順位渡る | |
| end | |
| task :create_by_all do | |
| [:knife, :pen].each do |tool| | |
| # executeの引数そのものがargs | |
| # Invoke the task if it is needed. Prerequites are invoked first. | |
| Rake::Task['create_by'].execute(:tool => tool) | |
| end | |
| end | |
| namespace :hitech do | |
| task :create_by, :tool do |task, args| | |
| p "created by #{args[:tool]}" | |
| end | |
| task :create_by_all do | |
| [:pc, :arduino].each do |tool| | |
| Rake::Task['hitech:create_by'].execute(:tool => tool) | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment