[前][次][番号順一覧][スレッド一覧]

ruby-changes:10737

From: akr <ko1@a...>
Date: Sat, 14 Feb 2009 19:22:08 +0900 (JST)
Subject: [ruby-changes:10737] Ruby:r22301 (trunk): * lib/pathname.rb: obsolete methods removed.

akr	2009-02-14 19:21:15 +0900 (Sat, 14 Feb 2009)

  New Revision: 22301

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=22301

  Log:
    * lib/pathname.rb: obsolete methods removed.
      [ruby-core:21564]

  Modified files:
    trunk/ChangeLog
    trunk/lib/pathname.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 22300)
+++ ChangeLog	(revision 22301)
@@ -1,3 +1,8 @@
+Sat Feb 14 19:20:15 2009  Tanaka Akira  <akr@f...>
+
+	* lib/pathname.rb: obsolete methods removed.
+	  [ruby-core:21564]
+
 Sat Feb 14 13:14:18 2009  TAKANO Mitsuhiro (takano32)  <tak@n...>
 
 	* iseq.c: remove nil parameter from Proc#parameters
Index: lib/pathname.rb
===================================================================
--- lib/pathname.rb	(revision 22300)
+++ lib/pathname.rb	(revision 22301)
@@ -475,8 +475,6 @@
   # 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 @@
     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 @@
   # 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 @@
   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 @@
     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 @@
     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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]