class RDoc::RDoc

def document(options)

def document(options)
  if RDoc::Options === options then
    @options = options
  else
    @options = RDoc::Options.load_options
    @options.parse options
  end
  @options.finish
  @store = RDoc::Store.new(@options)
  if @options.pipe then
    handle_pipe
    exit
  end
  unless @options.coverage_report then
    @last_modified = setup_output_dir @options.op_dir, @options.force_update
  end
  @start_time = Time.now
  @store.load_cache
  file_info = parse_files @options.files
  @options.default_title = "RDoc Documentation"
  @store.complete @options.visibility
  @stats.coverage_level = @options.coverage_report
  if @options.coverage_report then
    puts
    puts @stats.report.accept RDoc::Markup::ToRdoc.new
  elsif file_info.empty? then
    $stderr.puts "\nNo newer files." unless @options.quiet
  else
    gen_klass = @options.generator
    @generator = gen_klass.new @store, @options
    generate
  end
  if @stats and (@options.coverage_report or not @options.quiet) then
    puts
    puts @stats.summary.accept RDoc::Markup::ToRdoc.new
  end
  exit @stats.fully_documented? if @options.coverage_report
end