From 3cb5ed25769b1621ef790c3573730a4ad0764e9e Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 4 Dec 2022 00:31:45 +0900 Subject: [PATCH] [Misc #19155] [DOC] Addion of absolute paths --- lib/pathname.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/pathname.rb b/lib/pathname.rb index 9a29752..7bdfd0e 100644 --- a/lib/pathname.rb +++ b/lib/pathname.rb @@ -338,6 +338,8 @@ def ascend # # Appends a pathname fragment to +self+ to produce a new Pathname object. + # Since +other+ is considered as a path relative to +self+, if +other+ is + # an absolute path, the new Pathname object is created from just +other+. # # p1 = Pathname.new("/usr") # Pathname:/usr # p2 = p1 + "bin/ruby" # Pathname:/usr/bin/ruby @@ -399,6 +401,8 @@ def plus(path1, path2) # -> path # :nodoc: # # Joins the given pathnames onto +self+ to create a new Pathname object. + # This is effectively the same as using Pathname#+ to append +self+ and + # all arguments sequentially. # # path0 = Pathname.new("/usr") # Pathname:/usr # path0 = path0.join("bin/ruby") # Pathname:/usr/bin/ruby