join(*args)
public
Joins the given pathnames onto self to create a new Pathname object.
path0 = Pathname.new("/usr")
path0 = path0.join("bin/ruby")
path1 = Pathname.new("/usr") + "bin/ruby"
path0 == path1
Show source
def join(*args)
return self if args.empty?
result = args.pop
result = Pathname.new(result) unless Pathname === result
return result if result.absolute?
args.reverse_each {|arg|
arg = Pathname.new(arg) unless Pathname === arg
result = arg + result
return result if result.absolute?
}
self + result
end