Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix syntax error and avoid the use of unless/else.

  • Loading branch information...
commit bc298152f8cc507549a9df9363e8da1900578932 1 parent 4aded43
Michael Koziarski NZKoz authored
Showing with 9 additions and 8 deletions.
  1. +9 −8 railties/lib/rails/tasks/documentation.rake
17 railties/lib/rails/tasks/documentation.rake
View
@@ -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) }

1 comment on commit bc29815

Postmodern

I just started to get can't convert nil into String exceptions from the gem_path method defined in documentation.rake. The gem_path method appears to not handle cases when the gem_name cannot be found in $LOAD_PATH.

Please sign in to comment.
Something went wrong with that request. Please try again.