diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-03 18:51:23 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-03 18:51:23 +0000 |
commit | dc9603bd5c6b9618e1f4aa8a48c020c56425366f (patch) | |
tree | c32c600f1ded10a0a96c936e69b0b20e1ec0cf91 | |
parent | 4f5976cbb826df462c62a0a8e72ebe91c15a7ba4 (diff) | |
download | ruby-dc9603bd5c6b9618e1f4aa8a48c020c56425366f.tar.gz |
* lib/pathname.rb (Pathname#link, Pathname#symlink): obsoleted.
(Pathname#make_link, Pathname#make_symlink): new method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/pathname.rb | 18 |
2 files changed, 21 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Thu Dec 4 03:48:59 2003 Tanaka Akira <akr@m17n.org> + + * lib/pathname.rb (Pathname#link, Pathname#symlink): obsoleted. + (Pathname#make_link, Pathname#make_symlink): new method. + Thu Dec 4 01:45:24 2003 Yukihiro Matsumoto <matz@ruby-lang.org> * io.c (argf_read): should not terminate on empty string; wait diff --git a/lib/pathname.rb b/lib/pathname.rb index 027886ccd0..0cd0c9a377 100644 --- a/lib/pathname.rb +++ b/lib/pathname.rb @@ -360,13 +360,13 @@ class Pathname def fnmatch(pattern, *args) File.fnmatch(pattern, @path, *args) end def fnmatch?(pattern, *args) File.fnmatch?(pattern, @path, *args) end def ftype() File.ftype(@path) end - def link(old) File.link(old, @path) end + def make_link(old) File.link(old, @path) end def open(*args, &block) File.open(@path, *args, &block) end def readlink() Pathname.new(File.readlink(@path)) end def rename(to) File.rename(@path, to) end def stat() File.stat(@path) end def lstat() File.lstat(@path) end - def symlink(old) File.symlink(old, @path) end + def make_symlink(old) File.symlink(old, @path) end def truncate(length) File.truncate(@path, length) end def utime(atime, mtime) File.utime(atime, mtime, @path) end def basename(*args) Pathname.new(File.basename(@path, *args)) end @@ -374,6 +374,20 @@ class Pathname def extname() File.extname(@path) end def expand_path(*args) Pathname.new(File.expand_path(@path, *args)) end def split() File.split(@path).map {|f| Pathname.new(f) } end + + # Pathname#link is confusing and obsoleted because the receiver/argument + # order is inverted to corresponding system call. + def link(old) + warn 'Pathname#link is obsoleted. Use Pathname#make_link.' + File.link(old, @path) + end + + # Pathname#symlink is confusing and obsoleted because the receiver/argument + # order is inverted to corresponding system call. + def symlink(old) + warn 'Pathname#symlink is obsoleted. Use Pathname#make_symlink.' + File.symlink(old, @path) + end end # FileTest |