lib/yard/rubygems/hook.rb in yard-0.9.1 vs lib/yard/rubygems/hook.rb in yard-0.9.2

- old
+ new

@@ -50,11 +50,20 @@ generate_yard = types.include?('yardoc') || types.include?('yard') generate_yri = types.include? 'yri' specs.each do |spec| - new(spec, generate_yard, generate_yri).generate + gen_yard, gen_yri = generate_yard, generate_yri + gen_yri = false if gen_yard # never generate both, no need + if types.size > 0 # --no-document is not in effect + # look at spec.metadata['yard.run'] for override + run_yard = spec.metadata['yard.run'] + gen_yard = true if run_yard && run_yard != 'yri' + gen_yri = true if run_yard == 'yri' + end + + new(spec, gen_yard, gen_yri).generate end return unless generate_yard or generate_yri duration = (Time.now - start).to_i @@ -114,17 +123,17 @@ def install_yard FileUtils.rm_rf @yard_dir say "Installing YARD documentation for #{@spec.full_name}..." - run_yardoc '-o', @yard_dir + run_yardoc '--no-progress', '--db', @yri_dir, '-o', @yard_dir end def install_yri FileUtils.rm_rf @yri_dir say "Building YARD (yri) index for #{@spec.full_name}..." - run_yardoc '-c', '-n', '--db', @yri_dir + run_yardoc '--no-progress', '-c', '-n', '--db', @yri_dir end ## # Generates YARD and yri data