: String#to_i Accepts optional base argument. : Integer#to_s Accepts optional base argument. : TCPServer#listen, UNIXServer#listen Added. : String#match Added. : Syslog module Imported. : String#chomp if $/ == '\n', chops off last newlines (any of \n, \r, \r\n). : Module::new/Class::new takes block. : allocation framework any instance of class can be allocated by class.allocate, (except a few classes). : String#[] starting offset can be specified as optional second parameter. : String/Array methods returns an instance of receivers class. : String::new returns "". : Dir#path Added. : Enum#sort_by Added. : Signal new module, has module functions Signal::trap and Signal::list. : Curses Updated. New methods and constants for using the mouse, character attributes, colors and key codes have been added. : Range#step([step=1]) Added. : Regexp It is being obsoleted to regard /re/ as /re/ =~ $_ in a conditional context. Use ~/re/ instead. : String#lstrip, rstrip, lstrip!, rstrip! Added. These strip only left or right part of a string. : Socket::pack_sockaddr_in(), Socket::unpack_sockaddr_in() Added. Utility for direct Socket access. : Socket::pack_sockaddr_un(), Socket::unpack_sockaddr_un() Added. Utility for direct Socket access. : String#casecmp Added. This is a case insensitive version of String#<=>. : String#eql? Changed to be always case sensitive. : Module#include? Added. [ruby-dev:13941] : Dir::chdir Changed to warn only when invoked from multiple threads or no block is given. [ruby-dev:13823] Dir.chdir("/tmp") pwd = Dir.pwd #=> "/tmp" puts pwd Dir.chdir("foo") { pwd = Dir.pwd #=> "/tmp/foo" puts pwd Dir.chdir("bar") { # <-- previously warned pwd = Dir.pwd #=> "/tmp/foo/bar" puts pwd } pwd = Dir.pwd #=> "/tmp/foo" puts pwd } pwd = Dir.pwd #=> "/tmp" puts pwd : Proc#yield Added. This is equivalent to Proc#call except it does not check the number of given arguments, which are thus passed to the proc as-is. : File#fnmatch, File::Constants::FNM_* Added. Refer to the fnmatch(3) manpage for details. e.g. # exclude files matching "*.bak". files.reject! { |fn| File::fnmatch?("*.bak", fn) } : Method#== Added. : Multiple assignment behavior Fixed so that "*a = nil" results in "a == []". : Array expansion Fixed with the following behavior: a = *[1] p a #=> [1] Now 1-element array in rhs is expanded properly. a = *[1] p a #=> 1 : NameError & NoMethodError Moved and now NoMethodError < NameError < StandardError. : open Extended so that when the third argument is permission flags it calls open(2) instead of fopen(3). : Marshal Fixed not to dump anonymous classes/modules. Fixed with loading modules. : constants Improved at the performance of searching by using an internal hash table. : Syntax Experimentally altered to get the following code (note the space after p): p ("xx"*2).to_i Interpreted as: p (("xx"*2).to_i) Instead of: (p("xx"*2)).to_i : Range#to_ary Added. You can now do something like this: a, b, c = 1..3 : break and next Extended to take an optional expression, which is used as a value for termination. [experimental] : to_str Added to get objects which define to_str() treated as String's. Now almost all the built-in methods try each argument with to_str() when they expect it to be a String. foo = Object.new class < -:7:in `open': wrong argument type Object (expected String) (TypeError) ruby 1.6.4 (2001-04-19) [i586-linux] => -:7:in `open': No such file or directory - "foo" (Errno::ENOENT) ruby 1.7.0 (2001-05-02) [i586-linux] : Line-range operation Obsoleted except the case when used in a one-liner (ruby -e "..."), which means "if 101..200" in a script is no longer interpreted as comparison between (({$.})) and 101 or 200. : Comparison of exception classes in a rescue clause Changed to use (())#=== for comparing $! with the exception class specified in each rescue clause. As the previous behavior was to use kind_of?, the effect is limited to the SystemCallError case. SystemCallError.=== has been newly defined to return true when the two have the same errno. With this change, SystemCallError's with the same errno, such as Errno::EAGAIN and Errno::EWOULDBLOCK, can both be rescued by listing just one of them. : (())#fetch Added. : (())#insert(n, other, ...) Added. (()) This is much the same as (({ary[n,0] = [other,...]})) except returing self. ary = [0,1,2,3] ary[2, 0] = [4, 5, 6] p ary ary = [0,1,2,3] ary.insert(2, 4, 5, 6) p ary : (())#sort! Changed to always return self without checking whether the sequence of the elements was modified or not. Beware that this behavior is not guaranteed to continue in the future. Do not rely on its return value. (()). : (()).open Changed to return what the block returns when a block is given, just as (()).open does. (It always returned (({nil})) in 1.6 and prior) : (()).chdir Extended to take a block. : (()).glob Made to support meta-character escaping by a backslash. Wildcards and spaces may now be escaped using a backslash. : (())#all? : (())#any? : (())#inject Added. : (()).lchmod : (()).lchown Added. : (()).for_fd Added. : (()).read Added. (()) : (()) Made a subclass of (()). (It was a subclass of Exception in 1.6 and prior) : (())#to_ary Added for convenience of Regexp#match. (()) Previously we had to do: foo, bar, baz = /(\w+?)\s+(\w+?)\s+(\w+)/.match("foo bar baz").to_a[1..-1] p [foo, bar, baz] But now can do: _, foo, bar, baz = /(\w+?)\s+(\w+?)\s+(\w+)/.match("foo bar baz") p [foo, bar, baz] : (()).acos(x) : (()).asin(x) : (()).atan(x) : (()).cosh(x) : (()).sinh(x) : (()).tanh(x) : (()).hypot(x,y) Added. : (())#included Added. This is a hook called after Module#append_feature. : (())#method_removed : (())#method_undefined Added. : (()) Added. (()) : NotImplementError Finally obsoleted. Use (()). : (())#singleton_method_removed : (())#singleton_method_undefined Added. : (())#== Added. : (()).times Moved from ((