diff options
author | Michael Koziarski <michael@koziarski.com> | 2010-03-30 14:31:16 +1300 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2010-03-30 14:31:16 +1300 |
commit | bc298152f8cc507549a9df9363e8da1900578932 (patch) | |
tree | cdc935e3ec7822e0266c76530aa53cd4ab520c12 /railties/lib/rails | |
parent | 4aded43b73ff94dbf06b4a2d2075651ce454e1d5 (diff) | |
download | rails-bc298152f8cc507549a9df9363e8da1900578932.tar.gz rails-bc298152f8cc507549a9df9363e8da1900578932.tar.bz2 rails-bc298152f8cc507549a9df9363e8da1900578932.zip |
Fix syntax error and avoid the use of unless/else.
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/tasks/documentation.rake | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/railties/lib/rails/tasks/documentation.rake b/railties/lib/rails/tasks/documentation.rake index eadf7afc52..1b44f9a46c 100644 --- a/railties/lib/rails/tasks/documentation.rake +++ b/railties/lib/rails/tasks/documentation.rake @@ -17,14 +17,7 @@ namespace :doc do desc 'Generate documentation for the Rails framework. Uses gem paths or the RAILS_PATH environment variable.' path = ENV['RAILS_PATH'] - unless defined?(Bundler) || (path && File.directory?(path)) - task :rails do - if path - $stderr.puts "Skipping doc:rails, missing Rails directory at #{path}" - else - $stderr.puts "Skipping doc:rails, RAILS_PATH environment variable is not set" - end - else + if defined?(Bundler) || (path && File.directory?(path)) desc 'Generate documentation for the Rails framework.' Rake::RDocTask.new("rails") { |rdoc| rdoc.rdoc_dir = 'doc/api' @@ -61,6 +54,14 @@ namespace :doc do rdoc.rdoc_files.include("#{gem_path('railties')}/#{file}") end } + else + task :rails do + if path = ENV['RAILS_PATH'] + $stderr.puts "Skipping doc:rails, missing Rails directory at #{path.inspect}" + else + $stderr.puts "Skipping doc:rails, RAILS_PATH environment variable is not set" + end + end end plugins = FileList['vendor/plugins/**'].collect { |plugin| File.basename(plugin) } |