a = File.join(a, "")
Quickly, simply, and ensures that it aends in a path separator; that is, it gives the same result: a- "/var/www"or "/var/www/".
This is the same as Joe White's comment above; I do not know why he did not present it as an answer, since he deserves to be alone.
Oddly enough, the Pathname library does not provide a convenient way to do the same.
matt source
share