diff options
author | Ryan Bigg <radarlistener@gmail.com> | 2008-11-18 10:40:50 +1030 |
---|---|---|
committer | Ryan Bigg <radarlistener@gmail.com> | 2008-11-18 10:40:50 +1030 |
commit | 9dbb52d97e4ecc97fe793e3ac04a4fd285aa003b (patch) | |
tree | a88985f50190dad0f26044b2db0cf7b1a92355e5 /railties/doc/guides/source/creating_plugins/tasks.txt | |
parent | 451969f57a6dfee8537fb10d179514e011559111 (diff) | |
parent | c62f973c749beac8947ff5119af43fbde2547eb1 (diff) | |
download | rails-9dbb52d97e4ecc97fe793e3ac04a4fd285aa003b.tar.gz rails-9dbb52d97e4ecc97fe793e3ac04a4fd285aa003b.tar.bz2 rails-9dbb52d97e4ecc97fe793e3ac04a4fd285aa003b.zip |
Merge branch 'master' of git@github.com:lifo/docrails
Diffstat (limited to 'railties/doc/guides/source/creating_plugins/tasks.txt')
-rw-r--r-- | railties/doc/guides/source/creating_plugins/tasks.txt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/railties/doc/guides/source/creating_plugins/tasks.txt b/railties/doc/guides/source/creating_plugins/tasks.txt new file mode 100644 index 0000000000..d848c2cfa1 --- /dev/null +++ b/railties/doc/guides/source/creating_plugins/tasks.txt @@ -0,0 +1,27 @@ +== Rake tasks == + +When you created the plugin with the built-in rails generator, it generated a rake file for you in 'vendor/plugins/yaffle/tasks/yaffle.rake'. Any rake task you add here will be available to the app. + +Many plugin authors put all of their rake tasks into a common namespace that is the same as the plugin, like so: + +*vendor/plugins/yaffle/tasks/yaffle.rake* + +[source, ruby] +--------------------------------------------------------- +namespace :yaffle do + desc "Prints out the word 'Yaffle'" + task :squawk => :environment do + puts "squawk!" + end +end +--------------------------------------------------------- + +When you run `rake -T` from your plugin you will see: + +--------------------------------------------------------- +yaffle:squawk # Prints out the word 'Yaffle' +--------------------------------------------------------- + +You can add as many files as you want in the tasks directory, and if they end in .rake Rails will pick them up. + +Note that tasks from 'vendor/plugins/yaffle/Rakefile' are not available to the main app.
\ No newline at end of file |