ruby-changes:49321
From: kazu <ko1@a...>
Date: Sun, 24 Dec 2017 11:41:05 +0900 (JST)
Subject: [ruby-changes:49321] kazu:r61438 (trunk): [DOC] Improve example of IO#pread [ci skip]
kazu 2017-12-24 11:41:00 +0900 (Sun, 24 Dec 2017) New Revision: 61438 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61438 Log: [DOC] Improve example of IO#pread [ci skip] Modified files: trunk/io.c Index: io.c =================================================================== --- io.c (revision 61437) +++ io.c (revision 61438) @@ -5107,10 +5107,12 @@ pread_internal_call(VALUE arg) https://github.com/ruby/ruby/blob/trunk/io.c#L5107 * at end of file and <code>NotImplementedError</code> if platform does not * implement the system call. * - * f = File.new("testfile") - * f.read #=> "This is line one\nThis is line two\n" - * f.pread(12, 0) #=> "This is line" - * f.pread(9, 8) #=> "line one\n" + * File.write("testfile", "This is line one\nThis is line two\n") + * File.open("testfile") do |f| + * p f.read # => "This is line one\nThis is line two\n" + * p f.pread(12, 0) # => "This is line" + * p f.pread(9, 8) # => "line one\n" + * end */ static VALUE rb_io_pread(int argc, VALUE *argv, VALUE io) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/