Permalink
Browse files

Add rake task to generate guides inside a rails app

  • Loading branch information...
1 parent e72a37a commit 5dd10c881cb8d598f9ea1e0776c80bc5b7816b3c @lifo lifo committed Oct 21, 2008
Showing with 13 additions and 0 deletions.
  1. +13 −0 railties/lib/tasks/documentation.rake
@@ -52,6 +52,19 @@ namespace :doc do
rm_rf 'doc/plugins' rescue nil
end
+ desc "Generate Rails guides"
+ task :guides do
+ source = File.join(RAILTIES_PATH, "doc/guides")
+ destination = File.join(RAILS_ROOT, "doc/guides")
+ FileUtils.rm_r(destination) if File.directory?(destination)
+ FileUtils.mkdir(destination)
+
+ FileUtils.cp_r File.join(source, 'html/.'), File.join(destination)
+ # Copy images and css files to html directory. These dirs are in .gitigore and shouldn't be source controlled.
+ FileUtils.cp_r File.join(source, 'source/images'), File.join(destination, 'images')
+ FileUtils.cp_r File.join(source, 'source/stylesheets'), File.join(destination, 'stylesheets')
+ end
+
namespace :plugins do
# Define doc tasks for each plugin
plugins.each do |plugin|

0 comments on commit 5dd10c8

Please sign in to comment.