Skip to content
Browse files

Fix behaviour for --build-gems

Closes gh-56
  • Loading branch information...
1 parent 5ab929a commit cdd9756780f78b48f05f79c66b6fc30f3ce52100 @lsegal committed
Showing with 3 additions and 4 deletions.
  1. +3 −4 lib/yard/cli/yardoc.rb
View
7 lib/yard/cli/yardoc.rb
@@ -166,15 +166,14 @@ def build_gems(rebuild = false)
Gem.source_index.find_name('').each do |spec|
reload = true
dir = Registry.yardoc_file_for_gem(spec.name)
- next unless dir
- if File.directory?(dir) && !rebuild
+ if dir && File.directory?(dir) && !rebuild
log.debug "#{spec.name} index already exists at '#{dir}'"
else
- Dir.chdir(spec.full_gem_path)
- log.info "Building yardoc index for gem: #{spec.full_name}"
yfile = Registry.yardoc_file_for_gem(spec.name, ">= 0", true)
next unless yfile
Registry.clear
+ Dir.chdir(spec.full_gem_path)
+ log.info "Building yardoc index for gem: #{spec.full_name}"
Yardoc.run('-n', '-b', yfile)
reload = false
end

0 comments on commit cdd9756

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