def checkout filename
      checked = read(filename)
      @synchronized = (checked == @current) if synchronized?
      @current = checked
      # Cataloging is necessary to avoid FileNotFoundErrors when the file is
      # not in the workspace. Otherwise it should be safe to defer
      # synchronization.
      catalog unless workspace.has_file?(filename)
      @current
    end
def checkout filename
      checked = read(filename)
      @synchronized = (checked == @current) if synchronized?
      @current = checked
      # Cataloging is necessary to avoid FileNotFoundErrors when the file is
      # not in the workspace. Otherwise it should be safe to defer
      # synchronization.
      catalog unless workspace.has_file?(filename)
      @current
    end
Check a file out of the library. If the file is not part of the
 workspace, the ApiMap will virtualize it for mapping purposes. If
 filename is nil, any source currently checked out of the library
 will be removed from the ApiMap. Only one file can be checked out
 (virtualized) at a time.

 @raise [FileNotFoundError] if the file does not exist.

 @param filename [String]
 @return [Source]