class YARD::I18n::PotGenerator

def extract_documents(object)

def extract_documents(object)
  return if @extracted_objects.key?(object)
  @extracted_objects[object] = true
  case object
  when CodeObjects::NamespaceObject
    object.children.each do |child|
      extract_documents(child)
    end
  end
  if object.group
    message = register_message(object.group)
    object.files.each do |path, line|
      message.add_location(path, line)
    end
    message.add_comment(object.path) unless object.path.empty?
  end
  docstring = object.docstring
  unless docstring.empty?
    text = Text.new(StringIO.new(docstring))
    text.extract_messages do |type, *args|
      case type
      when :paragraph
        paragraph, line_no = *args
        message = register_message(paragraph.rstrip)
        object.files.each do |path, line|
          message.add_location(path, (docstring.line || line) + line_no)
        end
        message.add_comment(object.path) unless object.path.empty?
      else
        raise "should not reach here: unexpected type: #{type}"
      end
    end
  end
  docstring.tags.each do |tag|
    extract_tag_documents(tag)
  end
end