From: Matt Armstrong Date: 2002-12-16T02:07:40+09:00 Subject: [patch] doc/NEWS --=-=-= I added and clarified some things in doc/NEWS and thought it would be generally useful. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=NEWS.patch Index: doc/NEWS =================================================================== RCS file: /src/ruby/doc/NEWS,v retrieving revision 1.50 diff -u -r1.50 NEWS --- doc/NEWS 1 Dec 2002 09:08:05 -0000 1.50 +++ doc/NEWS 15 Dec 2002 14:51:21 -0000 @@ -1,5 +1,33 @@ This file is not actively maintained. See ChangeLog for recent changes. +: Class#inherited + + Method is called when Class is inherited by another class. + + class A; end + def A.inherited(by) + puts "A inherited by #{by.inspect}" + end + class B < A; end + + Prints out "A inherited by B" + +: String#to_i + + Now accepts optional base argument. + + "101".to_i(10) => 101 + "101".to_i(2) => 5 + "101".to_i(8) => 65 + "101".to_i(16) => 257 + + A base argument of 0 guesses at the base. + + "101".to_i(0) => 101 + "0b101".to_i(0) => 5 + "0101".to_i(0) => 65 + "0x101".to_i(0) => 1 + : Set class (set.rb) Imported. @@ -48,6 +76,10 @@ Optional argument limits maximum time to wait the thread in second. And returns nil if timed out. +: Array#filter + + Previously deprecated, now removed. Use Array#collect!. + : dl module Imported. An interface to the dynamic linker. @@ -68,6 +100,16 @@ Imported. Wrapper library of (({iconv})). +: IO.fsync + + New method that copies all in-memory parts of a file to disk and + waits until the deice reports that all parts are on stable storage. + Implemented with fsync(2) or equivalent. + +: Dir#pos= + + Returns the new position instead of self. + : Dir::glob Now accepts optional FNM_* flags via the second argument, whereas @@ -103,6 +145,14 @@ new templates 'q' and 'Q' for 64bit integer (signed and unsigned respectively). +: Array.new + + Now takes block to fill initial values. E.g. + + i = 0 + Array.new(10) { i += 1 } + => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + : Array#fill takes block to get the values to fill. @@ -215,9 +265,10 @@ Extended so that when the third argument is permission flags it calls open(2) instead of fopen(3). -: Array#fetch +: Array#fetch(index [, default]) - Added. + Added. If a default value isn't given, raises index error if index + is out of range. : Array#insert(n, other, ...) @@ -301,17 +352,24 @@ Added. -: IO#puts +: File.open, IO.open + + File mode can be specified by flags like open(2), + e.g. File::open(path, File::CREAT|File::WRONLY). - do not treat Array specially. +: IO.open + + Made public. Can only associate an IO object with a file number + like IO.new and IO.for_fd, but can take a block. : IO.for_fd - Added. + Added as a synonym for IO.new. : IO.read - Added. [ruby-talk:9460] + Added. Like IO.readlines, except it returns the entire file as a + string. [ruby-talk:9460] : Interrupt --=-=-=--