# File lib/yard/core_ext/file.rb, line 35
  def self.cleanpath(path)
    path = path.split(SEPARATOR)
    path = path.inject([]) do |acc, comp|
      next acc if comp == RELATIVE_SAMEDIR
      if comp == RELATIVE_PARENTDIR && acc.size > 0 && acc.last != RELATIVE_PARENTDIR
        acc.pop
        next acc
      end
      acc << comp
    end
    File.join(*path)
  end