Permalink
Browse files

rake doc:rails complains loudly if there's no path to generate docs from

  • Loading branch information...
1 parent e00bc71 commit ee580d0cc3794ecb4c6e259d2573695c60a422b4 @jeremy jeremy committed Mar 7, 2010
Showing with 3 additions and 1 deletion.
  1. +3 −1 railties/lib/rails/tasks/documentation.rake
@@ -11,9 +11,11 @@ namespace :doc do
rdoc.rdoc_files.include('lib/**/*.rb')
}
- desc 'Generate documentation for the Rails framework. Specify path with PATH="/path/to/rails"'
+ desc 'Generate documentation for the Rails framework. Specify path with RAILS_PATH="/path/to/rails"'
Rake::RDocTask.new("rails") { |rdoc|
path = ENV['RAILS_PATH'] || 'vendor/gems/gems'
+ raise "Missing Rails directory at #{path}" unless File.directory?(path)
+
version = "-#{Rails::VERSION::STRING}" unless ENV['RAILS_PATH']
rdoc.rdoc_dir = 'doc/api'
rdoc.template = "#{ENV['template']}.rb" if ENV['template']

0 comments on commit ee580d0

Please sign in to comment.