diff options
author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-10-02 10:36:34 +0000 |
---|---|---|
committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-10-02 10:36:34 +0000 |
commit | 396f148c2925c190331857d36c45d2c78e701bcf (patch) | |
tree | fd5fd4b3f3cb05f0029ce272fd3bce4bbebbd078 /lib | |
parent | fe3b676fa2e5c57db75eeeb07b506e4ed6e4f433 (diff) |
* lib/ftools.rb (catname): allow trailing '/' for the destination.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ftools.rb | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/ftools.rb b/lib/ftools.rb index 5e6203b1a3..4047a595eb 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 |