Skip to content

Instantly share code, notes, and snippets.

@stoplion
Created January 3, 2013 14:45
Show Gist options
  • Save stoplion/4443958 to your computer and use it in GitHub Desktop.
Save stoplion/4443958 to your computer and use it in GitHub Desktop.
rake notes
=begin Basic Notes
a part of the standrd Ruby lib
Rake looks for Rakefile in dir
or *.rake
Globally available Rake
~/.rake dir
rake -g -T
# all global rake tasks..
RUN IT
rake task_name
rake
# this runs :default task if there is one..
=end
=begin Writing Tasks
desc "description of default task"
task :default do
puts "this is the default task"
end
rake -T
#rake default # my default task description
DEPENDENCIY MANAGEMENT
task :default => ['another_task'] do
puts "this is the default task"
end
RAKE first run :another_task then :default
=end
=begin
RUN A TASK INSIDE ANOTHER TASK..
desc "Example of task with invoke"
task :first_task do
Rake::Task[:second_task].invoke
end
=end
=begin
file 'my_doc.pdf' => ['my_doc.xml', 'my_doc.xslt'] do
...
end
=end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment