Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 406 Bytes

rake.md

File metadata and controls

35 lines (27 loc) · 406 Bytes
title category layout
Rake
Ruby
2017/sheet

Basic syntax

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

desc "Do something"
task :workit, [:id] => :environment do |_, args|
  id = args[:id]
end

# rake workit[234]