rake

用途

更新git submodules

task :tast_name => :depended_task do
    #do something
    `git`
    puts "abc"
end

安裝

curl -ssl https:/gget.rvm.io | bash -a stable
source ~/.rvm/scripts/rvm

rvm install 2.1 # install ruby
rvm use 2.1 -default

gem install rake

預設task

task : default => a_task

Task description

Namespace

Invoking

Example

#早上
# 做夢
# 醒來
# 下床
# 刷牙
#晚上
# 洗澡
# 刷牙
# 上床
# 睡覺
#白日夢(預設)

task :default => :day_dream

namespace :morning do

    namespace :demo do

        desc 'test'
        task :tt do
            `clear`
        end

    end

    desc '白日夢'
    task :dream do
        puts "白日夢"
    end

    task :awake => :dream do
        puts "wake up"
    end

    task :get_off => :awake do
        puts "起床"
    end

#    task :brush_teeth => bath do
#        Rake::Task['moring:brush_teeth'].invoke
#    end
end

desc '做白日夢'
task :day_dream do
    puts "白日夢"
end