`path.gsub(/~\z/, "")`?