class RDoc::RubyGemsHook
def generate
def generate return if @spec.default_gem? return unless @generate_ri or @generate_rdoc setup options = nil args = @spec.rdoc_options args.concat @spec.source_paths args.concat @spec.extra_rdoc_files case config_args = Gem.configuration[:rdoc] when String then args = args.concat config_args.split(' ') when Array then args = args.concat config_args end delete_legacy_args args Dir.chdir @spec.full_gem_path do options = ::RDoc::Options.new options.default_title = "#{@spec.full_name} Documentation" options.parse args options.quiet = !Gem.configuration.really_verbose end @rdoc = new_rdoc say "Parsing documentation for #{@spec.full_name}" Dir.chdir @spec.full_gem_path do # RDoc::Options#finish must be called before parse_files. # RDoc::Options#finish is also called after ri/darkfish generator setup. # We need to dup the options to avoid modifying it after finish is called. parse_options = options.dup parse_options.finish @rdoc.options = parse_options @rdoc.store = RDoc::Store.new(parse_options) @rdoc.parse_files parse_options.files end document 'ri', options, @ri_dir if @generate_ri and (@force or not File.exist? @ri_dir) document 'darkfish', options, @rdoc_dir if @generate_rdoc and (@force or not File.exist? @rdoc_dir) end