From 23843e8b3cb8598bec5cc2a0148b8cfc5018e026 Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 14 Feb 2009 10:21:15 +0000 Subject: * 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 --- lib/pathname.rb | 52 ---------------------------------------------------- 1 file changed, 52 deletions(-) (limited to 'lib/pathname.rb') diff --git a/lib/pathname.rb b/lib/pathname.rb index 0171b5e9fe..386dfe5f1b 100644 --- a/lib/pathname.rb +++ b/lib/pathname.rb @@ -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 IO.read. 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 File.split. 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 Dir.mkdir. 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 -- cgit v1.2.3