1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/pathname.rb: obsolete methods removed.

[ruby-core:21564]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2009-02-14 10:21:15 +00:00
parent 53bea54768
commit 23843e8b3c
2 changed files with 5 additions and 52 deletions

View file

@ -1,3 +1,8 @@
Sat Feb 14 19:20:15 2009 Tanaka Akira <akr@fsij.org>
* lib/pathname.rb: obsolete methods removed.
[ruby-core:21564]
Sat Feb 14 13:14:18 2009 TAKANO Mitsuhiro (takano32) <tak@no32.tk>
* iseq.c: remove nil parameter from Proc#parameters

View file

@ -475,8 +475,6 @@ class Pathname
# All components of the pathname must exist when this method is
# called.
#
# No arguments should be given; the old behaviour is *obsoleted*.
#
def realpath
real_path_internal(true)
end
@ -806,12 +804,6 @@ class Pathname # * IO *
IO.foreach(@path, *args, &block)
end
# Pathname#foreachline is *obsoleted* at 1.8.1. Use #each_line.
def foreachline(*args, &block)
warn "Pathname#foreachline is obsoleted. Use Pathname#each_line."
each_line(*args, &block)
end
# See <tt>IO.read</tt>. Returns all the bytes from the file, or the first +N+
# if specified.
def read(*args) IO.read(@path, *args) end
@ -902,20 +894,6 @@ class Pathname # * File *
# See <tt>File.split</tt>. Returns the #dirname and the #basename in an
# Array.
def split() File.split(@path).map {|f| self.class.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
@ -1009,18 +987,6 @@ class Pathname # * Dir *
def Pathname.getwd() self.new(Dir.getwd) end
class << self; alias pwd getwd end
# Pathname#chdir is *obsoleted* at 1.8.1.
def chdir(&block)
warn "Pathname#chdir is obsoleted. Use Dir.chdir."
Dir.chdir(@path, &block)
end
# Pathname#chroot is *obsoleted* at 1.8.1.
def chroot
warn "Pathname#chroot is obsoleted. Use Dir.chroot."
Dir.chroot(@path)
end
# Return the entries (files and subdirectories) in the directory, each as a
# Pathname object.
def entries() Dir.entries(@path).map {|f| self.class.new(f) } end
@ -1033,12 +999,6 @@ class Pathname # * Dir *
Dir.foreach(@path) {|f| yield self.class.new(f) }
end
# Pathname#dir_foreach is *obsoleted* at 1.8.1.
def dir_foreach(*args, &block)
warn "Pathname#dir_foreach is obsoleted. Use Pathname#each_entry."
each_entry(*args, &block)
end
# See <tt>Dir.mkdir</tt>. Create the referenced directory.
def mkdir(*args) Dir.mkdir(@path, *args) end
@ -1105,18 +1065,6 @@ class Pathname # * mixed *
end
end
alias delete unlink
# This method is *obsoleted* at 1.8.1. Use #each_line or #each_entry.
def foreach(*args, &block)
warn "Pathname#foreach is obsoleted. Use each_line or each_entry."
if FileTest.directory? @path
# For polymorphism between Dir.foreach and IO.foreach,
# Pathname#foreach doesn't yield Pathname object.
Dir.foreach(@path, *args, &block)
else
IO.foreach(@path, *args, &block)
end
end
end
class Pathname