mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
4f5976cbb8
commit
dc9603bd5c
2 changed files with 21 additions and 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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue