# File lib/vendor/fssm/fssm/pathname.rb, line 105
    def cleanpath!
      parts = to_a
      final = []

      parts.each do |part|
        case part
          when '.' then
            next
          when '..' then
            case final.last
              when '..' then
                final.push('..')
              when nil then
                final.push('..')
              else
                final.pop
            end
          else
            final.push(part)
        end
      end

      replace(final.empty? ? Dir.pwd : File.join(*final))
    end