diff options
Diffstat (limited to 'ext/pathname/lib/pathname.rb')
-rw-r--r-- | ext/pathname/lib/pathname.rb | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb index 88453c3c66..b0639a4079 100644 --- a/ext/pathname/lib/pathname.rb +++ b/ext/pathname/lib/pathname.rb @@ -31,25 +31,6 @@ class Pathname # :startdoc: - # Return a pathname which is substituted by String#sub. - def sub(pattern, *rest, &block) - if block - path = @path.sub(pattern, *rest) {|*args| - begin - old = Thread.current[:pathname_sub_matchdata] - Thread.current[:pathname_sub_matchdata] = $~ - eval("$~ = Thread.current[:pathname_sub_matchdata]", block.binding) - ensure - Thread.current[:pathname_sub_matchdata] = old - end - yield(*args) - } - else - path = @path.sub(pattern, *rest) - end - self.class.new(path) - end - if File::ALT_SEPARATOR SEPARATOR_LIST = "#{Regexp.quote File::ALT_SEPARATOR}#{Regexp.quote File::SEPARATOR}" SEPARATOR_PAT = /[#{SEPARATOR_LIST}]/ |