From 3b39217fb4f115129522207e083a4875beecf5e9 Mon Sep 17 00:00:00 2001 From: matz Date: Sat, 21 Feb 2009 19:32:39 +0000 Subject: * lib/pathname.rb (Pathname#binread): added. [ruby-dev:37952] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/pathname.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/pathname.rb b/lib/pathname.rb index 386dfe5f1b..ce9179a16a 100644 --- a/lib/pathname.rb +++ b/lib/pathname.rb @@ -804,10 +804,20 @@ class Pathname # * IO * IO.foreach(@path, *args, &block) end - # See IO.read. Returns all the bytes from the file, or the first +N+ + # 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 data from the file, or the first +N+ bytes # if specified. def read(*args) IO.read(@path, *args) end + # See IO.binread. Returns all the bytes from the file, or the first +N+ + # if specified. + def binread(*args) IO.binread(@path, *args) end + # See IO.readlines. Returns all the lines from the file. def readlines(*args) IO.readlines(@path, *args) end -- cgit v1.2.3