summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-21 19:32:39 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-21 19:32:39 +0000
commitd9f134e16fe95500ef072985c4e582c3d253122a (patch)
tree0352e8674c3dad417234370240b9cc5e38d2c759 /lib
parentef0eca37398beea19ca786456c9adc86789e9f98 (diff)
downloadruby-d9f134e16fe95500ef072985c4e582c3d253122a.tar.gz
ruby-d9f134e16fe95500ef072985c4e582c3d253122a.tar.xz
ruby-d9f134e16fe95500ef072985c4e582c3d253122a.zip
* lib/pathname.rb (Pathname#binread): added. [ruby-dev:37952]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/pathname.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/pathname.rb b/lib/pathname.rb
index 386dfe5f1..ce9179a16 100644
--- a/lib/pathname.rb
+++ b/lib/pathname.rb
@@ -804,10 +804,20 @@ class Pathname # * IO *
IO.foreach(@path, *args, &block)
end
- # See <tt>IO.read</tt>. 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 <tt>IO.read</tt>. Returns all data from the file, or the first +N+ bytes
# if specified.
def read(*args) IO.read(@path, *args) end
+ # See <tt>IO.binread</tt>. Returns all the bytes from the file, or the first +N+
+ # if specified.
+ def binread(*args) IO.binread(@path, *args) end
+
# See <tt>IO.readlines</tt>. Returns all the lines from the file.
def readlines(*args) IO.readlines(@path, *args) end