diff options
Diffstat (limited to 'doc/NEWS')
-rw-r--r-- | doc/NEWS | 462 |
1 files changed, 267 insertions, 195 deletions
@@ -12,6 +12,10 @@ %W(...) notation, word list literal like %w(...) with the exception that #{} interpolation is allowed. +: arbitrary delimited symbol literl + + :"foo", :"foo#{bar}", etc. + : expression interpolation in strings Now arbitrary statements are allowed inside #{} interpolation @@ -39,6 +43,10 @@ Extended to take an optional expression, which is used as a value for termination. +: direct assignment to Foo::Bar is allowed + + also, you can define "class Foo::Bar; end". + = language core : $stdin, $stdout, $stderr @@ -46,6 +54,10 @@ can be assignable again. the original stdio are preserved as STDIN, STDOUT, STDERR. +: $VERBOSE now has 3 levels + + nil - silence, false - medium (default), true - verbose + : allocation framework any instance of class can be allocated by class.allocate, @@ -68,6 +80,9 @@ improved at the performance of searching by using an internal hash table. + calls const_missing method of the class/module, if constant is not + found in the look up path. + : expression parenthesis in the first argument altered to get the following code (note the space after p): @@ -117,75 +132,46 @@ = changes in core class library -: Marshal to use marshal_dump and marshal_load - - if a dumping object responds to 'marshal_dump', Marshal.dump calls - it, and dumps object returned. Marshal.load allocates a new instance - using "allocate", then calls its "marshal_load" with dumped data. - Marshal format version is now 4.8 (was 4.6 in 1.6.8). - -: Thread#group - - new method to get belonging ThreadGroup. - -: Kernel#warn(message) - - a method to give warnings. - -: Process::detach(pid) - - new method to detach child process. child process will be "wait"ed - automagically. +: open -: Object#instance_variable_set, Object#instance_variable_get + Extended so that when the third argument is permission flags it + calls open(2) instead of fopen(3). - added. +: sprintf -: Class#inherited + new format specifier "%p" is available. - Method is called when Class is inherited by another class. +: lambda and proc - class A; end - def A.inherited(by) - puts "A inherited by #{by.inspect}" - end - class B < A; end + Proc object returns from these methods has the following attributes: - Prints out "A inherited by B" + * strict argument number check + * break and return terminates the proc execution. -: String#split +: warn(message) - if "sep" argument is a string, regular expression meta characters - are escaped internally. + a method to give warnings. -: String#to_i +: abort() - Now accepts optional base argument. + takes optional terminate message argument. - "101".to_i(10) => 101 - "101".to_i(2) => 5 - "101".to_i(8) => 65 - "101".to_i(16) => 257 +: Object#initialize_copy - A base argument of 0 guesses at the base. + copy constructor for clone and dup. - "101".to_i(0) => 101 - "0b101".to_i(0) => 5 - "0101".to_i(0) => 65 - "0x101".to_i(0) => 257 - -: SystemCallError +: Object#instance_variable_set, Object#instance_variable_get - SystemCallError's "===" match (used in rescue also) is now based on its errno. + added. -: IO::sysopen +: Object#singleton_method_removed +: Object#singleton_method_undefined - New method to get a raw file descriptor. + Added. -: open +: Array#transpose - Extended so that when the third argument is permission flags it - calls open(2) instead of fopen(3). + added. : Array#fetch(index [, default]) @@ -215,44 +201,10 @@ Beware that this behavior is not guaranteed to continue in the future. Do not rely on its return value. [ruby-dev:12506] -: Thread#join - - 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!. -: IO#sysseek - - Added. - -: IO - - 64bit off_t support by Janathan Baker. - -: abort() - - Takes optional terminate message argument. - -: IO.fsync - - New method that copies all in-memory parts of a file to disk and - waits until the device 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 - Dir::[] doesn't. - - Dir.glob("makefile", File::FNM_CASEFOLD) #=> ['Makefile', 'makefile'] - : Array#pack, String#unpack Allows comment in template strings. @@ -276,51 +228,130 @@ Takes block to get the default value. +: Array#zip + + added. + : Hash#update Takes block to resolve key conflict. -: IO#fsync +: Hash#merge and Hash#merge! + + update hash. Hash#merge! is a synonym of Hash#update. + +: String#split + + if "sep" argument is a string, regular expression meta characters + are escaped internally. + +: String#rstrip + + chop off NULs at the end of strings. + +: 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) => 257 + +: String#[regexp, nth] + + Extended to accepts optional second argument. + + It tries match between self and REGEXP, then returns the + content of the NTH regexp register. + +: String#casecmp + + Added. This is a case insensitive version of String#<=>. + +: String#chomp + + If $/ == "\n", chops off last newlines (any of \n, \r, \r\n). + +: String#eql? + + Changed to be always case sensitive. + +: String#insert(n, other) Added. -: Dir#path + This is much the same as (({str[n, 0] = other})) except returing + self. + +: String#lstrip, rstrip, lstrip!, rstrip! + + Added. These strip only left or right part of a string. + +: String#match Added. -: Dir.chdir +: String/Array methods - Extended to take a block. + Returns an instance of receivers class. -: Dir.glob +: String.new - Made to support meta-character escaping by a backslash. Wildcards - and spaces may now be escaped using a backslash. + The first argument becomes optional. -: Dir.open +: Symbol#intern - Changed to return what the block returns when a block is given, just - as File.open does. (It always returned (({nil})) in 1.6 and - prior) + Added. -: Dir.chdir +: Symbol.all_symbols - Changed to warn only when invoked from multiple threads or no block - is given. [ruby-dev:13823] + Added. [ruby-dev:12921] - Dir.chdir('foo') { - Dir.chdir('bar') { # previously warned - puts Dir.pwd - } - } +: IO -: Enumerable#all? -: Enumerable#any? -: Enumerable#inject -: Enumerable#sort_by + 64bit off_t support by Janathan Baker. + +: IO#read +: IO#sysread + + takes optinal second argument for read buffer. + +: IO::sysopen + + New method to get a raw file descriptor. + +: IO#sysseek Added. +: IO#fsync + + new method that copies all in-memory parts of a file to disk and + waits until the device reports that all parts are on stable storage. + Implemented with fsync(2) or equivalent. + +: 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 as a synonym for IO.new. + +: IO.read + + Added. Like IO.readlines, except it returns the entire file as a + string. [ruby-talk:9460] + : File#fnmatch, File::Constants::FNM_* Added. Refer to the fnmatch(3) manpage for details. @@ -343,44 +374,70 @@ File mode can be specified by flags like open(2), e.g. File::open(path, File::CREAT|File::WRONLY). -: IO.open +: Regexp#options - Made public. Can only associate an IO object with a file number - like IO.new and IO.for_fd, but can take a block. + Added. -: IO.for_fd +: Regexp.last_match(n) - Added as a synonym for IO.new. + Extended to take an optional argument. -: IO.read +: MatchData#captures - Added. Like IO.readlines, except it returns the entire file as a - string. [ruby-talk:9460] + added. -: Interrupt +: Dir#path - Made a subclass of SignalException. (It was a subclass of - Exception in 1.6 and prior) + Added. -: Marshal +: Dir.chdir - Fixed not to dump anonymous classes/modules. + Extended to take a block. - Fixed with loading modules. +: Dir.glob -: Math.acos(x) -: Math.asin(x) -: Math.atan(x) -: Math.cosh(x) -: Math.hypot(x,y) -: Math.sinh(x) -: Math.tanh(x) + Made to support meta-character escaping by a backslash. Wildcards + and spaces may now be escaped using a backslash. - Added. +: Dir.open -: Method#== + Changed to return what the block returns when a block is given, just + as File.open does. (It always returned (({nil})) in 1.6 and + prior) - Added. +: Dir.chdir + + Changed to warn only when invoked from multiple threads or no block + is given. [ruby-dev:13823] + + Dir.chdir('foo') { + Dir.chdir('bar') { # previously warned + puts Dir.pwd + } + } + +: Dir#pos= + + Returns the new position instead of self. + +: Dir::glob + + Now accepts optional FNM_* flags via the second argument, whereas + Dir::[] doesn't. + + Dir.glob("makefile", File::FNM_CASEFOLD) #=> ['Makefile', 'makefile'] + +: 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" : Module#include? @@ -399,128 +456,143 @@ Extended to take block. -: NameError and NoMethodError +: Time - Moved and now NoMethodError < NameError < StandardError. + Extended to accept a negative time_t. (Only when the platform + supports it) -: NoMethodError + p Time.at(-1) + => Thu Jan 01 08:59:59 JST 1970 - Added. [ruby-dev:12763] +: Time#to_a +: Time#zone -: NotImplementError + Made to return "UTC" under gmtime. It used to return a platform + dependent value, typically "GMT", in 1.6 and prior. - Finally obsoleted. Use NotImplementedError. +: Marshal to use marshal_dump and marshal_load -: Object#singleton_method_removed -: Object#singleton_method_undefined + if a dumping object responds to 'marshal_dump', Marshal.dump calls + it, and dumps object returned. Marshal.load allocates a new instance + using "allocate", then calls its "marshal_load" with dumped data. + Marshal format version is now 4.8 (was 4.6 in 1.6.8). - Added. +: Marshal -: Proc#== + Fixed not to dump anonymous classes/modules. - Added. + Fixed with loading modules. -: Process.times +: Thread#group - Moved from Time.times. (Time.times still remains but emits a - warning) + new method to get belonging ThreadGroup. -: Process.waitall +: Thread#terminate - Added. + synonym of Thread#exit -: Process::Status +: Thread#join - Added. (({$?})) is now an instance of this class. + Optional argument limits maximum time to wait the thread in second. + And returns nil if timed out. -: Range#step([step=1]) +: ThreagGroup#enclose - Added. + prohibits thread movement from/to enclosed groups. -: Regexp#options +: Range#step([step=1]) Added. -: Regexp.last_match(n) - - Extended to take an optional argument. +: SystemCallError -: Signal + SystemCallError's "===" match (used in rescue also) is now based on its errno. - Added. This module has module functions Signal.trap and Signal.list. +: Interrupt -: String#[regexp, nth] + Made a subclass of SignalException. (It was a subclass of + Exception in 1.6 and prior) - Extended to accepts optional second argument. +: NameError and NoMethodError - It tries match between self and REGEXP, then returns the - content of the NTH regexp register. + Moved and now NoMethodError < NameError < StandardError. -: String#casecmp +: NoMethodError - Added. This is a case insensitive version of String#<=>. + Added. [ruby-dev:12763] -: String#chomp +: NotImplementError - If $/ == "\n", chops off last newlines (any of \n, \r, \r\n). + Finally obsoleted. Use NotImplementedError. -: String#eql? +: SystemCallError.=== - Changed to be always case sensitive. + Added. (See the "Comparison of exception classes in a rescue clause" + paragraph above) [ruby-dev:12670] -: String#insert(n, other) +: SystemExit#status Added. - This is much the same as (({str[n, 0] = other})) except returing - self. - -: String#lstrip, rstrip, lstrip!, rstrip! +: Proc#== - Added. These strip only left or right part of a string. + Added. -: String#match +: Method#== Added. -: String/Array methods +: UnboundMethod is no longer subclass of Method - Returns an instance of receivers class. + class hierarchy changed. -: String.new +: Enumerable#all? +: Enumerable#any? +: Enumerable#inject +: Enumerable#sort_by - The first argument becomes optional. + Added. -: Symbol#intern +: Math.acos(x) +: Math.asin(x) +: Math.atan(x) +: Math.cosh(x) +: Math.hypot(x,y) +: Math.sinh(x) +: Math.tanh(x) Added. -: Symbol.all_symbols +: Process.abort +: Process.exit - Added. [ruby-dev:12921] + synonym of Kernel#abort, and Kernel#exit respectively. -: SystemCallError.=== +: Process::detach(pid) - Added. (See the "Comparison of exception classes in a rescue clause" - paragraph above) [ruby-dev:12670] + new method to detach child process. child process will be "wait"ed + automagically. -: SystemExit#status +: Process.times + + Moved from Time.times. (Time.times still remains but emits a + warning) + +: Process.waitall Added. -: Time +: Process::Status - Extended to accept a negative time_t. (Only when the platform - supports it) + Added. (({$?})) is now an instance of this class. - p Time.at(-1) - => Thu Jan 01 08:59:59 JST 1970 +: Process::UID, Process::GID, Process::Sys, -: Time#to_a -: Time#zone + Added. - Made to return "UTC" under gmtime. It used to return a platform - dependent value, typically "GMT", in 1.6 and prior. +: Signal + + Added. This module has module functions Signal.trap and Signal.list. = changes in bundled libraries |