diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-12-04 00:31:45 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-12-03 15:53:20 +0000 |
commit | b8a73e704ddc77db36317dda293e99fb0ee641f4 (patch) | |
tree | b49470f667e3c10f7921639622ee582529863c34 /ext/pathname/lib | |
parent | 7b2306a3ab2a7d33c5c5c8ac248447349874b258 (diff) |
[ruby/pathname] [Misc #19155] [DOC] Addion of absolute paths
https://github.com/ruby/pathname/commit/3cb5ed2576
Diffstat (limited to 'ext/pathname/lib')
-rw-r--r-- | ext/pathname/lib/pathname.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb index 9a297529ca..7bdfd0eb39 100644 --- a/ext/pathname/lib/pathname.rb +++ b/ext/pathname/lib/pathname.rb @@ -338,6 +338,8 @@ class Pathname # # 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 @@ class Pathname # # 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 |