lib/yard/rake/yardoc_task.rb in yard-0.8.7.4 vs lib/yard/rake/yardoc_task.rb in yard-0.8.7.5

- old
+ new

@@ -12,10 +12,14 @@ # Options to pass to {CLI::Yardoc} # @return [Array<String>] the options passed to the commandline utility attr_accessor :options + # Options to pass to {CLI::Stats} + # @return [Array<String>] the options passed to the stats utility + attr_accessor :stats_options + # The Ruby source files (and any extra documentation files separated by '-') # to process. # @example Task files assignment # YARD::Rake::YardocTask.new do |t| # t.files = ['app/**/*.rb', 'lib/**/*.rb', '-', 'doc/FAQ.md', 'doc/Changes.md'] @@ -44,15 +48,17 @@ # @yieldparam [YardocTask] _self the task object to allow any parameters # to be changed. def initialize(name = :yard) @name = name @options = [] + @stats_options = [] @files = [] yield self if block_given? self.options += ENV['OPTS'].split(/[ ,]/) if ENV['OPTS'] self.files += ENV['FILES'].split(/[ ,]/) if ENV['FILES'] + self.options << '--no-stats' unless self.stats_options.empty? define end protected @@ -64,11 +70,12 @@ task(name) do before.call if before.is_a?(Proc) yardoc = YARD::CLI::Yardoc.new yardoc.options[:verifier] = verifier if verifier yardoc.run *(options + files) + YARD::CLI::Stats.run(*(stats_options + ['--use-cache'])) unless stats_options.empty? after.call if after.is_a?(Proc) end end end end -end \ No newline at end of file +end