From 361be96e52a2982e5ab1c061efa73fd152446cfd Mon Sep 17 00:00:00 2001 From: eban Date: Tue, 2 Oct 2001 10:36:34 +0000 Subject: * lib/ftools.rb (catname): allow trailing '/' for the destination. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/ftools.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/ftools.rb b/lib/ftools.rb index 5e6203b1a..4047a595e 100644 --- a/lib/ftools.rb +++ b/lib/ftools.rb @@ -4,12 +4,7 @@ class << File def catname from, to if FileTest.directory? to - to + - if to =~ /\\/ - if to[-1,1] != '\\' then '\\' end + basename(from) - else - if to[-1,1] != '/' then '/' end + basename(from) - end + File.join to.sub(%r([/\\]$), ''), basename(from) else to end -- cgit