Joins the given pathnames onto self to create a newPathname object.
path0=Pathname.new("/usr")# Pathname:/usrpath0=path0.join("bin/ruby")# Pathname:/usr/bin/ruby# is the same aspath1=Pathname.new("/usr")+"bin/ruby"# Pathname:/usr/bin/rubypath0==path1#=> true
# File ext/pathname/lib/pathname.rb, line 389
def join(*args)
args.unshift self
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?
}
result
end