1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

This commit is contained in:
Jeremy Kemper 2010-03-07 12:06:19 -08:00
parent e00bc711d8
commit ee580d0cc3

View file

@ -11,9 +11,11 @@ namespace :doc do
rdoc.rdoc_files.include('lib/**/*.rb') 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| Rake::RDocTask.new("rails") { |rdoc|
path = ENV['RAILS_PATH'] || 'vendor/gems/gems' 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'] version = "-#{Rails::VERSION::STRING}" unless ENV['RAILS_PATH']
rdoc.rdoc_dir = 'doc/api' rdoc.rdoc_dir = 'doc/api'
rdoc.template = "#{ENV['template']}.rb" if ENV['template'] rdoc.template = "#{ENV['template']}.rb" if ENV['template']