aboutsummaryrefslogtreecommitdiffstats
path: root/lib/pathname.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pathname.rb')
-rw-r--r--lib/pathname.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/pathname.rb b/lib/pathname.rb
index 7b371def2b..e4e2b01992 100644
--- a/lib/pathname.rb
+++ b/lib/pathname.rb
@@ -235,7 +235,11 @@ class Pathname
"#<#{self.class}:#{@path}>"
end
- #
+ # Return a pathname which is substituted by String#sub.
+ def sub(pattern, *rest, &block)
+ Pathname.new(@path.sub(pattern, *rest, &block))
+ end
+
# Returns clean pathname of +self+ with consecutive slashes and useless dots
# removed. The filesystem is not accessed.
#
@@ -438,6 +442,8 @@ class Pathname
# #<Pathname:path/to/some>
# #<Pathname:path/to/some/file.rb>
#
+ # It doesn't access actual filesystem.
+ #
def descend
paths = []
v = self
@@ -473,6 +479,8 @@ class Pathname
# #<Pathname:path/to>
# #<Pathname:path>
#
+ # It doesn't access actual filesystem.
+ #
def ascend
paths = []
v = self