diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-01 00:22:18 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-01 00:22:18 +0000 |
commit | 572b8b37498a875382220d957d1b4285ae046eaf (patch) | |
tree | c99094d16c078b18e01e397fa56a763adb6486bd /ext/pathname/lib | |
parent | 933e5e091106a83dd8f7c402e02703c183f644ee (diff) |
* ext/pathname/pathname.c (path_sub): Pathname#sub translated
from pathname.rb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/pathname/lib')
-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}]/ |