diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-03-22 01:37:34 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-03-22 01:37:34 +0900 |
commit | 9f828188335a32906ac1e60bce7ccb6857d48a38 (patch) | |
tree | 0e19794ae12ebd72a3ac1262019fe6f211d23353 /doc/NEWS | |
parent | 35cc70606b00b34b8ccf621881d92945033af356 (diff) | |
download | ruby-9f828188335a32906ac1e60bce7ccb6857d48a38.tar.gz |
[DOC] Move old NEWS files to a separate directory
Diffstat (limited to 'doc/NEWS')
-rw-r--r-- | doc/NEWS/NEWS-1.8.7 | 669 | ||||
-rw-r--r-- | doc/NEWS/NEWS-1.9.1 | 429 | ||||
-rw-r--r-- | doc/NEWS/NEWS-1.9.2 | 509 | ||||
-rw-r--r-- | doc/NEWS/NEWS-1.9.3 | 341 | ||||
-rw-r--r-- | doc/NEWS/NEWS-2.0.0 | 529 | ||||
-rw-r--r-- | doc/NEWS/NEWS-2.1.0 | 376 | ||||
-rw-r--r-- | doc/NEWS/NEWS-2.2.0 | 359 | ||||
-rw-r--r-- | doc/NEWS/NEWS-2.3.0 | 384 | ||||
-rw-r--r-- | doc/NEWS/NEWS-2.4.0 | 399 | ||||
-rw-r--r-- | doc/NEWS/NEWS-2.5.0 | 565 | ||||
-rw-r--r-- | doc/NEWS/NEWS-2.6.0 | 662 | ||||
-rw-r--r-- | doc/NEWS/NEWS-2.7.0 | 845 | ||||
-rw-r--r-- | doc/NEWS/NEWS-3.0.0.md | 817 | ||||
-rw-r--r-- | doc/NEWS/NEWS-3.1.0.md | 660 |
14 files changed, 7544 insertions, 0 deletions
diff --git a/doc/NEWS/NEWS-1.8.7 b/doc/NEWS/NEWS-1.8.7 new file mode 100644 index 0000000000..5da39ff265 --- /dev/null +++ b/doc/NEWS/NEWS-1.8.7 @@ -0,0 +1,669 @@ +# -*- rdoc -*- + += NEWS for Ruby 1.8.7 + +This document is a list of user visible feature changes made between +releases except for bug fixes. + +Note that each entry is kept so brief that no reason behind or +reference information is supplied with. For a full list of changes +with all sufficient information, see the ChangeLog file. + +== Changes since the 1.8.6 release + +=== Configuration changes + +* default C flags + + Some C compiler flags may be added by default depending on your + environment. Specify optflags=.. and warnflags=.. as necessary to + override them. + +* vendor_ruby directory + + A new library directory named `vendor_ruby' is introduced in + addition to `site_ruby'. The idea is to separate libraries + installed by the package system (`vendor') from manually (`site') + installed libraries preventing the former from getting overwritten + by the latter, while preserving the user option to override vendor + libraries with site libraries. (`site_ruby' takes precedence over + `vendor_ruby') + + If you are a package maintainer, make each library package configure + the library passing the `--vendor' option to `extconf.rb' so that + the library files will get installed under `vendor_ruby'. + + You can change the directory locations using configure options such + as `--with-sitedir=DIR' and `--with-vendordir=DIR'. + +=== Global constants + +* new constants + + * RUBY_COPYRIGHT + * RUBY_DESCRIPTION + +=== Library updates (outstanding ones only) + +* new library + + * securerandom + +* builtin classes + + * Array#flatten + * Array#flatten! + + Takes an optional argument that determines the level of recursion + to flatten. + + * Array#eql? + * Array#hash + * Array#== + * Array#<=> + + Handle recursive data properly. + + * Array#index + * Array#rindex + + Use a given block if no argument is given. + + * Array#collect! + * Array#map! + * Array#each + * Array#each_index + * Array#reverse_each + * Array#reject + * Array#reject! + * Array#delete_if + * Array#select + + Return an enumerator if no block is given. + + Note that #map and #collect still return an array unlike Ruby 1.9 + to keep compatibility. + + * Array#pop + * Array#shift + + Take an optional argument specifying the number of elements to + remove. + + * Array#choice + * Array#combination + * Array#cycle + * Array#drop + * Array#drop_while + * Array#permutation + * Array#product + * Array#shuffle + * Array#shuffle! + * Array#take, + * Array#take_while + + New methods. + + * Binding#eval + + New method. + + * Dir#each + * Dir#foreach + + Return an enumerator if no block is given. + + * Enumerable::Enumerator + + New class for various enumeration defined by the enumerator library. + + * Enumerable#each_slice + * Enumerable#each_cons + * Object#to_enum + * Object#enum_for + + New methods for various enumeration defined by the enumerator library. + + * Enumerable#count + * Enumerable#cycle + * Enumerable#drop + * Enumerable#drop_while + * Enumerable#find_index + * Enumerable#first + * Enumerable#group_by + * Enumerable#max_by + * Enumerable#min_by + * Enumerable#minmax + * Enumerable#minmax_by + * Enumerable#none? + * Enumerable#one? + * Enumerable#take + * Enumerable#take_while + + New methods. + + * Enumerable#find + * Enumerable#find_all + * Enumerable#partition + * Enumerable#reject + * Enumerable#select + * Enumerable#sort_by + + Return an enumerator if no block is given. + + Note that #map and #collect still return an array unlike Ruby 1.9 + to keep compatibility. + + * Enumerable#inject + + Accepts a binary operator instead of a block. + + * Enumerable#reduce + + New alias to #inject. + + * Enumerable#to_a + + Can take optional arguments and pass them to #each. + + * Hash#eql? + * Hash#hash + * Hash#== + + Handle recursive data properly. + + * Hash#delete_if + * Hash#each + * Hash#each_key + * Hash#each_pair + * Hash#each_value + * Hash#reject! + * Hash#select + * ENV.delete_if + * ENV.each + * ENV.each_key + * ENV.each_pair + * ENV.each_value + * ENV.reject! + * ENV.select + + Return an enumerator if no block is given. + + * GC.stress + * GC.stress= + + New methods. + + * Integer#ord + * Integer#odd? + * Integer#even? + * Integer#pred + + New methods. + + * Integer#downto + * Integer#times + * Integer#upto + + Return an enumerator if no block is given. + + * IO#each + * IO#each_line + * IO#each_byte + * IO.foreach + * ARGF.each + * ARGF.each_line + * ARGF.each_byte + + Return an enumerator if no block is given. + + * IO#bytes + * IO#chars + * IO#each_char + * IO#getbyte + * IO#lines + * IO#readbyte + * ARGF.bytes + * ARGF.chars + * ARGF.each_char + * ARGF.getbyte + * ARGF.lines + * ARGF.readbyte + + New methods. + + * Method#name + * Method#owner + * Method#receiver + * UnboundMethod#name + * UnboundMethod#owner + + New methods. + + * Module#class_exec + * Module#module_exec + + New methods. + + * Numeric#step + + Return an enumerator if no block is given. + + * Object#instance_exec + * Object#tap + + New methods. + + * ObjectSpace.each_object + + Return an enumerator if no block is given. + + * Process.exec implemented. + + * Range#each + * Range#step + + Return an enumerator if no block is given. + + * Regexp.union accepts an array of patterns. + + * String#bytes + + New method + + * String#bytesize + + New method, returning the size in bytes. (alias length and size) + + * String#chars + * String#each_char + * String#lines + * String#partition + * String#rpartition + * String#start_with? + * String#end_with? + + New methods. These are $KCODE aware unlike #index, #rindex and + #include?. + + * String#each_byte + * String#each + * String#each_line + * String#gsub(pattern) + + Return an enumerator if no block is given. + + * String#upto + + An optional second argument is added to specify if the last value + should be included. + + * StopIteration + + New exception class that causes Kernel#loop to stop iteration when + raised. + + * Struct#each + * Struct#each_pair + + Return an enumerator if no block is given. + + * Symbol#to_proc + + New method. + + * __method__ + + New global function that returns the name of the current method as + a Symbol. + +* enumerator + + * Enumerator is now a built-in module. The #next and #rewind + methods are implemented using the "generator" library. Use with + care and be aware of the performance loss. + +* ipaddr + + * New methods + * IPAddr#<=> + * IPAddr#succ + + IPAddr objects are now comparable and enumerable having these + methods. This also means that it is possible to have a Range + object between two IPAddr objects. + + * IPAddr#to_range + + A new method to create a Range object for the (network) address. + + * Type coercion support + * IPAddr#& + * IPAddr#| + * IPAddr#== + * IPAddr#include? + + These methods now accept a string or an integer instead of an + IPAddr object as the argument. + +* net/smtp + + * Support SSL/TLS. + +* openssl + + * New classes + * OpenSSL::PKey::EC + * OpenSSL::PKey::EC::Group + * OpenSSL::PKey::EC::Point + * OpenSSL::PKey::PKCS5 + * OpenSSL::SSL::Session + + * Documentation! + + * Various new methods (see documentation). + + * Remove redundant module namespace in Cipher, Digest, PKCS7, PKCS12. + Compatibility classes are provided which will be removed in Ruby 1.9. + +* shellwords + + * Add methods for escaping shell-unsafe characters: + * Shellwords.join + * Shellwords.escape + * Array#shelljoin + * String#shellescape + + * Add shorthand methods: + * Shellwords.split (alias shellwords) + * String#shellsplit + +* stringio + + * StringIO#getbyte + * StringIO#readbyte + + New methods. (aliases for compatibility with 1.9) + + * StringIO#each_char + * StringIO#chars + + New methods. + + * StringIO#each + * StringIO#each_line + * StringIO#each_byte + + Return an enumerator if no block is given. + +* tempfile + + * Tempfile.open and Tempfile.new now accept a suffix for the + temporary file to be created. To specify a suffix, pass an array + of [basename, suffix] as the first argument. + + Tempfile.open(['image', 'jpg']) { |tempfile| ... } + +* tmpdir + + * New method: + + * Dir.mktmpdir + +* uri + + * added LDAPS scheme. + * Change for RFC3986: + * FTP + * URI('ftp://example.com/foo').path #=> 'foo' + * URI('ftp://example.com/%2Ffoo').path #=> '/foo' + * URI::FTP.build([nil, 'example.com', nil, '/foo', 'i']).to_s #=> 'ftp://example.com/%2Ffoo;type=i' + * URI merge + * URI('http://a/b/c/d;p?q').merge('?y') == URI('http://a/b/c/d;p?y') + * URI('http://a/b/c/d;p?q').merge('/./g') == URI('http://a/g') + * URI('http://a/b/c/d;p?q').merge('/../g') == URI('http://a/g') + * URI('http://a/b/c/d;p?q').merge('../../../g') == URI('http://a/g') + * URI('http://a/b/c/d;p?q').merge('../../../../g') == URI('http://a/g') + +* rss + + * 0.1.6 -> 0.2.4 + + * Fix image module URI + + * Atom support + + * ITunes module support + + * Slash module support + + * content:encoded with RSS 2.0 support + +=== Interpreter Implementation + +* passing a block to a Proc [experimental] + + This implementation in current shape is known to be buggy/broken, + especially with nested block invocation. Take this as an + experimental feature. + +* stack trace + + On non-SystemStackError exception, full stack trace is shown. + +=== Compatibility issues (excluding feature bug fixes) + +* String#slice! had some unintentional bugs and they have been fixed + because either they disagreed with documentation or their respective + behavior of #slice. Unfortunately, this causes some + incompatibilities in the following (somewhat rare) cases. + + * #slice! no longer expands the array when an out-of-boundary value + is given. + + # Ruby 1.8.6 + a = [1,2] + a.slice!(4,0) #=> nil + a #=> [1,2,nil,nil] + + # Ruby 1.8.7 + a = [1,2] + a.slice!(4,0) #=> nil + a #=> [1,2] + + * #slice! no longer raises an exception but returns nil when a + negative length or out-of-boundary negative position is given. + + # Ruby 1.8.6 + a = [1,2] + a.slice!(1,-1) #=> (raises IndexError) + a.slice!(-5,1) #=> (raises IndexError) + + # Ruby 1.8.7 + a = [1,2] + a.slice!(1,-1) #=> nil + a.slice!(-5,1) #=> nil + +* String#to_i, String#hex and String#oct no longer accept a sequence + of underscores (`__') as part of a number. + + # Ruby 1.8.6 + '1__0'.to_i #=> 10 + '1__0'.to_i(2) #=> 2 # 0b10 + '1__0'.oct #=> 8 # 010 + '1__0'.hex #=> 16 # 0x10 + + # Ruby 1.8.7 + '1__0'.to_i #=> 1 + '1__0'.to_i(2) #=> 1 + '1__0'.oct #=> 1 + '1__0'.hex #=> 1 + + The old behavior was inconsistent with Ruby syntax and considered as + a bug. + +* date + + * Date.parse + + '##.##.##' (where each '#' is a digit) is now taken as 'YY.MM.DD' + instead of 'MM.DD.YY'. While the change may confuse you, you can + always use Date.strptime() when you know what you are dealing + with. + +* REXML + + * REXML::Document.entity_expansion_limit= + + New method to set the entity expansion limit. By default the limit is + set to 10000. See the following URL for details. + + https://www.ruby-lang.org/en/news/2008/08/23/dos-vulnerability-in-rexml/ + +* stringio + + * StringIO#each_byte + + The return value changed from nil to self. This is what the + document says and the same as each_line() does. + +* tempfile + + * The file name format has changed. No dots are included by default + in temporary file names any more. See above for how to specify a + suffix. + +* uri + + * See above for details. + +== Changes since the 1.8.5 release + +=== New platforms/build tools support + +* IA64 HP-UX + +* Visual C++ 8 SP1 + +* autoconf 2.6x + +=== Global constants + +* RUBY_PATCHLEVEL + + New constant since 1.8.5-p1. + +=== Library updates (outstanding ones only) + +* builtin classes + + * New method: Kernel#instance_variable_defined? + + * New method: Module#class_variable_defined? + + * New feature: Dir::glob() can now take an array of glob patterns. + +* date + + * Updated based on date2 4.0.3. + +* digest + + * New internal APIs for C and Ruby. + + * Support for autoloading. + + require 'digest' + + # autoloads digest/md5 + md = Digest::MD5.digest("string") + + * New digest class methods: file + + * New digest instance methods: clone, reset, new, inspect, + digest_length (alias size or length), block_length() + + * New library: digest/bubblebabble + + * New function: Digest(name) + +* fileutils + + * New option for FileUtils.cp_r(): :remove_destination + +* nkf + + * Updated based on nkf as of 2007-01-28. + +* thread + + * Replaced with much faster mutex implementation in C. The former + implementation, which is slow but considered to be stable, is + available with a configure option `--disable-fastthread'. + +* tk + + * Updated Tile extension support based on Tile 0.7.8. + + * Support --without-X11 configure option for non-X11 versions of + Tcl/Tk (e.g. Tcl/Tk Aqua). + + * New sample script: irbtkw.rbw -- IRB on Ruby/Tk. It has no trouble + about STDIN blocking on Windows. + +* webrick + + * New method: WEBrick::Cookie.parse_set_cookies() + +=== Compatibility issues (excluding feature bug fixes) + +* builtin classes + + * String#intern now raises SecurityError when $SAFE level is greater + than zero. + +* date + + * Time#to_date and Time#to_datetime are added as private methods. + They cause name conflict error in ActiveSupport 1.4.1 and prior, + which comes with Rails 1.2.2 and prior. Updating ActiveSupport + and/or Rails to the latest versions fixes the problem. + +* digest + + * The constructor does no longer take an initial string to feed. + The following examples show how to migrate: + + # Before + md = Digest::MD5.new("string") + # After (works with any version) + md = Digest::MD5.new.update("string") + + # Before + hd = Digest::MD5.new("string").hexdigest + # After (works with any version) + hd = Digest::MD5.hexdigest("string") + + * Digest::Base#== + + * self == string + + Automatic detection between binary digest values and hexadecimal + digest values has been dropped. It is always assumed that a + hexadecimal digest value is given for comparison. + + * self == md + + Digest objects are compared by the resulting digest values, not + by the exact vector states. + +* fileutils + + * A minor implementation change breaks Rake <=0.7.1. + Updating Rake to 0.7.2 or higher fixes the problem. + +* tk + + * Tk::X_Scrollable (Y_Scrollable) is renamed to Tk::XScrollable + (YScrollable). Tk::X_Scrollable (Y_Scrollable) is still available, + but it is an alias name. diff --git a/doc/NEWS/NEWS-1.9.1 b/doc/NEWS/NEWS-1.9.1 new file mode 100644 index 0000000000..fb11026d60 --- /dev/null +++ b/doc/NEWS/NEWS-1.9.1 @@ -0,0 +1,429 @@ +# -*- rdoc -*- + += NEWS for Ruby 1.9.1 + +This document is a list of user visible feature changes made between +releases except for bug fixes. + +Note that each entry is kept so brief that no reason behind or +reference information is supplied with. For a full list of changes +with all sufficient information, see the ChangeLog file. + +== Changes since the 1.8.7 release +See doc/NEWS-1.8.7 for changes between 1.8.6 and 1.8.7. + +=== Compatibility issues + +* language core + + * New syntax and semantics + o Block arguments are always local + o New semantics for block arguments + o defined? and local variables + o Parser expects that your source code has only valid byte + sequence in some character encoding. Use magic comments + to tell the parser which encoding you use. + o New semantics for constant definition in instance_eval + or in module_eval. + + * Deprecated syntax + o colon (:) instead of "then" in if/unless or case expression. + o retry in a loop or an iterator. + +* builtin classes and objects + + * Kernel and Object + o Kernel#methods and #singleton_methods used to return an + array of strings but now they return an array of symbols. + * Class and Module + o Module#attr works as Module#attr_reader by default. + Optional boolean argument is obsolete. + o Module#instance_methods, #private_instance_methods and + #public_instance_methods used to return an array of + strings but now they return an array of symbols. + o Extra subclassing check when binding UnboundMethods + + * Exceptions + o Exceptions are equal to each other if they belong to + the same class and have the same message and backtrace. + o SystemStackError used to be a subclass of StandardError + but not it is a direct subclass of Exception. + o SecurityError: ditto + o Removed Exception#to_str [Ruby2] + + * Enumerable and Enumerator + o Enumerable::Enumerator, compatibility alias of Enumerator, + is removed. + o Enumerable#{map,collect} called without a block returns + an enumerator. + o Even more builtin and bundled libraries have been made to + return an enumerator when called without a block. + * Array + o Array#nitems was removed (use count {|i| !i.nil?}) + o Array#choice was removed (use sample) + o Array#[m,n] = nil places nil in the array. + * Hash + o Hash#to_s is equivalent to Hash#inspect + o Semantics for Hash#each and Hash#each_pair + o Hash#select returns a hash + o Hash#key is the new name for #index which has been + deprecated. + o Hash preserves order. It enumerates its elements in the + order in which the keys are inserted. + o Most of the changes in Hash apply to hash like interfaces + such as ENV and *DBM. + * IO operations + o Many methods used to act byte-wise but now some of those act + character-wise. You can use alternate byte-wise methods. + o IO#getc + o Non-blocking IO + o Kernel#open takes "t" for newline conversion + o Kernel#open takes encoding specified + o IO automatically converts byte sequence from a character + encodings into another if specified. + o StringIO#readpartial + o IO.try_convert + o IO.binread + o IO.copy_stream + o IO#binmode? + o IO#close_on_exec= and IO#close_on_exec? + o Limit input in IO#gets, IO#readline, IO#readlines, + IO#each_line, IO#lines, IO.foreach, IO.readlines, + StringIO#gets, StringIO#readline, StringIO#each, + StringIO#readlines + o IO#ungetc, StringIO#ungetc + o IO#ungetbyte, StringIO#ungetbyte + o IO#internal_encoding, IO#external_encoding, + IO#set_encoding + o IO.pipe takes encoding option + o Directive %u behaves like %d for negative values in + printf-style formatting. + * File and Dir operations + o #to_path is called as necessary in File.path, File.chmod, + File.lchmod, File.chown, File.lchown, File.utime, + File.unlink, etc.. + o File.world_readable? + o File.world_writable? + o Dir.[], Dir.glob + o Dir.exist? + o Dir.exists? + * File::Stat + o File::Stat#world_readable? + o File::Stat#world_writable? + * String + o No longer an Enumerable: use each_line/lines for line + oriented operation + o Encoding-awareness + o Character-wise semantics in many methods instead of + byte-wise. + o String#[]: Indexing a String with an integer returns a + single character String instead of an integer. + o String#[]=: No longer takes an integer as right + side value. Note that "str[i] = ?c" because of + the following change. + o ?c is evaluated to a single character string + instead of an integer. + * Regexp + o Encoding-awareness + o Regexp matches only with strings which is encoded in a + compatible character encoding to the regexp's. + o Regexp#kcode is removed. use Regexp#encoding. + * Symbols: restriction on literal symbols + * Numeric + o Numeric#div always rounds as Integer#div has done. + o Numeric#fdiv: ditto. + * Integer + o Integer(nil) raises TypeError + * Fixnum + o Fixnum#id2name removed + o Fixnum#to_sym removed + * Struct + o Struct#inspect + * Time + o New format in Time#to_s + o Timezone information preserved on Marshal.dump/load + * $SAFE and bound methods + o New trusted/untrusted model in addition to + tainted/untainted model. + + * Deprecation + o $= (global flag for case-sensitiveness on string matching) + o Kernel#to_a + o Kernel#getc, #gsub, #sub + o Kernel#callcc and Continuation now become 'continuation' + bundled library. + o Object#type + o Removed Array and Hash #indices, #indexes + o Hash#index + o ENV.index + o Process::Status#to_int + o Numeric#rdiv + o Precision is removed. Don't cry, it will be redesigned + and come back in future version. + o Symbol#to_int and Symbol#to_i + o $KCODE is no longer effective. Use Encoding related + features of each class. + o VERSION and friends + +* bundled libraries + + * Pathname + o No longer has #to_str nor #=~. + * time and date + o Time.parse and Date.parse interprets slashed numerical dates + as "dd/mm/yyyy". + * Readline + o If Readline uses libedit, Readline::HISTORY[0] returns the + first of the history. + * Continuation + o as above + + * Deprecation + o Complex#image: use Complex#imag + o All SSL-related class methods in Net::SMTP + o Prime#cache, Prime#primes, Prime#primes_so_far + o mailread library: use tmail gem. + o cgi-lib library: use cgi. + o date2 library: use date. + o eregex library + o finalize library: use ObjectSpace.define_finalizer if you + really need a finalizer. really? + o ftools library: use fileutils. + o generator library: use Enumerator. + o importenv library and Env library + o jcode library: use multilingualization support of String + o parsedate library + o ping library + o readbytes library + o getopts library and parsearg library: use optparse or + getoptlong. + o soap, wsdl and xsd libraries: use soap4r gem. + o Win32API library: use dl. + o dl library: Reimplemented and API changed. use the new + version of dl or ffi gem. + o rubyunit library and runit library: use minitest or + test/unit. Or use anything you love through RubyGems. + o test/unit is reimplemented on top of minitest. This is + not fully compatible with the original. + +=== Language core changes + + * New syntax and semantics + o Magic comments to declare in which encoding your source + code is written + o New literal hash syntax and new syntax for hash style + arguments + o New syntax for lambdas + o .() and calling Procs without #call/#[] + o Block in block arguments + o Block local variables + o Mandatory arguments after optional arguments allowed + o Multiple splats allowed + o #[] can take splatted arguments, hash style arguments + and a block. + o New directives in printf-style formatted strings (%). + o Newlines allowed before ternary colon operator (:) and + method call dot operator (.) + o Negative operators such as !, != and !~ are now + overloadable + o Encoding.default_external and default_internal + o __ENCODING__: New pseudo variable to hold the current + script's encoding + +=== Library updates + +* builtin classes and objects + * Kernel and Object + o BasicObject + o Object#=~ returns nil instead of false by default. + o Kernel#define_singleton_method + o Kernel#load can load a library from the highest versions + of gems by default. + * Class and Module + o Module#const_defined?, #const_get and #method_defined? + take an optional parameter. + o #class_variable_{set,get} are public. + o Class of singleton classes + + * Errno::EXXX + o All of those are always defined. Errno::EXXX will be + defined as an alias to Errno::NOERROR if your platform + does not have one. + + * Binding#eval + * Blocks and Procs + o Arity of blocks without arguments + o proc is now a synonym of Proc.new + o Proc#yield + o Passing blocks to #[] + o Proc#lambda? + o Proc#curry + * Fiber: coroutines/micro-threads + * Thread + o Thread.critical and Thread.critical= removed + o Thread#exit!, Thread#kill! and Thread#terminate! removed. + + * Enumerable and Enumerator + o Enumerator#enum_cons and Enumerator#enum_slice are + removed. Use #each_cons and #each_slice without a block. + o Enumerable#each_with_index can take optional arguments + and passes them to #each. + o Enumerable#each_with_object + o Enumerator#with_object + o Enumerator.new { ... } + * Array + o Array#delete returns a deleted element rather than a given + object + o Array#to_s is equivalent to Array#inspect + o Array.try_convert + o Array#pack('m0') complies with RFC 4648. + * Hash + o preserving item insertion order + o Hash#default_proc= + o Hash#_compare_by_identity and Hash#compare_by_identity? + o Hash.try_convert + o Hash#assoc + o Hash#rassoc + o Hash#flatten + * Range + o Range#cover? + o Range#include? iterates over elements and compares the + given value with each element unless the range is numeric. + Use Range#cover? for the old behavior, i.e. comparison + with boundary values. + o Range#min, Range#max + + * File and Dir operations + o New methods + * Process + o Process.spawn + o Process.daemon + * String + o String#clear + o String#ord + o String#getbyte, String#setbyte + o String#chars and String#each_char act as character-wise. + o String#codepoints, String#each_codepoint + o String#unpack with a block + o String#hash + o String.try_convert + o String#encoding + o String#force_encoding, String#encode and String#encode! + o String#ascii_only? + o String#valid_encoding? + o String#match + * Symbol + o Zero-length symbols allowed + o Symbol#intern + o Symbol#encoding + o Symbol methods similar to those in String + * Regexp + o Regexp#=== matches symbols + o Regexp.try_convert + o Regexp#match + o Regexp#fixed_encoding? + o Regexp#encoding + o Regexp#named_captures + o Regexp#names + * MatchData + o MatchData#names + o MatchData#regexp + * Encoding + * Encoding::Converter + o supports conversion between many encodings + * Numeric + o Numeric#upto, #downto, #times, #step + o Numeric#real?, Complex#real? + o Numeric#magnitude + o Numeric#round + * Float + o Float#round + * Integer + o Integer#round + * Rational / Complex + o They are in the core library now + * Math + o Math#log takes an optional argument. + o Math#log2 + o Math#cbrt, Math#lgamma, Math#gamma + * Time + o Time.times removed. Use Process.times. + o Time#sunday? + o Time#monday? + o Time#tuesday? + o Time#wednesday? + o Time#thursday? + o Time#friday? + o Time#saturday? + o Time#tv_nsec and Time#nsec + * Misc. new methods + o RUBY_ENGINE to distinguish between Ruby processor implementation + o public_method + o public_send + o GC.count + o ObjectSpace.count_objects + o Method#hash, Proc#hash + o Method#source_location, UnboundMethod#source_location and + Proc#source_location + o __callee__ + o Elements in $LOAD_PATH and $LOADED_FEATURES are expanded + +* bundled libraries + * RubyGems + o Package management system for Ruby. + o Integrated with Ruby's library loader. + * Rake + o Ruby make. A simple ruby build program with capabilities + similar to make. + * minitest + o Our new testing library which is faster, cleaner and easier + to read than the old test/unit. + o You can introduce the old test/unit as testunit gem through + RubyGems if you want. + * CMath + o Complex number version of Math + * Prime + o Extracted from Mathn and improved. You can easily enumerate + prime numbers. + o Prime.new is obsolete. Use its class methods. + * ripper + o Ruby script parser + * Readline + o Readline.vi_editing_mode? + o Readline.emacs_editing_mode? + o Readline::HISTORY.clear + * Tk + o TkXXX widget classes are removed and redefined as aliases of + Tk::XXX classes. + * RDoc + o Updated to version 2.2.2. See: + http://rubyforge.org/frs/shownotes.php?group_id=627&release_id=26434 + * json + o JSON (JavaScript Object Notation) encoder/decoder + +* commandline options + * -E, --encoding + * -U + * --enable-gems, --disable-gems + * --enable-rubyopt, --disable-rubyopt + * long options are allowed in RUBYOPT environment variable. + +=== Implementation changes + +* Memory Diet + * Object Compaction - Object, Array, String, Hash, Struct, Class, + Module + * st_table compaction (inlining small tables) +* YARV + * Ruby codes are compiled into opcodes before executed. + * Native thread + +* Platform supports + * Support levels + (0) Supported + (1) Best effort + (2) Perhaps + (3) Not supported + * Dropped + o No longer supports djgpp, bcc32, human68k, MacOS 9 or earlier, + VMS nor Windows CE. diff --git a/doc/NEWS/NEWS-1.9.2 b/doc/NEWS/NEWS-1.9.2 new file mode 100644 index 0000000000..430c6cc4f5 --- /dev/null +++ b/doc/NEWS/NEWS-1.9.2 @@ -0,0 +1,509 @@ +# -*- rdoc -*- += NEWS for Ruby 1.9.2 + +This document is a list of user visible feature changes made between +releases except for bug fixes. + +Note that each entry is kept so brief that no reason behind or +reference information is supplied with. For a full list of changes +with all sufficient information, see the ChangeLog file. + +== Changes since the 1.9.1 release +=== Library updates (outstanding ones only) + +* builtin classes + + * Array + * new methods: + * Array#keep_if + * Array#repeated_combination + * Array#repeated_permutation + * Array#rotate + * Array#rotate! + * Array#select! + * Array#sort_by! + + * extended method: + * Array#{uniq,uniq!,product} can take a block. + + * Complex + * new method: + * Complex#rationalize + + * Dir + * new method: + * Dir.home + + * Encoding + * new encodings: + * Big5 + * Big5-UAO + * ISO-2022-JP-KDDI + * SJIS-DoCoMo + * SJIS-KDDI + * SJIS-SoftBank + * UTF8-DoCoMo + * UTF8-KDDI + * UTF8-SoftBank + + * new method: + * ascii_compatible? + + * Enumerable + * new methods: + * Enumerable#chunk + * Enumerable#collect_concat + * Enumerable#each_entry + * Enumerable#flat_map + * Enumerable#slice_before + + * Enumerator + * new methods: + * Enumerator#peek + * Enumerator#next_values + * Enumerator#peek_values + * Enumerator#feed + * StopIteration#result + + * extended method: + * #with_index accepts an optional argument that specifies the + index number to start with, defaulted to 0. + + * incompatible changes: + * #rewind now calls the "rewind" method of the enclosed object + if defined. + * #next doesn't clear the position at end. + + * ENV + * Uses locale's encoding + * ENV.[]= raises Errno::{EINVAL,ENOMEM} etc. on failure. + * new methods: + * ENV.keep_if + * ENV.select! + + * Float + * new constants: + * Float::INFINITY + * Float::NAN + * new method: + * Float#rationalize + + * File + * new methods: + * File.realpath + * File.realdirpath + + * GC::Profiler + * new method: + * GC::Profiler.total_time + + * Hash + * new methods: + * Hash#keep_if + * Hash#select! + + * IO + * new methods: + * IO#autoclose= + * IO#autoclose? + * IO#fdatasync + * IO#codepoints + * IO#each_codepoint + + * extended method: + * IO.pipe can take a block. + + * new modules: + * IO::WaitReadable + * IO::WaitWritable + They are used to extend non-blocking exceptions. + + * Integer + * new method: + * Integer#rationalize + + * Kernel + * new methods: + * Kernel#respond_to_missing? + * Kernel#singleton_class + * Kernel#require_relative + + * extended method: + * Kernel#respond_to? can be used to detect methods not implemented. + For example, Process.respond_to?(:fork) returns false on Windows. + + * incompatible changes: + * Kernel#instance_eval yields the receiver. + + * Kernel#exec + * Kernel#spawn + * Kernel#system + * Kernel#` (`...`) + ..etc. + + On Windows, the current directory is no longer implicitly + prepended to the default command search path, just like other + platforms. + + * MatchData + * new method: + * MatchData#== + + * Method + * new method: + * Method#parameters + + * NilClass + * new method: + * NilClass#rationalize + + * Object + * extended methods: + * Float() supports hexadecimal floating point format. + * printf() supports %a/%A format. + + * Proc + * new method: + * Proc#parameters + * extended method: + * Proc#source_location returns location even if receiver is a method + defined by attr_reader / attr_writer / attr_accessor. + + * Process + * extended method: + * Process.spawn accepts [:child, FD] for a redirect target. + + * Random (new class to generate pseudo-random numbers) + + * Rational + * new method: + * Rational#rationalize + + * String + * extended methods: + * string[regexp, name] is supported for named capture. + + * Thread + * new methods: + * Thread#add_trace_func + * Thread#set_trace_func + + * Time + * extended features: + * time_t restriction is removed to represent before 1901 and after 2038. + Proleptic Gregorian calendar is used for old dates. + * Time.new have optional arguments to specify date with time offset. + * Time#getlocal, Time#localtime have optional time offset argument. + + * new methods: + * Time#to_r + * Time#subsec + * Time#round + + * incompatible change: + * The year argument of Time.{utc,gm,local,mktime} is now interpreted as + the value itself. For example, Time.utc(99) means the year 99 AD, + not 1999 AD. + + * UnboundMethod + * new method: + * UnboundMethod#parameters + + +* digest + * new methods: + * Digest::Class.base64digest + * Digest::Instance#base64digest + * Digest::Instance#base64digest! + + * Digest::HMAC (digest/hmac) has been marked as deprecated because + it was unintentional for the experimental library to be included + in the final release of 1.9.1. Please use OpenSSL::HMAC instead. + +* rss + + * 0.2.4 -> 0.2.7. + + * RSS::Maker.make + * raise an exception not returns nil for invalid feed making. + * requires block. + + * RSS::Maker.[] + * new method to return maker class. + + * RSS::Maker.supported?(version) + * new method to check whether given version is supported. + + * RSS::Maker: item.guid.permanent_link? + * new alias of item.guid.isPermaLink + * RSS::Maker: item.guid.permanent_link= + * new alias of item.guid.isPermaLink= + +* DL + * Now uses libffi as a backend if available. + It means DL works fine on more platforms. + +* Fiddle + * A lightweight wrapper for libffi. + +* YAML + * Now uses libyaml as a backend if available. + It means YAML library supports new standards for YAML. + +* Psych + * A wrapper for libyaml. + +* JSON + * Update to JSON 1.1.9 + +* REXML + + * REXML::Document.entity_expansion_limit= + + New method to set the entity expansion limit. By default the limit is + set to 10000. See the following URL for details. + + https://www.ruby-lang.org/en/news/2008/08/23/dos-vulnerability-in-rexml/ + +* RDoc + + * Updated to RDoc 2.5.8 + +* RubyGems + + * Updated to RubyGems 1.3.7 + +* logger + + * imported upstream version (logger/1.2.7) + * do not raise an exception even if log writing failed. + * do not raise ShiftingError if an aged file already exists. + (no ShiftingError will be raised from 1.2.7, just warn() instead) + +* matrix + * API change to adhere strictly to mathematical definitions: + * Matrices must now be rectangular. + * trace, regular?, singular? are defined only for square matrices + * support for empty matrices + * all integer matrices now have the right determinant (also an integer) + + * Matrix and Vector include Enumerable. + + * new methods: + * Matrix.build + * Matrix.empty + * Matrix#conj + * Matrix#conjugate + * Matrix#each + * Matrix#each_with_index + * Matrix#empty? + * Matrix#imag + * Matrix#imaginary + * Matrix#real + * Matrix#real? + * Matrix#rect + * Matrix#rectangular + +* net/http + * merged net/https. + +* open3 + * new methods: + * Open3.popen2 + * Open3.popen2e + * Open3.capture3 + * Open3.capture2 + * Open3.capture2e + * Open3.pipeline_rw + * Open3.pipeline_r + * Open3.pipeline_w + * Open3.pipeline_start + * Open3.pipeline + +* pty + * new methods: + * PTY.open + * PTY.check + * deprecated methods: + * protect_signal + * reset_signal + +* openssl + * new methods: + * OpenSSL::Buffering#read_nonblock + * OpenSSL::Buffering#write_nonblock + * OpenSSL::SSL::SSLSocket#connect_nonblock + * OpenSSL::SSL::SSLSocket#accept_nonblock + +* scanf + * support %a/%A format. + + +* socket + + * incompatible changes: + * Socket#{recvfrom,recvfrom_nonblock,accept,accept_nonblock,sysaccept} + returns a sender address as Addrinfo object instead of a binary sockaddr string. + Addrinfo#to_s returns the old binary sockaddr string. + * BasicSocket#getsockopt returns Socket::Option object instead of a binary string. + Socket::Option#to_s returns the old binary string. + * Socket.do_not_reverse_lookup is turned on by default now. + + * new class: + * Addrinfo + * Socket::Option + * Socket::AncillaryData + + * new methods: + * Socket.ip_address_list + * Socket.tcp + * Socket.tcp_server_loop + * Socket.tcp_server_sockets + * Socket.udp_server_sockets + * Socket.udp_server_loop_on + * Socket.udp_server_loop + * Socket.unix + * Socket.unix_server_loop + * Socket.unix_server_socket + * Socket.accept_loop + * Socket#ipv6only! + * BasicSocket#local_address + * BasicSocket#remote_address + * BasicSocket#connect_address + * BasicSocket#sendmsg + * BasicSocket#sendmsg_nonblock + * BasicSocket#recvmsg + * BasicSocket#recvmsg_nonblock + * BasicSocket#getpeereid + + * extended methods: + * Socket.new's 3rd argument is optional now. + * Socket.pair's 3rd argument is optional now. + * Socket.pair and UNIXSocket.pair can take a block. + * BasicSocket#send, UDPSocket#send, Socket.getnameinfo, Socket#bind, and + Socket#{connect,connect_nonblock} accepts an Addrinfo object as sockaddr. + * BasicSocket#getsockopt accepts a Socket::Option object. + * Socket.getaddrinfo and IPSocket#{addr,peeraddr} accept an optional + argument to turn reverse lookup on/off. + + * constant names can be accepted as well as constant values. + i.e. Socket.new(:PF_INET, :SOCK_STREAM, 0) + The constant names can be specified without the prefix. + i.e. Socket.new(:INET, :STREAM, 0) + * protocol/address family + * socket type + * socket option protocol level + * socket option name + * shutdown's argument + +* stringio + * new methods: + * StringIO#read_nonblock + * StringIO#write_nonblock +* pathname + * new methods: + * Pathname#binread + * Pathname#realdirpath + * Pathname#each_child + + * extended methods: + * Pathname#realpath and Pathname#realdirpath takes optional basedir + argument. + +* Readline + * new methods: + * Readline.set_screen_size + * Readline.get_screen_size + + * extended methods: + * Readline.completion_proc= accepts nil. + nil means to use default completion proc. + +* set + * new methods: + * Set#keep_if + * Set#select! + +* time + * incompatible changes: + * Time.parse raises ArgumentError when no date information. + +* thread + * extended method: + * ConditionVariable#wait takes timeout argument. + +* securerandom + * new methods: + * SecureRandom.urlsafe_base64 + +* URI + * new methods: + * URI.encode_www_form + * URI.decode_www_form + * URI.encode_www_form_component + * URI.decode_www_form_component + * Obsoleted methods: + * URI.decode + * URI.encode + * URI.escape + * URI.unescape + +* etc + * new methods: + * Etc::Passwd.each + * Etc::Group.each + +* zlib + * new methods: + * Zlib::GzipFile#path + * Zlib.#adler32_combine + * Zlib.#crc32_combine + +* rbconfig + * new methods: + * RbConfig.ruby + +=== Language changes + +* Regexp properties (\p{}) names now ignore underscores, spaces, and case, so + \p{ol chiki} is the same as \p{Ol_Chiki} +* Regexps now support Unicode 5.2 (new characters and scripts) +* \d, \s, and \w are now ASCII only; use POSIX bracket classes and \p{} for + Unicode semantics +* $: no longer includes the current directory, use require_relative +* Symbol with an invalid encoding is forbidden to exist. + +=== Compilation options + +* --program-prefix and --program-suffix no longer act on the shared object + names nor paths to libraries. + + use --with-rubylibprefix='${libruby}/${RUBY_INSTALL_NAME}' and + --with-soname='${RUBY_INSTALL_NAME}' for the same result as Ruby 1.9.1. + +* --with-arch is added for universal binary, instead of + --enable-fat-binary option. + +=== Compatibility issues (excluding feature bug fixes) + + * Enumerator#rewind + * Socket#recvfrom + * Socket#recvfrom_nonblock + * Socket#accept + * Socket#accept_nonblock + * Socket#sysaccept + * BasicSocket#getsockopt + * Time.utc + * Time.gm + * Time.local + * Time.mktime + * Time.parse + * --program-prefix and --program-suffix + * --enable-fat-binary + * $: + + See above. + + * Digest::HMAC + + Deprecated. See above. diff --git a/doc/NEWS/NEWS-1.9.3 b/doc/NEWS/NEWS-1.9.3 new file mode 100644 index 0000000000..484660f420 --- /dev/null +++ b/doc/NEWS/NEWS-1.9.3 @@ -0,0 +1,341 @@ +# -*- rdoc -*- += NEWS for Ruby 1.9.3 + +This document is a list of user visible feature changes made between +releases except for bug fixes. + +Note that each entry is kept so brief that no reason behind or +reference information is supplied with. For a full list of changes +with all sufficient information, see the ChangeLog file. + +== Changes since the 1.9.2 release +=== License + +* Ruby's License is changed from a dual license with GPLv2 + to a dual license with 2-clause BSDL. + +=== Known platform dependent issues +==== OS X Lion + +* You have to configure ruby with '--with-gcc=gcc-4.2' if you're using + Xcode 4.1, or, if you're using Xcode 4.2, you have to configure ruby + with '--with-gcc=clang'. + +=== C API updates + +* rb_scan_args() is enhanced with support for option hash argument + extraction. + +* ruby_vm_at_exit() added. This enables extension libs to hook a VM + termination. + +* rb_reserved_fd_p() added. If you want to close all file descriptors, + check using this API. [ruby-core:37759] + +=== Library updates (outstanding ones only) + +* builtin classes + + * ARGF + * new methods: + * ARGF.print + * ARGF.printf + * ARGF.putc + * ARGF.puts + * ARGF.read_nonblock + * ARGF.to_write_io + * ARGF.write + + * Array + * extended method: + * Array#pack supports endian modifiers + + * Bignum + * Multiplication algorithm for Bignums with a large number of digits over + 150 BDIGITs is changed in order to reduce its calculation time. + Now such large Bignums are multiplied by using Toom-3 algorithm. + + * Encoding + * new encodings: + * CP950 + * CP951 + * UTF-16 + * UTF-32 + * change alias: + * SJIS is Windows-31J + + * File + * new constant: + * File::NULL + name of NULL device. + * File::DIRECT + name of O_DIRECT. + + * IO + * extended method: + * IO#putc supports multibyte characters + * new methods: + * IO#advise + * IO.write(name, string, [offset] ) + Write `string` to file `name`. + Opposite with File.read. + * IO.binwrite(name, string, [offset] ) + binary version of IO.write. + + * Kernel + * move #__id__ to BasicObject. + * extended method: + * Kernel#rand supports range argument + + * Module + * new methods: + * Module#private_constant + * Module#public_constant + + * Random + * extended method: + * Random.rand supports range argument + + * String + * extended method: + * String#unpack supports endian modifiers + * new method: + * String#prepend + * String#byteslice + + * Time + * extended method: + * Time#strftime supports %:z and %::z. + + * Process + * Process#maxgroups and Process#maxgroups= now raise NotImplementedError if + the platform don't support supplementary groups concept. + +* bigdecimal + + * BigDecimal#power and BigDecimal#** support non-integral exponent. + + * Kernel.BigDecimal and BigDecimal.new now accept instances of Integer, + Rational, Float, and BigDecimal. If you pass a Rational or a Float to + them, you must specify the precision to produce the digits of a BigDecimal. + + * The behavior of BigDecimal#coerce with a Rational is changed. It uses + the precision of the receiver BigDecimal to produce the digits of a + BigDecimal from the given Rational. + +* bigdecimal/util + + * BigDecimal#to_d and Integer#to_d are added. + + * Float#to_d accepts a precision. + + * Rational#to_d raises ArgumentError when passing zero or negative + precision. + + * Rational#to_d + + * Zero and an implicit precision is deprecated. + This feature is removed at the next release of bigdecimal. + + * A negative precision isn't supported. + Be careful it is an incompatible change. + +* date + + * Accepts flonum explicitly with limitations. + * If the given offset is flonum, DateTime assumes its precision is + at most second. + + DateTime.new(2001,2,3,0,0,0,3.0/24) == + DateTime.new(2001,2,3,0,0,0,'+03:00') + #=> true + + * If the given operand for -/+ is flonum, DateTime assumes its + precision is at most nanosecond. + + DateTime.new(2001,2,3) + 0.5 == DateTime.new(2001,2,3,12) + #=> true + + * Precision of offset is always at most second. + + Rational('0.5') == Rational('0.500001') #=> false + DateTime.new(2001,2,3,0,0,0,Rational('0.5')) == + DateTime.new(2001,2,3,0,0,0,Rational('0.500001')) + #=> true + + * Ignores long offset and far reform day (with warning). + + * Now accepts only: + + -1<=offset<=1 (-24:00..+24:00) + 2298874<=start<=2426355 or -/+oo + (proleptic Gregorian/Julian mean -/+oo) + + * A method strftime cannot produce huge output (same as Time's one). + + * Even though Date/DateTime can handle far dates, the following causes + an exception. + + DateTime.new(1<<10000).strftime('%Y') # Errno::ERANGE + + * Changed the format of inspect. + * Changed the format of marshal (but, can load old dumps). + +* io/console + * new methods: + * IO#noecho {|io| } + * IO#echo= + * IO#echo? + * IO#raw {|io| } + * IO#raw! + * IO#getch + * IO#winsize + * IO.console + +* json + * updated to v1.5.4. + +* matrix + * new classes: + * Matrix::EigenvalueDecomposition + * Matrix::LUPDecomposition + * new methods: + * Matrix#diagonal? + * Matrix#eigen + * Matrix#eigensystem + * Matrix#hermitian? + * Matrix#lower_triangular? + * Matrix#lup + * Matrix#lup_decomposition + * Matrix#normal? + * Matrix#orthogonal? + * Matrix#permutation? + * Matrix#round + * Matrix#symmetric? + * Matrix#unitary? + * Matrix#upper_triangular? + * Matrix#zero? + * Vector#magnitude, #norm + * Vector#normalize + * extended methods: + * Matrix#each and #each_with_index can iterate on a subset of the elements + * Matrix#find_index returns [row, column] and can iterate on a subset + of the elements + * Matrix#** implements Numeric exponents (using the eigensystem) + * Matrix.zero can build rectangular matrices + +* minitest + * Minitest has been updated to version 2.2.2. + * For full details, see https://github.com/seattlerb/minitest/blob/master/History.txt + +* net/http + * SNI (Server Name Indication) supported for HTTPS. + + * Allow to configure to wait server returning '100 continue' response + before sending HTTP request body. Set Net::HTTP#continue_timeout AND pass + 'expect' => '100-continue' to a extra HTTP header. + + For example, the following code sends HTTP header and waits for getting + '100 continue' response before sending HTTP request body. When 0.5 [sec] + timeout occurs or the server send '100 continue', the client sends HTTP + request body. + http.continue_timeout = 0.5 + http.request_post('/continue', 'body=BODY', 'expect' => '100-continue') + + * new method: + * Net::HTTPRequest#set_form): Added to support + both application/x-www-form-urlencoded and multipart/form-data. + +* objspace + * new method: + * ObjectSpace::memsize_of_all + +* openssl + * PKey::RSA and PKey::DSA now use the generic X.509 encoding scheme + (e.g. used in a X.509 certificate's Subject Public Key Info) when + exporting public keys to DER or PEM. Backward compatibility is + ensured by (already existing) fallbacks during creation. + * OpenSSL::ASN1::Constructive#new and OpenSSL::ASN1::Primitive#new + (and the constructors of their sub-classes) will no longer force + tagging to be set to :EXPLICIT when tag and/or tag_class are passed + as parameters. tagging must be set explicitly. + * Support for infinite length encodings via infinite_length attribute. + * OpenSSL::PKey.read( file | string [, pwd] ) allows to read arbitrary + public/private keys in DER-/PEM-encoded form with an optional password + for encrypted PEM encodings. + * Add new method OpenSSL::X509::Name#hash_old as a wrapper of + X509_NAME_hash_old() defined from OpenSSL 1.0.0. It returns OpenSSL 0.9.8 + compatible hash value. + +* optparse + * support for bash/zsh completion. + +* Rake + * Rake has been upgraded from 0.8.7 to 0.9.2.2. For full release notes see + https://github.com/jimweirich/rake/blob/master/CHANGES + +* RDoc + * RDoc has been upgraded to version 3.9.4. For full release notes see + http://docs.seattlerb.org/rdoc/History_txt.html + +* rexml + * Support Ruby native encoding mechanism and iconv dependency is dropped. + +* RubyGems + * RubyGems has been upgraded to version 1.8.10. For full release notes see + http://rubygems.rubyforge.org/rubygems-update/History_txt.html + +* stringio + * extended method: + * StringIO#set_encoding can get 2nd argument and optional hash. + +* test/unit + * New arguments: + * -j N, --jobs=N: Allow run N testcases at once. + * --jobs-status: Show status of jobs when parallel running. + * --no-retry: Don't retry testcases which failed when parallel running. + * --ruby=RUBY: path to ruby for job(worker) process. optional. + * --hide-skip: Hide skip messages. You'll see the number of skips at end of + test result. + +* uri + * new methods: + * URI::Generic#hostname + * URI::Generic#hostname= + +* webrick + * new method: + * WEBrick::HTTPRequest#continue for generating '100 continue' response. + * new logging directive: + * %{remote}p for remote (client) port number. + +* yaml + * The default YAML engine is now Psych. You may downgrade to syck by setting + YAML::ENGINE.yamler = 'syck'. + +* zlib + * new methods: + * Zlib.deflate + * Zlib.inflate + +* FileUtils + * extended method: + * FileUtils#chmod supports symbolic mode argument. + +=== Language changes + +* Regexps now support Unicode 6.0. (new characters and scripts) + +* [experimental] Regexps now support Age property. + Unlike Perl, current implementation takes interpretation of the + interpretation of UTS #18. + http://www.unicode.org/reports/tr18/ + +* Turning on/off indentation warnings with directives. + ("# -*- warn-indent: true -*-" / "# -*- warn-indent: false -*-") + +=== Compatibility issues (excluding feature bug fixes) + + * Rational#to_d + + See above. diff --git a/doc/NEWS/NEWS-2.0.0 b/doc/NEWS/NEWS-2.0.0 new file mode 100644 index 0000000000..e070b19976 --- /dev/null +++ b/doc/NEWS/NEWS-2.0.0 @@ -0,0 +1,529 @@ +# -*- rdoc -*- + += NEWS for Ruby 2.0.0 + +This document is a list of user visible feature changes made between +releases except for bug fixes. + +Note that each entry is kept so brief that no reason behind or +reference information is supplied with. For a full list of changes +with all sufficient information, see the ChangeLog file. + +== Changes since the 1.9.3 release + +=== Language changes + +* Added keyword arguments. + +* Added %i and %I for symbol list creation (similar to %w and %W). + +* Default source encoding is changed to UTF-8. (was US-ASCII) + +* No warning for unused variables starting with '_' + +=== Core classes updates (outstanding ones only) + +* ARGF + * added method: + * added ARGF#codepoints and ARGF#each_codepoint, like the corresponding + methods for IO. + +* Array + * added method: + * added Array#bsearch for binary search. + * incompatible changes: + * random parameter of Array#shuffle! and Array#sample now + will be called with one argument, maximum value. + * when given Range arguments, Array#values_at now returns nil for each + value that is out-of-range. + +* Enumerable + * added method: + * added Enumerable#lazy method for lazy enumeration. + +* Enumerator + * added method: + * added Enumerator#size for lazy size evaluation. + * extended method: + * Enumerator.new accept an argument for lazy size evaluation. + * new class Enumerator::Lazy for lazy enumeration + +* ENV + * aliased method: + * ENV.to_h is a new alias for ENV.to_hash + +* Fiber + * incompatible changes: + * Fiber#resume cannot resume a fiber which invokes "Fiber#transfer". + +* File + * extended method: + * File.fnmatch? now expands braces in the pattern if + File::FNM_EXTGLOB option is given. + +* GC + * improvements: + * introduced the bitmap marking which suppresses to copy a memory page + with Copy-on-Write. + * introduced the non-recursive marking which avoids unexpected stack overflow. + +* GC::Profiler + * added method: + * added GC::Profiler.raw_data which returns raw profile data for GC. + +* Hash + * added method: + * added Hash#to_h as explicit conversion method, like Array#to_a. + * extended method: + * Hash#default_proc= can be passed nil to clear the default proc. + +* IO + * deprecated methods: + * IO#lines, #bytes, #chars and #codepoints are deprecated. + +* Kernel + * added method: + * added Kernel#Hash conversion method like Array() or Float(). + * added Kernel#__dir__ which returns the absolute path of the + directory of the file from which this method is called. + * added Kernel#caller_locations which returns an array of + frame information objects. + * extended method: + * Kernel#warn accepts multiple args in like puts. + * Kernel#caller accepts second optional argument `n' which specify + required caller size. + * Kernel#to_enum and enum_for accept a block for lazy size evaluation. + * incompatible changes: + * system() and exec() close non-standard file descriptors + (The default of :close_others option is changed to true by default.) + * respond_to? against a protected method now returns false unless + the second argument is true. + * __callee__ has returned to the original behavior, and now + returns the called name but not the original name in an + aliased method. + * Kernel#inspect does not call #to_s anymore + (it used to call redefined #to_s). + +* LoadError + * added method: + * added LoadError#path method to return the file name that could not be + loaded. + +* Module + * added method: + * added Module#prepend which is similar to Module#include, + however a method in the prepended module overrides the + corresponding method in the prepending module. + * added Module.prepended and Module.prepend_features, similar + to included and append_features. + * added Module#refine, which extends a class or module locally. [experimental] + * extended method: + * Module#define_method accepts a UnboundMethod from a Module. + * Module#const_get accepts a qualified constant string, e.g. + Object.const_get("Foo::Bar::Baz") + +* Mutex + * added method: + * added Mutex#owned? which returns the mutex is held by current + thread or not. [experimental] + * incompatible changes: + * Mutex#lock, Mutex#unlock, Mutex#try_lock, Mutex#synchronize + and Mutex#sleep are no longer allowed to be used from trap handler + and raise a ThreadError in such case. + * Mutex#sleep may spurious wakeup. Check after wakeup. + +* NilClass + * added method: + * added nil.to_h which returns {} + +* ObjectSpace::WeakMap + * new low level class to hold weak references to objects. + +* Proc + * incompatible change: + * removed Proc#== and #eql? so two procs are == only when they are + the same object. + +* Process + * added method: + * added getsid for getting session id (unix only). + +* Range + * added method: + * added Range#size for lazy size evaluation. + * added Range#bsearch for binary search. + +* RubyVM (MRI specific) + * added RubyVM::InstructionSequence.of to get the instruction sequence + from a method or a block. + * added RubyVM::InstructionSequence#path, #absolute_path, #label, + #base_label and #first_lineno to retrieve information from where + the instruction sequence was defined. + * added Environment variables to specify stack usage: + * RUBY_THREAD_VM_STACK_SIZE: vm stack size used at thread creation. + default: 128KB (32bit CPU) or 256KB (64bit CPU). + * RUBY_THREAD_MACHINE_STACK_SIZE: machine stack size used at thread + creation. default: 512KB or 1024KB. + * RUBY_FIBER_VM_STACK_SIZE: vm stack size used at fiber creation. + default: 64KB or 128KB. + * RUBY_FIBER_MACHINE_STACK_SIZE: machine stack size used at fiber + creation. default: 256KB or 512KB. + These variables are checked only at launched time. + * added constant DEFAULT_PARAMS to get above default parameters. + +* Signal + * added method: + * added Signal.signame which returns signal name + + * incompatible changes: + * Signal.trap raises ArgumentError when :SEGV, :BUS, :ILL, :FPE, :VTALRM + are specified. + +* String + * added method: + * added String#b returning a copied string whose encoding is ASCII-8BIT. + * change return value: + * String#lines now returns an array instead of an enumerator. + * String#chars now returns an array instead of an enumerator. + * String#codepoints now returns an array instead of an enumerator. + * String#bytes now returns an array instead of an enumerator. + +* Struct + * added method: + * added Struct#to_h returning values with keys corresponding to the + instance variable names. + +* Thread + * added method: + * added Thread#thread_variable_get for getting thread local variables + (these are different than Fiber local variables). + * added Thread#thread_variable_set for setting thread local variables. + * added Thread#thread_variables for getting a list of the thread local + variable keys. + * added Thread#thread_variable? for testing to see if a particular thread + variable has been set. + * added Thread.handle_interrupt as well as instance and singleton methods + pending_interrupt? for asynchronous handling of exceptions + * added Thread#backtrace_locations which returns similar information of + Kernel#caller_locations. + * new class Thread::Backtrace::Location to hold backtrace location + information. These are returned by Thread#backtrace_locations and + Kernel#caller_locations. + * incompatible changes: + * Thread#join and Thread#value now raises a ThreadError if target thread + is the current or main thread. + +* Time + * change return value: + * Time#to_s now returns US-ASCII encoding instead of BINARY. + +* TracePoint + * new class. This class is replacement of set_trace_func. + Easy to use and efficient implementation. + +* toplevel + * added method: + * added main.define_method which defines a global function. + * added main.using, which imports refinements into the current file or + eval string. [experimental] + +=== Core classes compatibility issues (excluding feature bug fixes) + +* Array#values_at + + See above. + +* String#lines +* String#chars +* String#codepoints +* String#bytes + + These methods no longer return an Enumerator, although passing a + block is still supported for backwards compatibility. + + Code like str.lines.with_index(1) { |line, lineno| ... } no longer + works because str.lines returns an array. Replace lines with + each_line in such cases. + +* IO#lines +* IO#chars +* IO#codepoints +* IO#bytes +* ARGF#lines +* ARGF#chars +* ARGF#bytes +* StringIO#lines +* StringIO#chars +* StringIO#codepoints +* StringIO#bytes +* Zlib::GzipReader#lines +* Zlib::GzipReader#bytes + + These methods are deprecated in favor of each_line, each_byte, + each_char and each_codepoint. + +* Proc#== +* Proc#eql? + + These methods were removed. Two procs are == only when they are + the same object. + +* Fixnum +* Bignum +* Float + + Fixnums, Bignums and Floats are frozen. + +* Signal.trap + + See above. + +* Merge Onigmo. + https://github.com/k-takata/Onigmo + +* The :close_others option is true by default for system() and exec(). + Also, the close-on-exec flag is set by default for all new file descriptors. + This means file descriptors doesn't inherit to spawned process unless + explicitly requested such as system(..., fd=>fd). + +* Kernel#respond_to? against a protected method now returns false + unless the second argument is true. + +* Kernel#respond_to_missing? +* Kernel#initialize_clone +* Kernel#initialize_dup + + These methods are now private. + +* Thread#join, Thread#value + + See above. + +* Mutex#lock, Mutex#unlock, Mutex#try_lock, Mutex#synchronize and Mutex#sleep + + See above. + +=== Stdlib updates (outstanding ones only) + +* cgi + * Add HTML5 tag maker. + * CGI#header has been renamed to CGI#http_header and + aliased to CGI#header. + * When HTML5 tagmaker called, overwrite CGI#header, + CGI#header function is to create a <header> element. + +* CSV + * Removed CSV::dump and CSV::load to protect users from dangerous + serialization vulnerability + +* iconv + * Iconv has been removed. Use String#encode instead. + +* io/console + * new methods: + * added IO#cooked which sets the terminal to cooked mode within the given block. + * added IO#cooked! which sets the terminal to cooked. + * extended method: + * IO#raw, IO#raw!, and IO#getch accept keyword arguments, :min and :time. + +* io/wait + * new features: + * added IO#wait_writable method. + * added IO#wait_readable method as alias of IO#wait. + +* json + * updated to 1.7.7. + +* net/http + * new features: + * Proxies are now automatically detected from the http_proxy environment + variable. See Net::HTTP::new for details. + * gzip and deflate compression are now requested for all requests by + default. See Net::HTTP for details. + * SSL sessions are now reused across connections for a single instance. + This speeds up connection by using a previously negotiated session. + * Requests may be created from a URI which sets the request_uri and host + header of the request (but does not change the host connected to). + * Responses contain the URI requested which allows easier implementation of + redirect following. + * new methods: + * Net::HTTP#local_host + * Net::HTTP#local_host= + * Net::HTTP#local_port + * Net::HTTP#local_port= + * extended method: + * Net::HTTP#connect uses local_host and local_port if specified. + +* net/imap + * new methods: + * Net::IMAP.default_port + * Net::IMAP.default_imap_port + * Net::IMAP.default_tls_port + * Net::IMAP.default_ssl_port + * Net::IMAP.default_imaps_port + +* objspace + * new method: + * ObjectSpace.reachable_objects_from(obj) + +* openssl + * Consistently raise an error when trying to encode nil values. All instances + of OpenSSL::ASN1::Primitive now raise TypeError when calling to_der on an + instance whose value is nil. All instances of OpenSSL::ASN1::Constructive + raise NoMethodError in the same case. Constructing such values is still + permitted. + * TLS 1.1 & 1.2 support by setting OpenSSL::SSL::SSLContext#ssl_version to + :TLSv1_2, :TLSv1_2_server, :TLSv1_2_client or :TLSv1_1, :TLSv1_1_server + :TLSv1_1_client. The version being effectively used can be queried + with OpenSSL::SSL#ssl_version. Furthermore, it is also possible to + blacklist the new TLS versions with OpenSSL::SSL::OP_NO_TLSv1_1 and + OpenSSL::SSL::OP_NO_TLSv1_2. + * Added OpenSSL::SSL::SSLContext#renegotiation_cb. A user-defined callback + may be set which gets called whenever a new handshake is negotiated. This + also allows to programmatically decline (client) renegotiation attempts. + * Support for "0/n" splitting of records as BEAST mitigation via + OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS. + * The default options for OpenSSL::SSL::SSLContext have changed to + OpenSSL::SSL::OP_ALL & ~OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS + instead of OpenSSL::SSL::OP_ALL only. This enables the countermeasure for + the BEAST attack by default. + * OpenSSL requires passwords for decrypting PEM-encoded files to be at least + four characters long. This led to awkward situations where an export with + a password with fewer than four characters was possible, but accessing the + file afterwards failed. OpenSSL::PKey::RSA, OpenSSL::PKey::DSA and + OpenSSL::PKey::EC therefore now enforce the same check when exporting a + private key to PEM with a password - it has to be at least four characters + long. + * SSL/TLS support for the Next Protocol Negotiation extension. Supported + with OpenSSL 1.0.1 and higher. + * OpenSSL::OPENSSL_FIPS allows client applications to detect whether OpenSSL + is FIPS-enabled. OpenSSL.fips_mode= allows turning on and off FIPS mode + manually in order to adapt to situations where FIPS mode would be an + explicit requirement. + * Authenticated Encryption with Associated Data (AEAD) is supported via + Cipher#auth_data= and Cipher#auth_tag/Cipher#auth_tag=. + Currently (OpenSSL 1.0.1c), only GCM mode is supported. + +* ostruct + * new methods: + * OpenStruct#[], []= + * OpenStruct#each_pair + * OpenStruct#eql? + * OpenStruct#hash + * OpenStruct#to_h converts the struct to a hash. + * extended method: + * OpenStruct.new also accepts an OpenStruct / Struct. + +* pathname + * extended method: + * Pathname#find returns an enumerator if no block is given. + +* rake + * rake has been updated to version 0.9.5. + + This version is backwards-compatible with previous rake versions and + contains many bug fixes. + + See + http://rake.rubyforge.org/doc/release_notes/rake-0_9_5_rdoc.html for a list + of changes in rake 0.9.3, 0.9.4 and 0.9.5. + +* RDoc + * RDoc has been updated to version 4.0 + + This version is largely backwards-compatible with previous rdoc versions. + The most notable change is an update to the ri data format (ri data must + be regenerated for gems shared across rdoc versions). Further API changes + are internal and won't affect most users. + + Notable changes include: + + * Page support for ri. Try `ri ruby:` for a list of pages in ruby or + `ri ruby:syntax/literals` for the syntax documentation for literals. + + This also works for gems such as `ri rspec:README` for the rspec gem's + README file. + * Markdown support. See ri RDoc::Markdown for details. + + See https://github.com/rdoc/rdoc/blob/master/History.rdoc for a full list + of changes in rdoc 4.0. + +* resolv + * new methods: + * Resolv::DNS#timeouts= + * Resolv::DNS::Config#timeouts= + +* rexml + * REXML::Document#write supports Hash arguments. + * REXML::Document#write supports new :encoding option. It changes + XML document encoding. Without :encoding option, encoding in + XML declaration is used for XML document encoding. + +* RubyGems + * Updated to 2.0.0 + + RubyGems 2.0.0 features the following improvements: + + * Improved support for default gems shipping with ruby 2.0.0+ + * A gem can have arbitrary metadata through Gem::Specification#metadata + * `gem search` now defaults to --remote and is anchored like gem list. + * Added --document to replace --rdoc and --ri. Use --no-document to + disable documentation, --document=rdoc to only generate rdoc. + * Only ri-format documentation is generated by default. + * `gem server` uses RDoc::Servlet from RDoc 4.0 to generate HTML + documentation. + + For an expanded list of updates and bug fixes see: + https://github.com/rubygems/rubygems/blob/master/History.txt + +* shellwords + * Shellwords#shellescape now stringifies the given object using to_s. + * Shellwords#shelljoin accepts non-string objects in the given + array, each of which is stringified using to_s. + +* stringio + * deprecated methods: + * StringIO#lines, #bytes, #chars and #codepoints are deprecated. + +* syslog + * Added Syslog::Logger which provides a Logger API atop Syslog. + * Syslog::Priority, Syslog::Level, Syslog::Option and Syslog::Macros + are introduced for easy detection of available constants on a + running system. + +* tmpdir + * incompatible changes: + * Dir.mktmpdir uses FileUtils.remove_entry instead of + FileUtils.remove_entry_secure. This means that applications should not + change the permission of the created temporary directory to make + writable from other users. + +* yaml + * Syck has been removed. YAML now completely depends on libyaml being + installed. + * libyaml is now bundled with ruby, for cases where the library is not + installed locally. + +* zlib + * Added streaming support for Zlib::Inflate and Zlib::Deflate. This allows + processing of a stream without the use of large amounts of memory. + * Added support for the new deflate strategies Zlib::RLE and Zlib::FIXED. + * Zlib streams are now processed without the GVL. This allows gzip, zlib and + deflate streams to be processed in parallel. + * deprecated methods: + * Zlib::GzipReader#lines and #bytes are deprecated. + +=== Stdlib compatibility issues (excluding feature bug fixes) + +* OpenStruct new methods can conflict with custom attributes named + "each_pair", "eql?", "hash" or "to_h". + +* Dir.mktmpdir in lib/tmpdir.rb + + See above. + +=== C API updates + +* NUM2SHORT() and NUM2USHORT() added. They are similar to NUM2INT, but short. + +* rb_newobj_of() and NEWOBJ_OF() added. They create a new object of a given class. diff --git a/doc/NEWS/NEWS-2.1.0 b/doc/NEWS/NEWS-2.1.0 new file mode 100644 index 0000000000..26f2374e94 --- /dev/null +++ b/doc/NEWS/NEWS-2.1.0 @@ -0,0 +1,376 @@ +# -*- rdoc -*- + += NEWS for Ruby 2.1.0 + +This document is a list of user visible feature changes made between +releases except for bug fixes. + +Note that each entry is kept so brief that no reason behind or +reference information is supplied with. For a full list of changes +with all sufficient information, see the ChangeLog file. + +== Changes since the 2.0.0 release + +=== Language changes + +* Now the default values of keyword arguments can be omitted. Those + "required keyword arguments" need giving explicitly at the call time. + +* Added suffixes for integer and float literals: 'r', 'i', and 'ri'. + * "42r" and "3.14r" are evaluated as Rational(42, 1) and 3.14.rationalize, + respectively. But exponential form with 'r' suffix like "6.022e+23r" is + not accepted because it is misleading. + * "42i" and "3.14i" are evaluated as Complex(0, 42) and Complex(0, 3.14), + respectively. + * "42ri" and "3.14ri" are evaluated as Complex(0, 42r) and Complex(0, 3.14r), + respectively. + +* def-expr now returns the symbol of its name instead of nil. + +=== Core classes updates (outstanding ones only) + +* Array + * New methods + * Array#to_h converts an array of key-value pairs into a Hash. + +* Binding + * New methods + * Binding#local_variable_get(symbol) + * Binding#local_variable_set(symbol, obj) + * Binding#local_variable_defined?(symbol) + +* Enumerable + * New methods + * Enumerable#to_h converts a list of key-value pairs into a Hash. + +* Exception + * New methods + * Exception#cause provides the previous exception which has been caught + at where raising the new exception. + +* GC + * improvements: + * introduced the generational GC a.k.a RGenGC. + * added environment variables: + * RUBY_GC_HEAP_INIT_SLOTS + * RUBY_GC_HEAP_FREE_SLOTS + * RUBY_GC_HEAP_GROWTH_FACTOR + * RUBY_GC_HEAP_GROWTH_MAX_SLOTS + * RUBY_GC_MALLOC_LIMIT_MAX + * RUBY_GC_MALLOC_LIMIT_GROWTH_FACTOR + * RUBY_GC_OLDMALLOC_LIMIT + * RUBY_GC_OLDMALLOC_LIMIT_MAX + * RUBY_GC_OLDMALLOC_LIMIT_GROWTH_FACTOR + * obsoleted environment variables: + * RUBY_FREE_MIN (Use RUBY_GC_HEAP_FREE_SLOTS instead) + * RUBY_HEAP_MIN_SLOTS (Use RUBY_GC_HEAP_INIT_SLOTS instead) + +* Integer + * New methods + * Fixnum#bit_length + * Bignum#bit_length + * Bignum performance improvement + * Use GMP if available. + GMP is used only for several operations: + multiplication, division, radix conversion, GCD + +* IO + * extended methods: + * IO#seek supports SEEK_DATA and SEEK_HOLE as whence. + * IO#seek accepts symbols (:CUR, :END, :SET, :DATA, :HOLE) for 2nd argument. + * IO#read_nonblock accepts optional `exception: false` to return symbols + * IO#write_nonblock accepts optional `exception: false` to return symbols + +* Kernel + * New methods: + * Kernel#singleton_method + +* Module + * New methods: + * Module#using, which activates refinements of the specified module only + in the current class or module definition. + * Module#singleton_class? returns true if the receiver is a singleton class + or false if it is an ordinary class or module. + * extended methods: + * Module#refine is no longer experimental. + * Module#include and Module#prepend are now public methods. + +* Mutex + * misc + * Mutex#owned? is no longer experimental. + +* Numeric + * extended methods: + * Numeric#step allows the limit argument to be omitted, in which + case an infinite sequence of numbers is generated. Keyword + arguments `to` and `by` are introduced for ease of use. + `by` can be 0, in which case the same value will be generated + indefinitely. + +* Process + * New methods: + * alternative methods to $0/$0=: + * Process.argv0() returns the original value of $0. + * Process.setproctitle() sets the process title without affecting $0. + * Process.clock_gettime + * Process.clock_getres + +* String + * "literal".freeze is now optimized to return the same object + * New methods: + * String#scrub and String#scrub! verify and fix invalid byte sequence. + If you want to use this function with older Ruby, + consider to use string-scrub.gem. + +* Symbol + * All symbols are now frozen. + +* pack/unpack (Array/String) + * Q! and q! directives for long long type if platform has the type. + +* toplevel + * extended methods: + * main.using is no longer experimental. The method activates refinements + in the ancestors of the argument module to support refinement + inheritance by Module#include. + +=== Core classes compatibility issues (excluding feature bug fixes) + +* Hash + * incompatible changes: + * Hash#reject will return plain Hash object in the future versions, that + is the original object's subclass, instance variables, default value, + and taintedness will be no longer copied, so now warnings are emitted + when called with such Hash. + +* IO + * incompatible changes: + * open ignore internal encoding if external encoding is ASCII-8BIT. + +* Kernel#eval, Kernel#instance_eval, and Module#module_eval. + * Copies the scope information of the original environment, which means + that private, protected, public, and module_function without arguments + do not affect the environment outside the eval string. + For example, `class Foo; eval "private"; def foo; end; end' doesn't make + Foo#foo private. + +* Kernel#untrusted?, untrust, and trust + * These methods are deprecated and their behavior is the same as tainted?, + taint, and untaint, respectively. If $VERBOSE is true, they show warnings. + +* Module#ancestors + * The ancestors of a singleton class now include singleton classes, + in particular itself. + +* Module#define_method and Object#define_singleton_method + * Now they return the symbols of the defined methods, not the methods/procs + themselves. + +* Numeric#quo + * Raises TypeError instead of ArgumentError if the receiver doesn't have + to_r method. + +* Proc + * Returning from lambda proc now always exits from the Proc, not from the + method where the lambda is created. Returning from non-lambda proc exits + from the method, same as the former behavior. + +String + * If invalid: :replace is specified for String#encode, replace + invalid byte sequence even if the destination encoding equals to + the source encoding. + +=== Stdlib updates (outstanding ones only) + +* CGI::Util + * All class methods modulized. + +* Digest + * extended methods: + * Digest::Class.file takes optional arguments for its constructor + +* Matrix + * Added Vector#cross_product. + +* Net::SMTP + * Added Net::SMTP#rset to implement the RSET command + +* objspace + * new method: + * ObjectSpace.trace_object_allocations + * ObjectSpace.trace_object_allocations_start + * ObjectSpace.trace_object_allocations_stop + * ObjectSpace.trace_object_allocations_clear + * ObjectSpace.allocation_sourcefile + * ObjectSpace.allocation_sourceline + * ObjectSpace.allocation_class_path + * ObjectSpace.allocation_method_id + * ObjectSpace.allocation_generation + * ObjectSpace.reachable_objects_from_root + * ObjectSpace.dump + * ObjectSpace.dump_all + +* OpenSSL::BN + * extended methods: + * OpenSSL::BN.new allows Fixnum/Bignum argument. + +* open-uri + * Support multiple fields with same field name (like Set-Cookie). + +* Pathname + * New methods: + * Pathname#write + * Pathname#binwrite + +* rake + * Updated to 10.1.0. Major changes include removal of the class namespace, + Rake::DSL to hold the rake DSL methods and removal of support for legacy + rake features. + + For a complete list of changes since rake 0.9.6 see: + + http://rake.rubyforge.org/doc/release_notes/rake-10_1_0_rdoc.html + + http://rake.rubyforge.org/doc/release_notes/rake-10_0_3_rdoc.html + +* RbConfig + * New constants: + * RbConfig::SIZEOF is added to provide the size of C types. + +* RDoc + * Updated to 4.1.0. Major enhancements include a modified default template + * and accessibility enhancements. + + For a list of minor enhancements and bug fixes see: + https://github.com/rdoc/rdoc/blob/v4.1.0.preview.1/History.rdoc + +* Resolv + * New methods: + * Resolv::DNS.fetch_resource + * One-shot multicast DNS support + * Support LOC resources + +* REXML::Parsers::SAX2Parser + * Fixes wrong number of arguments of entitydecl event. Document of the event + says "an array of the entity declaration" but implementation passes two + or more arguments. It is an implementation bug but it breaks backward + compatibility. + +* REXML::Parsers::StreamParser + * Supports "entity" event. + +* REXML::Text + * REXML::Text#<< supports method chain like 'text << "XXX" << "YYY"'. + * REXML::Text#<< supports not "raw" mode. + +* Rinda::RingServer, Rinda::RingFinger + * Rinda now supports multicast sockets. See Rinda::RingServer and + Rinda::RingFinger for details. + +* RubyGems + * Updated to 2.2.0. Notable new features include: + + * Gemfile or gem.deps.rb support including Gem.file.lock (experimental) + * Improved, iterative resolver (compared to RubyGems 2.1 and earlier) + * Support for a sharing a GEM_HOME across ruby platforms and versions + + For a complete list of enhancements and bug fixes see: + https://github.com/rubygems/rubygems/tree/master/History.txt + +* Set + * New methods: + * Set#intersect? + * Set#disjoint? + +* Socket + * New methods: + * Socket.getifaddrs + +* StringScanner + * extended methods: + * StringScanner#[] supports named captures. + +* Syslog::Logger + * Added facility. + +* Tempfile + * New methods: + * Tempfile.create + +* Timeout + * The exception to terminate the given block can no longer be rescued + inside the block, by default, unless the exception class is given + explicitly. + +* TSort + * New methods: + * TSort.tsort + * TSort.tsort_each + * TSort.strongly_connected_components + * TSort.each_strongly_connected_component + * TSort.each_strongly_connected_component_from + +* WEBrick + * The body of a response may now be a StringIO or other IO-like that responds + to #readpartial and #read. + +* XMLRPC::Client + * New methods: + * XMLRPC::Client#http. It returns Net::HTTP for the client. Normally, + it is not needed. It is useful when you want to change minor HTTP client + options. You can change major HTTP client options by XMLRPC::Client + methods. You should use XMLRPC::Client methods for changing major + HTTP client options instead of XMLRPC::Client#http. + +=== Stdlib compatibility issues (excluding feature bug fixes) + +* Set + * incompatible changes: + * Set#to_set now returns self instead of generating a copy. + +* URI + * incompatible changes: + * URI.decode_www_form follows current WHATWG URL Standard. + It gets encoding argument to specify the character encoding. + It now allows loose percent encoded strings, but denies ;-separator. + * URI.encode_www_form follows current WHATWG URL Standard. + It gets encoding argument to convert before percent encode. + UTF-16 strings aren't converted to UTF-8 before percent encode by default. + +* curses + * Removed. + curses is now available as a gem. + See https://rubygems.org/gems/curses for details. + +=== Built-in global variables compatibility issues + +* $SAFE + * $SAFE=4 is obsolete. If $SAFE is set to 4 or larger, an ArgumentError + is raised. + +=== C API updates + +* rb_gc_set_params() is deprecated. This is only used in Ruby internal. + +* rb_gc_count() added. This returns the number of times GC occurred. + +* rb_gc_stat() added. This allows access to specific GC.stat() values from C + without any allocation overhead. + +* rb_gc_latest_gc_info() added. This allows access to GC.latest_gc_info(). + +* rb_postponed_job_register() added. Takes a function callback which is invoked + when the VM is in a consistent state, i.e. to perform work from a C signal + handler. + +* rb_profile_frames() added. Provides low-cost access to the current ruby stack + for callstack profiling. + +* rb_tracepoint_new() supports new internal events accessible only from C: + * RUBY_INTERNAL_EVENT_NEWOBJ + * RUBY_INTERNAL_EVENT_FREEOBJ + * RUBY_INTERNAL_EVENT_GC_START + * RUBY_INTERNAL_EVENT_GC_END_MARK + * RUBY_INTERNAL_EVENT_GC_END_SWEEP + * Note that you *can not* specify "internal events" with normal events + (such as RUBY_EVENT_CALL, RUBY_EVENT_RETURN) simultaneously. diff --git a/doc/NEWS/NEWS-2.2.0 b/doc/NEWS/NEWS-2.2.0 new file mode 100644 index 0000000000..8b2bd0ba0a --- /dev/null +++ b/doc/NEWS/NEWS-2.2.0 @@ -0,0 +1,359 @@ +# -*- rdoc -*- + += NEWS for Ruby 2.2.0 + +This document is a list of user visible feature changes made between +releases except for bug fixes. + +Note that each entry is kept so brief that no reason behind or +reference information is supplied with. For a full list of changes +with all sufficient information, see the ChangeLog file. + +== Changes since the 2.1.0 release + +=== Language changes + +* nil/true/false + * nil/true/false objects are frozen. [Feature #8923] + +* Hash literal + * Symbol key followed by a colon can be quoted. [Feature #4276] + +* default argument + fixed a very longstanding bug that an optional argument was not + accessible in its default value expression. [Bug #9593] + +=== Core classes updates (outstanding ones only) + +* Binding + * New methods: + * Binding#local_variables + * Binding#receiver + +* Dir + * New methods: + * Dir#fileno + +* Enumerable + * New methods: + * Enumerable#slice_after + * Enumerable#slice_when + * Extended methods: + * min, min_by, max and max_by supports optional argument to return + multiple elements. + +* Float + * New methods: + * Float#next_float + * Float#prev_float + +* File + * New methods: + * File.birthtime + * File#birthtime + +* File::Stat + * New methods: + * File::Stat#birthtime + +* GC + * GC.latest_gc_info returns :state to represent current GC status. + * Improvements + * Introduce incremental marking for major GC. [Feature #10137] + +* IO + * Improvements + * IO#read_nonblock and IO#write_nonblock for pipes on Windows are supported. + +* Kernel + * New methods: + * Kernel#itself + * Improvements + * Kernel#throw raises UncaughtThrowError, subclass of ArgumentError when + there is no corresponding catch block, instead of ArgumentError. + +* Process + * Extended method: + * Process execution methods such as Process.spawn opens the file in write + mode for redirect from [:out, :err]. + +* String + * New methods: + * String#unicode_normalize + * String#unicode_normalize! + * String#unicode_normalized? + +* Symbol + * Improvements + * Most symbols which are returned by String#to_sym and + String#intern are GC-able. + +* Method + * New methods: + * Method#curry([ arity ]) returns a curried Proc. + * Method#super_method returns a Method of superclass, which would be called + when super is used. + +=== Core classes compatibility issues (excluding feature bug fixes) + +* Enumerable + * Enumerable#slice_before's state management deprecated. + * Enumerable#chunk's state management deprecated. + +* GC + * incompatible changes: + * Rename GC.stat entries. [Feature #9924] + See https://docs.google.com/spreadsheets/d/11Ua4uBr6o0k-nORrZLEIIUkHJ9JRzRR0NyZfrhEEnc8/edit?usp=sharing + +* Hash + * incompatible changes: + * Change overriding policy for duplicated key. [Bug #10315] + { **hash1, **hash2 } contains values of hash2 for duplicated keys. + +* IO + * incompatible changes: + * When flushing file IO with IO#flush, you cannot assume that the metadata + of the file is updated immediately. On some platforms (especially + Windows), it is delayed until the filesystem load is decreased. + Use IO#fsync if you want to guarantee updating metadata. + +* Math + * incompatible changes: + * Math.log now raises Math::DomainError instead of returning NaN if the + base is less than 0, and returns NaN instead of -infinity if both of + two arguments are 0. + * Math.atan2 now returns values like as expected by C99 if both two + arguments are infinity. + +* Proc + * incompatible changes: + * ArgumentError is no longer raised when lambda Proc is passed as a + block, and the number of yielded arguments does not match the formal + arguments of the lambda, if just an array is yielded and its length + matches. + +* Process + * Process execution methods such as Process.spawn opens the file in write + mode for redirect from [:out, :err]. + Before Ruby 2.2, it was opened in read mode. + +=== Stdlib updates (outstanding ones only) + +* Continuation + * callcc is obsolete. use Fiber instead. + +* Digest + + * Digest() should now be thread-safe. If you have a problem with + regard to on-demand loading under a multi-threaded environment, + preload "digest/*" modules on boot or use this method instead of + directly referencing Digest::*. + * Digest::HMAC has been removed just as previously noticed. + +* DL + * DL has been removed from stdlib. Please use Fiddle instead! + +* Etc + * New methods: + * Etc.uname + * Etc.sysconf + * Etc.confstr + * IO#pathconf + * Etc.nprocessors + +* Find, Pathname + * Extended methods: + * find method accepts "ignore_error" keyword argument. + +* Matrix + * New methods: + * Matrix#first_minor(row, column) returns the submatrix obtained + by deleting the specified row and column. + * Matrix#cofactor(row, column) returns the (row, column) cofactor + which is obtained by multiplying the first minor by (-1)**(row + column). + * Matrix#adjugate returns the adjugate of the matrix. + * hstack and vstack are new instance and class methods to stack matrices + horizontally and vertically. + * Matrix#laplace_expansion(row_or_column: num) returns the laplace_expansion + along the +num+ -th row or column. + * Vector.basis(size:, index:) returns the specified basis vector. + * Unary - and + added for Vector and Matrix. + * Vector#cross_product generalized to arbitrary dimensions. + * Vector#dot and #cross are aliases for #inner_product and #cross_product. + * Vector#angle_with returns the angle with its argument + * New instance and class method independent? to test linear independence. + +* Pathname + * Pathname#/ is aliased to Pathname#+. + * New methods: + * Pathname#birthtime + +* Rake + * Updated to Rake 10.4.0. For full release notes see: + + http://docs.seattlerb.org/rake/History_rdoc.html#label-10.4.0 + +* RubyGems + * Updated to RubyGems 2.4.2. For full release notes see: + + http://docs.seattlerb.org/rubygems/History_txt.html#label-2.4.2+%2F+2014-10-01 + +* TSort + * TSort.tsort_each, TSort.each_strongly_connected_component and + TSort.each_strongly_connected_component_from returns an enumerator if + no block given. + +* XMLRPC + * Added new parser class named LibXMLStreamParser. + +=== Stdlib compatibility issues (excluding feature bug fixes) + +* lib/mathn.rb + * Show deprecated warning [Feature #10169] + +* ext/date/lib/date/format.rb + * Removed because it's empty file. + +* Digest + * Digest::HMAC has finally ceased to exist. Use OpenSSL::HMAC or an external gem instead. + +* time.rb + * Time.parse, Time.strptime, Time.rfc2822, Time.xmlschema may produce + fixed-offset Time objects. + It is happen when usual localtime doesn't preserve the offset from UTC. + * Time.httpdate produces always UTC Time object. + * Time.strptime raises ArgumentError when no date information. + +* lib/rational.rb + * Removed because it is deprecated from 2009. + +* lib/complex.rb + * Removed because it is deprecated from 2009. + +* lib/prettyprint.rb + * Removed PrettyPrint#first? + +* lib/minitest/*.rb + * Removed because it conflicts to minitest 5. [Feature #9711] + +* lib/test/**/*.rb + * Removed because it conflicts to minitest 5, and it was just an wrapper + of minitest 4. [Feature #9711] + +* lib/uri + * support RFC 3986. [Feature #2542] + +* GServer + * GServer is extracted to gserver gem. It's unmaintain code. + +* Logger + * Logger::Application is extracted to logger-application gem. It's unmaintain code. + +* ObjectSpace (after requiring "objspace") + * ObjectSpace.memsize_of(obj) returns a size includes sizeof(RVALUE). [Bug #8984] + +* Prime + * incompatible changes: + * Prime.prime? now returns false for negative numbers. This method + should not be used to know the number is composite or not. [Bug #7395] + +* Psych + * Removed Psych::EngineManager [Bug #8344] + +=== Built-in global variables compatibility issues + +=== C API updates + +* Deprecated APIs removed. [Feature #9502] + + Check_SafeStr -> SafeStringValue + rb_check_safe_str -> SafeStringValue + rb_quad_pack -> rb_integer_pack + rb_quad_unpack -> rb_integer_unpack + rb_read_check : access struct FILE internal. no replacement. + rb_struct_iv_get : internal function. no replacement. + struct rb_blocking_region_buffer : internal type. no replacement. + rb_thread_blocking_region_begin -> rb_thread_call_without_gvl family + rb_thread_blocking_region_end -> rb_thread_call_without_gvl family + TRAP_BEG -> rb_thread_call_without_gvl family + TRAP_END -> rb_thread_call_without_gvl family + rb_thread_select -> rb_thread_fd_select + struct rb_exec_arg : internal type. no replacement. + rb_exec : internal function. no replacement. + rb_exec_arg_addopt : internal function. no replacement. + rb_exec_arg_fixup : internal function. no replacement. + rb_exec_arg_init : internal function. no replacement. + rb_exec_err : internal function. no replacement. + rb_fork : internal function. no replacement. + rb_fork_err : internal function. no replacement. + rb_proc_exec_n : internal function. no replacement. + rb_run_exec_options : internal function. no replacement. + rb_run_exec_options_err : internal function. no replacement. + rb_thread_blocking_region -> rb_thread_call_without_gvl family + rb_thread_polling -> rb_thread_wait_for + rb_big2str0 : internal function. no replacement. + rb_big2ulong_pack -> rb_integer_pack + rb_gc_set_params : internal function. no replacement. + rb_io_mode_flags -> rb_io_modestr_fmode + rb_io_modenum_flags -> rb_io_oflags_fmode + +* struct RBignum is hidden. [Feature #6083] + Use rb_integer_pack and rb_integer_unpack instead. + +* struct RRational is hidden. [Feature #9513] + Use rb_rational_num and rb_rational_den instead. + +* rb_big_new and rb_big_resize takes a size_t instead of long. + +* rb_num2long returns a long instead of SIGNED_VALUE. + +* rb_num2ulong returns an unsigned long instead of VALUE. + +* st hash table uses power-of-two sizes for speed [Feature #9425]. + Lookups are 10-25% faster if using appropriate hash functions. + However, weaknesses in hash distribution can no longer be masked + by prime number-sized tables, so extensions may need to tweak + hash functions to ensure good distribution. + +* rb_sym2str() added. This is almost same as `rb_id2str(SYM2ID(sym))` + but not pinning a dynamic symbol. + +* rb_str_cat_cstr() added. This is the same as `rb_str_cat2()`. + +* `rb_str_substr()` and `rb_str_subseq()` will share middle of a string, + but not only the end of a string, in the future. Therefore, result + strings may not be NUL-terminated, `StringValueCStr()` is needed + calling to obtain a NUL-terminated C string. + +* rb_tracepoint_new() supports new internal events accessible only from C: + * RUBY_INTERNAL_EVENT_GC_ENTER + * RUBY_INTERNAL_EVENT_GC_EXIT + r47528 + +* rb_hash_delete() now does not call the block given to the current method. + +* rb_extract_keywords() and rb_get_kwargs() exported. See README.EXT + for details. + +=== Build system updates + +* jemalloc is optionally supported via `./configure --with-jemalloc` + jemalloc may be suitable when system malloc is slow or prone + to fragmentation. [Feature #9113] + +=== Implementation changes + +* GC + * Most symbols which are returned by String#to_sym and + String#intern are GC-able [Feature #9634] + * Introduce incremental marking for major GC. [Feature #10137] + * Enable lazy sweep on GC caused by malloc(). + +* VM + * Use frozen string literals for Hash#[] and Hash#[]= + * Fast keyword arguments passing [Feature #10440] + * Allow to receive huge splatted array by a rest argument [Feature #10440] + +* Process + * Process creation methods, such as spawn(), uses vfork() system call. + vfork() is faster than fork() when the parent process uses huge memory. diff --git a/doc/NEWS/NEWS-2.3.0 b/doc/NEWS/NEWS-2.3.0 new file mode 100644 index 0000000000..065515257e --- /dev/null +++ b/doc/NEWS/NEWS-2.3.0 @@ -0,0 +1,384 @@ +# -*- rdoc -*- + += NEWS for Ruby 2.3.0 + +This document is a list of user visible feature changes made between +releases except for bug fixes. + +Note that each entry is kept so brief that no reason behind or +reference information is supplied with. For a full list of changes +with all sufficient information, see the ChangeLog file or Redmine +(e.g. <tt>https://bugs.ruby-lang.org/issues/$FEATURE_OR_BUG_NUMBER</tt>) + +== Changes since the 2.2.0 release + +=== Language changes + +* frozen-string-literal pragma: + + * new pragma, frozen-string-literal has been experimentally introduced. [Feature #8976] + * besides, --enable/--disable=frozen-string-literal options also have + been introduced. [Feature #8976] + * command line options --debug or --debug=frozen-string-literal enable + additional debugging mode which shows created location with at frozen + object error (RuntimeError). [Feature #11725] + +* safe navigation operator: + + * new method call syntax, `object&.foo', method #foo is called on + `object' if it is not nil. [Feature #11537] + + This is similar to `try!' in Active Support, except: + * method name is syntactically required + obj.try! {} # valid + obj&. {} # syntax error + * arguments are evaluated only if a call is made: + obj.try!(:foo, bar()) # bar() is always evaluated + obj&.foo(bar()) # bar() is conditionally evaluated + * attribute assignment is valid + obj&.attr += 1 + +* the did_you_mean gem: + + * When a NameError or NoMethodError occurs because of a typo in the name, + the did_you_mean gem automatically suggests other names similar to the + method name. + + "Yuki".starts_with?("Y") + # => NoMethodError: undefined method `starts_with?' for "Yuki":String + # Did you mean? start_with? + +* indented here document: + + * new string literal, here document starts with `<<~`. + refer doc/syntax/literals.rdoc for more details. [Feature #9098] + +=== Core classes updates (outstanding ones only) + +* ARGF + + * ARGF.read_nonblock supports `exception: false' like IO#read_nonblock. [Feature #11358] + +* Array + + * Array#bsearch_index [Feature #10730] + * Array#dig [Feature #11643] + +* Comparable + + * Comparable#== no longer rescues exceptions [Feature #7688] + +* Encoding + + * new Encoding::IBM037 (alias ebcdic-cp-us; dummy) + +* Enumerable + + * Enumerable#grep_v is added as inverse version of Enumerable#grep. [Feature #11049] + * Enumerable#chunk_while [Feature #10769] + +* Enumerator::Lazy + + * Enumerator::Lazy#grep_v [Feature #11773] + +* File + + * File.mkfifo [Feature #11536] + * Add File::TMPFILE corresponding to O_TMPFILE + +* Hash + + * Hash#fetch_values [Feature #10017] + * Hash#dig [Feature #11643] + * Hash#<=, Hash#<, Hash#>=, Hash#> [Feature #10984] + * Hash#to_proc [Feature #11653] + +* IO + + * new mode flag File::SHARE_DELETE is available. + this flag means to permit deleting opened file on Windows, but currently + this affect only files opened as binary. [Feature #11218] + + * new option parameter `flags' is added. + this parameter is bitwise-ORed to oflags generated by normal mode argument. [Feature #11253] + + * IO#advise no longer raises Errno::ENOSYS in cases where it was + detected at build time but not available at runtime. [Feature #11806] + +* Kernel + + * Kernel#loop, when stopped by a StopIteration exception, returns + what the enumerator has returned instead of nil. [Feature #11498] + +* Module + * Module#deprecate_constant [Feature #11398] + +* NameError + * NameError#receiver is added to take the receiver object. [Feature #10881] + +* Numeric + + * Numeric#positive? and Numeric#negative? are added, which return + true when the receiver is positive and negative respectively. [Feature #11151] + +* Proc + + * Proc#call (and also #[], #===, #yield) are optimized. + Backtrace doesn't show each method (show block lines directly). + TracePoint also ignores these calls. [Feature #11569] + +* Queue (Thread::Queue) + + * Queue#close is added to notice a termination. [Feature #10600] + +* Regexp/String: Updated Unicode version from 7.0.0 to 8.0.0 + +* RubyVM::InstructionSequence + * add the following methods as a primitive tool of iseq loader. + See sample/iseq_loader.rb for usage. + Note that loader does not have verifier so it is easy to cause + critical problem by loading modified/broken binary data. + See [Feature #11788] for more details. (experimental feature) + * RubyVM::InstructionSequence#to_binary(extra_data = nil) + * RubyVM::InstructionSequence.load_from_binary(binary) + * RubyVM::InstructionSequence.load_from_binary_extra_data(binary) + +* String + + * String#+@ and String#-@ are added to get mutable/frozen strings. [Feature #11782] + + * String.new now accepts new option parameter `encoding'. [Feature #11785] + +* Struct + * Struct#dig [Feature #11688] + +* Thread + * Thread#name, Thread#name= are added to handle thread names [Feature #11251] + +=== Core classes compatibility issues (excluding feature bug fixes) + +* Array + * Array#select!, Array#keep_if, Array#reject!, and Array#delete_if + no longer changes the receiver array instantly every time the + block is called. [Feature #10714] + + * Array#flatten and Array#flatten! no longer try to call #to_ary + method on elements beyond the given level. [Bug #10748] + + * Array#inspect doesn't raise error even if its content returns + a string which is not compatible with Encoding.default_external + as inspected result. [Feature #11801] + +* Enumerable + * Enumerable#chunk and Enumerable#slice_before no longer takes the + initial_state argument. [Feature #10958] + Use a local variable instead to maintain a state. + +* File::Stat + * On Windows File::Stat#ino always returned 0, but now returns + BY_HANDLE_FILE_INFORMATION.nFileIndexHigh/Low. [Feature #11216] + +* Hash + * Hash#inspect doesn't raise error even if its content returns + a string which is not compatible with Encoding.default_external + as inspected result. [Feature #11801] + +* IO + * IO#close doesn't raise when the IO object is closed. [Feature #10718] + * IO#each_codepoint raises an exception at incomplete character + before EOF when conversion takes place. [Bug #11444] + +* Module + * Module#define_method and Object.define_singleton_method now + require method body, Proc, Method, or a block, and raise + ArgumentError if no block is given directly. [Bug #11283] + +* pack/unpack (Array/String) + * j and J directives for pointer width integer type. [Feature #11215] + + +=== Stdlib updates (outstanding ones only) + +* Logger + + * Logger#level= now supports symbol and string levels such as :debug, :info, + :warn, :error, :fatal (case insensitive) [Feature #11695] + * Logger#reopen is added to reopen a log device. [Feature #11696] + +* io/wait + * IO#wait_readable no longer checks FIONREAD, it may be used for + non-bytestream IO such as listen sockets. + +* Net::FTP + * Net::FTP#mlst is added. + * Net::FTP#mlsd is added. + +* nkf + * Merge nkf 2.1.4. + +* ObjectSpace (objspace) + * ObjectSpace.count_symbols is added. + * ObjectSpace.count_imemo_objects is added. + * ObjectSpace.internal_class_of is added. + * ObjectSpace.internal_super_of is added. + +* OpenSSL + * OpenSSL::SSL::SSLSocket#accept_nonblock and + OpenSSL::SSL::SSLSocket#connect_nonblock supports `exception: false`. [Feature #10532] + +* Pathname + * Pathname#descend and Pathname#ascend supported blockless form. [Feature #11052] + +* Socket + * Socket#connect_nonblock, Socket#accept_nonblock, + TCPServer#accept_nonblock, UNIXServer#accept_nonblock, + BasicSocket#recv_nonblock, BasicSocket#recvmsg_nonblock, + BasicSocket#sendmsg_nonblock all support `exception: false` to return + :wait_readable or :wait_writable symbols instead of raising + IO::WaitReadable or IO::WaitWritable exceptions [Feature #10532] [Feature #11229] + * BasicSocket#recv and BasicSocket#recv_nonblock allow an output + String buffer argument like IO#read and IO#read_nonblock to reduce + GC overhead [Feature #11242] + +* StringIO + * In read-only mode, StringIO#set_encoding no longer sets the encoding + of its buffer string. Setting the encoding of the string directly + without StringIO#set_encoding may cause unpredictable behavior now. [Bug #11827] + +* timeout + * Object#timeout is now warned as deprecated when called. + +=== Stdlib compatibility issues (excluding feature bug fixes) + +* ext/coverage/coverage.c + * Coverage.peek_result: new method to allow coverage to be captured without + stopping the coverage tool. [Feature #10816] + +* Fiddle + * Fiddle::Function#call releases the GVL. [Feature #11607] + +* io-console + * Update to io-console 0.4.5, and change the license to BSD 2-clause + "Simplified" License. + +* lib/base64.rb + * Base64.urlsafe_encode64: added a "padding" option to suppress + the padding character ("="). [Feature #10740] + * Base64.urlsafe_decode64: now it accepts not only correctly-padded + input but also unpadded input. [Feature #10740] + +* lib/drb/drb.rb + * removed unused argument. https://github.com/ruby/ruby/pull/515 + +* lib/matrix.rb + * Add Vector#round. https://github.com/ruby/ruby/pull/802 + +* lib/webrick/utils.rb + * removed unused argument. https://github.com/ruby/ruby/pull/356 + +* Net::FTP + * Connections are in passive mode per default now. The default mode can + be changed by Net::FTP.default_passive=. [Feature #11612] + +* Net::HTTP + * default value of Net::HTTP#open_timeout is now 60 (was nil). + +* Net::Telnet + * Net::Telnet is extracted to net-telnet gem. It's unmaintain code. [Feature #11083] + +* Psych + * Updated to Psych 2.0.17 + +* Rake + * Rake is removed from stdlib. [Feature #11025] + +* RDoc + * Updated to RDoc 4.2.1. For full release notes see: + + https://github.com/rdoc/rdoc/blob/master/History.rdoc#421--2015-12-22 + +* RubyGems + * Updated to RubyGems 2.5.1. For full release notes see: + + http://docs.seattlerb.org/rubygems/History_txt.html#label-2.5.0+-2F+2015-11-03 + and + http://docs.seattlerb.org/rubygems/History_txt.html#label-2.5.1+-2F+2015-12-10 + +=== Built-in global variables compatibility issues + +* $SAFE + * $SAFE=2 and $SAFE=3 are obsolete. If $SAFE is set to 2 or larger, + an ArgumentError is raised. [Feature #5455] + +=== C API updates + +* rb_define_class_id_under() now raises a TypeError exception when the + class is already defined but its superclass does not match the given + superclass, as well as definitions in ruby level. + +* rb_timespec_now() is added to fetch current datetime as struct timespec. [Feature #11558] + +* rb_time_timespec_new() is added to create a time object with epoch, + nanosecond, and UTC/localtime/time offset arguments. [Feature #11558] + +* rb_autoload() deprecated, use rb_funcall() instead. [Feature #11664] + +* rb_compile_error_with_enc(), rb_compile_error(), and rb_compile_bug() + deprecated. these functions are exposed but only for internal use. + external libraries should not use them. + +=== Supported platform changes + +* OS/2 is no longer supported + +* BeOS is no longer supported + +* Borland-C is no longer supported + +* Haiku now stable and best effort + +=== Implementation improvements + +* Optimize Proc#call to eliminate method frame construction. [Feature #11569] + +* Reconsidering method entry data structure. [Bug #11278] + +* Introducing new table data structure for ID keys tables used by + method table and so on. New table structure is simple and fast + than st_table. [Feature #11420] + +* Machine code level tuning for object allocation and method calling + code. r52099, r52254 + +* RubyVM::InstructionSequence is extended for future improvement. [Feature #11788] + +* Case dispatch is now optimized for all special constant literals + including nil, true, and false. Previously, only literal strings, + symbols, integers and floats compiled to optimized case dispatch. [Feature #11769] + +* Instance variables on non-pure Ruby classes (T_DATA, T_FILE, + etc..) is less expensive to store than before. [Feature #11170] + +* All accesses to members of big Struct objects are performed in + constant-time. Previously, Struct elements beyond the first 10 + elements used a linear scan. [Feature #10585] + +* The Set class got several speed up. [Misc #10754], [r52591] + +* Socket and I/O-related improvements + + * Calling overhead of most of new keyword-using I/O methods in + [Feature #11229] is reduced by avoiding the inefficient C API + to parse keywords. [Feature #11339] + + * The standard library is updated to use the improved + exception-free non-blocking I/O from [Feature #11229]. + This has the additional benefit of quieter $DEBUG output in + addition to reducing expensive exceptions. [Feature #11044] + + * (Linux-only) waiting on a single FD anywhere in the stdlib no longer + uses select(2), making it immune to slowdowns with high-numbered + FDs. [Feature #11081] [Feature #11377] + +* CGI.escapeHTML is optimized with C extension. + https://github.com/ruby/ruby/pull/1164 diff --git a/doc/NEWS/NEWS-2.4.0 b/doc/NEWS/NEWS-2.4.0 new file mode 100644 index 0000000000..8a02f03809 --- /dev/null +++ b/doc/NEWS/NEWS-2.4.0 @@ -0,0 +1,399 @@ +# -*- rdoc -*- + += NEWS for Ruby 2.4.0 + +This document is a list of user visible feature changes made between +releases except for bug fixes. + +Note that each entry is kept so brief that no reason behind or +reference information is supplied with. For a full list of changes +with all sufficient information, see the ChangeLog file or Redmine +(e.g. <tt>https://bugs.ruby-lang.org/issues/$FEATURE_OR_BUG_NUMBER</tt>) + +== Changes since the 2.3.0 release + +=== Language changes + +* Multiple assignment in conditional expression is now allowed. [Feature #10617] + +* Refinements is enabled at method by Symbol#to_proc. [Feature #9451] + +* Refinements is enabled with Kernel#send and BasicObject#__send__. [Feature #11476] + +* Rescue modifier now applicable to method arguments. [Feature #12686] + +* Toplevel return is now allowed. [Feature #4840] + +=== Core classes updates (outstanding ones only) + +* Array + + * Array#concat [Feature #12333] + + Now takes multiple arguments. + + * Array#max and Array#min. [Feature #12172] + + This may cause a tiny incompatibility: if you redefine + Enumerable#max and call max to an Array, your redefinition will be + now ignored. You should also redefine Array#max. + + * Array#pack [Feature #12754] + + Now takes optional argument `buffer:' to reuse already allocated buffer. + + * Array#sum [Feature #12217] + + This is different from Enumerable#sum in that Array#sum doesn't depend on + the definition of each method. + +* Comparable + + * Comparable#clamp. [Feature #10594] + +* Dir + + * Dir.empty?. [Feature #10121] + +* Enumerable + + * Enumerable#chunk called without a block now return an Enumerator [Feature #2172] + * Enumerable#sum [Feature #12217] + * Enumerable#uniq [Feature #11090] + +* Enumerator::Lazy + + * Enumerator::Lazy#chunk_while [GH-1186] + * Enumerator::Lazy#uniq [Feature #11090] + +* File + + * File.empty?. [Feature #9969] + +* Float + + * Float#ceil, Float#floor, and Float#truncate now take an optional + digits, as well as Float#round. [Feature #12245] + + * Float#round now takes an optional keyword argument, half option, and + the default behavior is round-up. [Bug #12548] [Bug #12958] + half option can be one of :even, :up, and :down. [Feature #12953] + +* Hash + + * Hash#compact and Hash#compact! [Feature #11818] + * Hash#transform_values and Hash#transform_values! [Feature #12512] + +* Integer + + * Fixnum and Bignum are unified into Integer [Feature #12005] + + * Integer#ceil, Integer#floor, and Integer#truncate now take an optional + digits, as well as Integer#round. [Feature #12245] + + * Integer#digits for extracting columns of place-value notation [Feature #12447] + + * Integer#round now takes an optional keyword argument, half option, and the + default behavior is round-up now. [Bug #12548] [Bug #12958] + + half option can be one of :even, :up, and :down. [Feature #12953] + +* IO + + * IO#gets, IO#readline, IO#each_line, IO#readlines, IO.foreach now takes + an optional keyword argument, chomp flag. [Feature #12553] + +* Kernel + + * Kernel#clone now takes an optional keyword argument, freeze flag. [Feature #12300] + +* MatchData + + * MatchData#named_captures [Feature #11999] + * MatchData#values_at supports named captures [Feature #9179] + +* Module + + * Module#refine accepts a module as the argument now. [Feature #12534] + * Module.used_modules [Feature #7418] + +* Numeric + + * Numeric#finite?, Numeric#infinite? [Feature #12039] + +* Process + + * Support CLOCK_MONOTONIC_RAW_APPROX, CLOCK_UPTIME_RAW, and + CLOCK_UPTIME_RAW_APPROX which are introduced by macOS 10.12. + +* Rational + + * Rational#round now takes an optional keyword argument, half option, and + the default behavior is round-up now. [Bug #12548] [Bug #12958] + half option can be one of :even, :up, and :down. [Feature #12953] + +* Regexp + + * meta character \X matches Unicode 9.0 characters with some workarounds + for UTR #51 Unicode Emoji, Version 4.0 emoji zwj sequences. + + * Regexp#match? [Feature #8110] + + This returns bool and doesn't save backref. + + * Update to Onigmo 6.0.0. + +* Regexp/String: Update Unicode version from 8.0.0 to 9.0.0 [Feature #12513] + +* RubyVM::Env + + * RubyVM::Env was removed. + +* String + + * String#casecmp? [Feature #12786] + + * String#concat, String#prepend [Feature #12333] + + Now takes multiple arguments. + + * String#each_line, String#lines now takes an optional keyword argument, + chomp flag. [Feature #12553] + + * String#match? [Feature #12898] + + * String#unpack1 [Feature #12752] + + * String#upcase, String#downcase, String#capitalize, String#swapcase and + their bang variants work for all of Unicode, and are no longer limited + to ASCII. Supported encodings are UTF-8, UTF-16BE/LE, UTF-32BE/LE, and + ISO-8859-1~16. Variations are available with options. See the documentation + of String#downcase for details. [Feature #10085] + + * String.new(capacity: size) [Feature #12024] + +* StringIO + + * StringIO#gets, StringIO#readline, StringIO#each_line, StringIO#readlines now takes + an optional keyword argument, chomp flag. [Feature #12553] + +* Symbol + + * Symbol#casecmp? [Feature #12786] + + * Symbol#match now returns MatchData. [Bug #11991] + + * Symbol#match? [Feature #12898] + + * Symbol#upcase, Symbol#downcase, Symbol#capitalize, and Symbol#swapcase now + work for all of Unicode. See the documentation of String#downcase + for details. [Feature #10085] + +* Thread + + * Thread#report_on_exception and Thread.report_on_exception [Feature #6647] + +* TracePoint + + * TracePoint#callee_id [Feature #12747] + +* Warning + + * New module named Warning is introduced. By default it has only + one singleton method, named warn. This makes it possible for + 3rd-party libraries to control the way warnings are handled. [Feature #12299] + +=== Stdlib updates (outstanding ones only) + +* CGI + + * Don't allow , as a separator [Bug #12791] + +* CSV + + * Add a liberal_parsing option. [Feature #11839] + +* IPAddr + + * IPAddr#== and IPAddr#<=> no longer raise an exception if coercion fails. [Bug #12799] + +* IRB + + * Binding#irb: Start a REPL session like `binding.pry` at r56624. + +* Logger + + * Allow specifying logger parameters in constructor such + as level, progname, datetime_format, formatter. [Feature #12224] + * Add shift_period_suffix option. [Feature #10772] + +* Net::HTTP + + * New method: Net::HTTP.post [Feature #12375] + +* Net::FTP + + * Support TLS (RFC 4217). + * Support hash style options for Net::FTP.new. + * Add a new optional argument pathname to Net::FTP#status. + Contributed by soleboxy. [GH-1478] [Feature #12965] + +* OpenSSL + + * Includes Ruby/OpenSSL 2.0. OpenSSL has been extracted as a Gem and is + maintained at a separate repository now: https://github.com/ruby/openssl. + It still remains as a 'default gem'. [Feature #9612] + Refer to ext/openssl/History.md for the full release note. + +* optparse + + * Add an into option. [Feature #11191] + +* pathname + + * New method: Pathname#empty? [Feature #12596] + +* Readline + + * Readline.quoting_detection_proc and Readline.quoting_detection_proc= [Feature #12659] + +* REXML + + * REXML::Element#[]: If String or Symbol is specified, attribute + value is returned. Otherwise, Nth child is returned. This is + backward compatible change. + +* set + + * New methods: Set#compare_by_identity and Set#compare_by_identity?. [Feature #12210] + +* WEBrick + + * Don't allow , as a separator [Bug #12791] + +=== Compatibility issues (excluding feature bug fixes) + +* Array#sum and Enumerable#sum are implemented. [Feature #12217] + + Ruby itself has no compatibility problem because Ruby didn't have sum method + for arrays before Ruby 2.4. + However many third party gems, activesupport, facets, simple_stats, etc, + defines sum method. These implementations are mostly compatible but + there are subtle differences. + Ruby's sum method should be mostly compatible but it is impossible to + be perfectly compatible with all of them. + +* Fixnum and Bignum are unified into Integer [Feature #12005] + + Fixnum class and Bignum class is removed. + Integer class is changed from abstract class to concrete class. + For example, 0 is an instance of Integer: 0.class returns Integer. + The constants Fixnum and Bignum is bound to Integer. + So obj.kind_of?(Fixnum) works as obj.kind_of?(Integer). + At C-level, Fixnum object and Bignum object should be distinguished by + FIXNUM_P(obj) and RB_TYPE_P(obj, T_BIGNUM). + RUBY_INTEGER_UNIFICATION can be used to detect this feature at C-level. + 0.class == Integer can be used to detect this feature at Ruby-level. + The C-level constants, rb_cFixnum and rb_cBignum, are removed. + They can cause compilation failure. + +* String/Symbol#upcase/downcase/swapcase/capitalize(!) now work for all of + Unicode, not only for ASCII. [Feature #10085] + + No change is needed if the data is in ASCII anyway or if the limitation + to ASCII was only tolerated while waiting for a more extensive implementation. + A change (using the :ascii option) is needed in cases where Unicode data + is processed, but the operation has to be limited to ASCII only. + A good example of this are internationalized domain names. + +* TRUE / FALSE / NIL + + These constants are now obsoleted. [Feature #12574] + Use true / false / nil resp. instead. + +=== Stdlib compatibility issues (excluding feature bug fixes) + +* DateTime + + * DateTime#to_time now preserves timezone. [Bug #12189] + +* Psych + + * Update to Psych 2.2.2 + +* RDoc + + * Update to RDoc 5.0.0 + +* RubyGems + + * Update to RubyGems 2.6.8 + +* shellwords + + * Shellwords.shellwords (shellsplit) treats the backslash as escape + character only when followed by one of the following characters: + $ ` " \ <newline> [Bug #10055] + +* Time + + * Time#to_time now preserves timezone. [Bug #12271] + +* thread + + * the extension library is removed. Till 2.0 it was a pure ruby script + "thread.rb", which has precedence over "thread.so", and has been provided + in $LOADED_FEATURES since 2.1. + +* Tk + + * Tk is removed from stdlib. [Feature #8539] + + https://github.com/ruby/tk is the new upstream. + +* XMLRPC + + * XMLRPC is removed from stdlib, and bundled as gem. [Feature #12160][ruby-core:74239] + + https://github.com/ruby/xmlrpc is the new upstream. + +* Zlib + + * Zlib.gzip and Zlib.gunzip [Feature #13020] + +=== C API updates + +* ruby_show_version() will no longer exits the process, if + RUBY_SHOW_COPYRIGHT_TO_DIE is set to 0. This will be the default in + the future. + +* rb_gc_adjust_memory_usage() [Feature #12690] + +=== Supported platform changes + +* FreeBSD < 4 is no longer supported + +=== Implementation improvements + +* In some condition, `[x, y].max` and `[x, y].min` are optimized + so that a temporal array is not created. The concrete condition is + an implementation detail: currently, the array literal must have no + splat, must have at least one expression but literal, the length must + be <= 0x100, and Array#max and min must not be redefined. It will work + in most casual and real-life use case where it is written with intent + to `Math.max(x, y)`. + +* Thread deadlock detection now shows their backtrace and dependency. [Feature #8214] + +* st_table (st.c) internal data structure is improved. [Feature #12142] + +* Rational is extensively optimized. [Feature #12484] + +=== Miscellaneous changes + +* ChangeLog is removed from the repository. + + It is generated from commit messages in Subversion by `make dist`. + Also note that now people should follow Git style commit message. + The template is written at {Short (50 chars or less) summary of + changes}[https://git-scm.com/book/ch5-2.html]. [Feature #12283] diff --git a/doc/NEWS/NEWS-2.5.0 b/doc/NEWS/NEWS-2.5.0 new file mode 100644 index 0000000000..af7f3ada01 --- /dev/null +++ b/doc/NEWS/NEWS-2.5.0 @@ -0,0 +1,565 @@ +# -*- rdoc -*- + += NEWS for Ruby 2.5.0 + +This document is a list of user visible feature changes made between +releases except for bug fixes. + +Note that each entry is kept so brief that no reason behind or +reference information is supplied with. For a full list of changes +with all sufficient information, see the ChangeLog file or Redmine +(e.g. <tt>https://bugs.ruby-lang.org/issues/$FEATURE_OR_BUG_NUMBER</tt>) + +== Changes since the 2.4.0 release + +=== Language changes + +* Top-level constant look-up is removed. [Feature #11547] + +* rescue/else/ensure are allowed inside do/end blocks. [Feature #12906] + +* refinements take place in string interpolations. [Feature #13812] + +=== Core classes updates (outstanding ones only) + +* Array + + * New methods: + + * Array#append [Feature #12746] + * Array#prepend [Feature #12746] + +* Data + + * Is deprecated. It was a base class for C extensions, and it's not + necessary to expose in Ruby level. [Feature #3072] + +* Exception + + * New methods: + + * Exception#full_message to retrieve a String expression of an exception, + formatted in the same way in which Ruby prints out an uncaught + exception. [Feature #14141] [experimental] + +* Dir + + * Dir.glob provides new optional keyword argument, +:base+ . [Feature #13056] + * Dir.chdir (without block arg), Dir.open, Dir.new, Dir.mkdir, Dir.rmdir, + Dir.empty? releases GVL + + * New methods: + + * Dir.children [Feature #11302] + * Dir.each_child [Feature #11302] + +* Enumerable + + * Enumerable#any?, Enumerable#all?, Enumerable#none? and Enumerable#one? + accept a pattern argument. [Feature #11286] + +* File + + * File.open accepts +:newline+ option to imply text mode. [Bug #13350] + * File#path raises an IOError for files opened with + File::Constants::TMPFILE option. [Feature #13568] + * File.stat, File.exist? and other <code>rb_stat()</code>-using methods + release GVL. [Bug #13941] + * File.rename releases GVL. [Feature #13951] + * File::Stat#atime, File::Stat#mtime and File::Stat#ctime support fractional + second timestamps on Windows 8 and later. [Feature #13726] + * File::Stat#ino and File.identical? support ReFS 128bit ino on Windows 8.1 + and later. [Feature #13731] + * File.readable?, File.readable_real?, File.writable?, File.writable_real?, + File.executable?, File.executable_real?, File.mkfifo, File.readlink, + File.truncate, File#truncate, File.chmod, File.lchmod, File.chown, + File.lchown, File.unlink, File.utime, File.lstat release GVL + + * New method: + + * File.lutime [Feature #4052] + +* Hash + + * New methods: + + * Hash#transform_keys [Feature #13583] + * Hash#transform_keys! [Feature #13583] + * Hash#slice [Feature #8499] + +* IO + + * IO.copy_stream tries copy offload with copy_file_range(2) [Feature #13867] + + * New methods: + + * IO#pread [Feature #4532] + * IO#pwrite [Feature #4532] + * IO#write accepts multiple arguments [Feature #9323] + +* IOError + + * IO#close might raise an error with message "stream closed", + but it is refined to "stream closed in another thread". The new message + is more clear for user. [Bug #13405] + +* Integer + + * Integer#round, Integer#floor, Integer#ceil and Integer#truncate always + return an Integer. [Bug #13420] + * Integer#pow accepts modulo argument for calculating modular + exponentiation. [Feature #12508] [Feature #11003] + + * New methods: + + * Integer#allbits?, Integer#anybits?, Integer#nobits? [Feature #12753] + * Integer.sqrt [Feature #13219] + +* Kernel + + * Kernel#yield_self [Feature #6721] + * Kernel#pp [Feature #14123] + * Kernel#warn(..., uplevel:n) [Feature #12882] + +* Method + + * New methods: + + * Method#=== that invokes Method#call, as same as Proc#=== [Feature #14142] + +* Module + + * Module#attr, Module#attr_accessor, Module#attr_reader and Module#attr_writer + become public. [Feature #14132] + * Module#define_method, Module#alias_method, Module#undef_method and + Module#remove_method become public. [Feature #14133] + +* Numeric + + * Numeric#step no longer hides errors from coerce method when + given a step value which cannot be compared with #> to 0. [Feature #7688] + * Numerical comparison operators (<,<=,>=,>) no longer hide exceptions + from #coerce method internally. Return nil in #coerce if the coercion is + impossible. [Feature #7688] + +* Process + + * Precision of Process.times is improved if getrusage(2) exists. [Feature #11952] + + * New method: + + * Process.last_status as an alias of $? [Feature #14043] + +* Range + * Range#initialize no longer hides exceptions when comparing begin and + end with #<=> and raise a "bad value for range" ArgumentError + but instead lets the exception from the #<=> call go through. [Feature #7688] + +* Regexp + + * Update to Onigmo 6.1.3-669ac9997619954c298da971fcfacccf36909d05. + + * Support absence operator https://github.com/k-takata/Onigmo/issues/82 + + * Support new 5 emoji-related Unicode character properties + +* RubyVM::InstructionSequence + + * New method: + + * RubyVM::InstructionSequence#each_child + * RubyVM::InstructionSequence#trace_points + +* String + + * <code>String#-@</code> deduplicates unfrozen strings. Already-frozen + strings remain unchanged for compatibility. [Feature #13077] + * <code>-"literal"</code> (<code>String#-@</code>) optimized to return the same object + (same as <code>"literal".freeze</code> in Ruby 2.1+) [Feature #13295] + * String#casecmp and String#casecmp? return nil for non-string arguments + instead of raising a TypeError. [Bug #13312] + * String#start_with? accepts a regexp [Feature #13712] + + * New methods: + + * String#delete_prefix, String#delete_prefix! [Feature #12694] + * String#delete_suffix, String#delete_suffix! [Feature #13665] + * String#each_grapheme_cluster and String#grapheme_clusters to + enumerate grapheme clusters [Feature #13780] + * String#undump to unescape String#dump'ed string [Feature #12275] + +* Struct + + * Struct.new takes `keyword_init: true` option to initialize members + with keyword arguments. [Feature #11925] + +* Regexp/String: Update Unicode version from 9.0.0 to 10.0.0 [Feature #13685] + +* Thread + + * Description set by Thread#name= is now visible on Windows 10. + + * New method: + * Thread#fetch [Feature #13009] + + * The default of Thread.report_on_exception is now true, + showing unhandled exceptions terminating threads on $stderr. [Feature #14143] + +* Time + + * Time.at receives 3rd argument which specifies the unit of 2nd argument. [Feature #13919] + +* KeyError + + * New methods: + + * KeyError#receiver [Feature #12063] + * KeyError#key [Feature #12063] + +* FrozenError + + * New exception class. [Feature #13224] + +=== Stdlib updates (outstanding ones only) + +* BigDecimal + + * Update to BigDecimal 1.3.4 + + * The following features are added: + + * BigDecimal::VERSION + + * The following features have been deprecated, + and are planned to be removed in the version 1.4.0: + + * BigDecimal.new + + * BigDecimal.ver + + * BigDecimal#clone and #dup now do not make a new instance, + but returns the receiver itself. + +* Coverage + + * Support branch coverage and method coverage measurement. [Feature #13901] + Branch coverage tells you which branches are executed, and which not. + Method coverage tells you which methods are invoked, and which not. + By running a test suite with this new feature, you can know which branches + and methods are executed by a test, and evaluate total coverage of a test + suite more strictly. + + You can specify the measuring target by an option to `Coverage.start`: + + Coverage.start(lines: true, branches: true, methods: true) + + After some Ruby files are loaded, you can use `Coverage.result` to get + the coverage result: + + Coverage.result + #=> { "/path/to/file.rb"=> + # { :lines => [1, 2, 0, nil, ...], + # :branches => + # { [:if, 0, 2, 1, 6, 4] => + # { [:then, 1, 3, 2, 3, 8] => 0, + # [:else, 2, 5, 2, 5, 8] => 2 + # } + # }, + # :methods => { + # [Object, :foo, 1, 0, 7, 3] => 2 + # } + # } + # } + + The result type of line coverage is not changed; it is just an array that + contains numbers, which means the count that each line was executed, + or `nil`s, which means that the line is not relevant. + + The result type of branch coverage is: + + { (jump base) => { (jump target) => (counter) } } + + where jump base and targets have the format + + [type, unique-id, start lineno, start column, end lineno, end column] + + For example, `[:if, 0, 2, 1, 6, 4]` reads an `if` statement that ranges from + line 2 and column 1, to line 6 and column 4. `[:then, 1, 3, 2, 3, 8]` reads + a `then` clause that ranges from line 3 and column 2, to line 3 and column 8. + Note that lineno starts from 1, and that columnno starts from 0. So, the + above example shows a branch from the `if` to the `then` was never executed, + and a branch from the `if` to the `else` was executed twice. + + The result type of method coverage is: + + { (method key) => (counter) } + + where method key has the format + + [class, method-name, start lineno, start column, end lineno, end column] + + For example, `[Object, :foo, 1, 0, 7, 3]` reads `Object#foo` that ranges from + line 1 and column 0, to line 7 and column 3. The above example shows this + `Object#foo` was invoked twice. + + Note: To keep compatibility, passing no option to `Coverage.start` will measure + only line coverage, and `Coverage.result` will return the old format: + + Coverage.result + #=> { "/path/to/file.rb"=> [1, 2, 0, nil, ...] } + +* DRb + + * ACL::ACLEntry.new no longer suppresses IPAddr::InvalidPrefixError. + +* ERB + + * Add ERB#result_with_hash to render a template with local variables passed + with a Hash object. [Feature #8631] + + * Default template file encoding is changed from ASCII-8BIT to UTF-8 in erb + command. [Bug #14095] + + * Carriage returns are changed to be trimmed properly if trim_mode is specified + and used. Duplicated newlines will be removed on Windows. [Bug #5339] [Bug #11464] + +* IPAddr + + * IPAddr no longer accepts invalid address mask. [Bug #13399] + * IPAddr#ipv4_compat and IPAddr#ipv4_compat? are marked for deprecation. [Bug #13769] + + * New methods: + + * IPAddr#prefix + * IPAddr#loopback? + * IPAddr#private? [Feature #11666] + * IPAddr#link_local? [Feature #10912] + +* IRB + + * Print backtrace and error message in reverse order [Feature #8661] [experimental] + * `binding.irb` automatically requires irb and runs [Bug #13099] [experimental] + * `binding.irb` on its start shows source around the line where it was called [Feature #14124] + +* Matrix + + * New methods: + + * Matrix.combine and Matrix#combine [Feature #10903] + * Matrix#hadamard_product and Matrix#entrywise_product + +* Net::HTTP + + * Net::HTTP.new supports no_proxy parameter [Feature #11195] + * Net::HTTP#min_version and Net::HTTP#max_version [Feature #9450] + * Add more HTTP status classes + * Net::HTTP::STATUS_CODES is added as HTTP Status Code Repository [Misc #12935] + * Net::HTTP#proxy_user and Net::HTTP#proxy_pass reflect http_proxy environment + variable if the system's environment variable is multiuser safe. [Bug #12921] + +* open-uri + * URI.open method defined as an alias to open-uri's Kernel.open. + open-uri's Kernel.open will be deprecated in future. + +* OpenSSL + + * Updated Ruby/OpenSSL from version 2.0 to 2.1. Changes are noted in + "Version 2.1.0" section in ext/openssl/History.md. + +* Pathname + + * New method: + + * Pathname#glob [Feature #7360] + +* Psych + + * Update to Psych 3.0.2. + + * Convert fallback option to a keyword argument + https://github.com/ruby/psych/pull/342 + * Add :symbolize_names option to Psych.load, Psych.safe_load like JSON.parse + https://github.com/ruby/psych/pull/333, https://github.com/ruby/psych/pull/337 + * Add Psych::Handler#event_location + https://github.com/ruby/psych/pull/326 + * Make frozen string literal = true + https://github.com/ruby/psych/pull/320 + * Preserve time zone offset when deserializing times + https://github.com/ruby/psych/pull/316 + * Remove deprecated method aliases for syck gem + https://github.com/ruby/psych/pull/312 + +* RbConfig + + * RbConfig::LIMITS is added to provide the limits of C types. + This is available when rbconfig/sizeof is loaded. + +* Ripper + + * Ripper::EXPR_BEG and so on for Ripper#state. + + * New method: + + * Ripper#state to tell the state of scanner. [Feature #13686] + +* RDoc + + * Update to RDoc 6.0.1. + + * Replace IRB based lexer with Ripper. + * https://github.com/ruby/rdoc/pull/512 + * This much improves the speed of generating documents. + * It also facilitates supporting new syntax in the future. + * Support many new syntaxes of Ruby from the past few years. + * Use "frozen_string_literal: true". + Performance survey: https://gist.github.com/aycabta/abdfaa75ea8a6877eeb734e942e73800 + * Support did_you_mean. + +* Rubygems + + * Update to Rubygems 2.7.3. + * http://blog.rubygems.org/2017/11/28/2.7.3-released.html + * http://blog.rubygems.org/2017/11/08/2.7.2-released.html + * http://blog.rubygems.org/2017/11/03/2.7.1-released.html + * http://blog.rubygems.org/2017/11/01/2.7.0-released.html + * http://blog.rubygems.org/2017/10/09/2.6.14-released.html + * http://blog.rubygems.org/2017/08/27/2.6.13-released.html + +* SecureRandom + + * New method: + + * SecureRandom.alphanumeric + +* Set + + * New methods: + + * Set#to_s as alias to #inspect [Feature #13676] + * Set#=== as alias to #include? [Feature #13801] + * Set#reset [Feature #6589] + +* StringIO + + * StringIO#write accepts multiple arguments + +* StringScanner + + * New methods: + + * StringScanner#size, StringScanner#captures, StringScanner#values_at [Feature #836] + +* URI + + * Relative path operations no longer collapse consecutive slashes to a single slash. [Bug #8352] + +* WEBrick + + * Add Server Name Indication (SNI) support [Feature #13729] + * support Proc objects as body responses [Feature #855] + * released as a RubyGem [Feature #13173] + * avoid unintended behavior from Kernel#open [Misc #14216] + +* Zlib + + * Zlib::GzipWriter#write accepts multiple arguments + +=== Compatibility issues (excluding feature bug fixes) + +* BasicSocket + + * BasicSocket#read_nonblock and BasicSocket#write_nonblock no + longer set the O_NONBLOCK file description flag as side effect + (on Linux only) [Feature #13362] + +* Random + + * Random.raw_seed renamed to become Random.urandom. It is now + applicable to non-seeding purposes due to [Bug #9569]. + +* Socket + + * Socket::Ifaddr#vhid is added [Feature #13803] + +* ConditionVariable, Queue and SizedQueue reimplemented for speed. + They no longer subclass Struct. [Feature #13552] + +=== Stdlib compatibility issues (excluding feature bug fixes) + +* Gemification + + * Promote following standard libraries to default gems. + * cmath + * csv + * date + * dbm + * etc + * fcntl + * fiddle + * fileutils + * gdbm + * ipaddr + * scanf + * sdbm + * stringio + * strscan + * webrick + * zlib + +* Logger + + * Logger.new("| command") had been working to open a command + unintentionally. It was prohibited, and now Logger#initialize + treats a String argument only as a filename, as its specification. [Bug #14212] + +* Net::HTTP + + * Net::HTTP#start now passes :ENV to p_addr by default. [Bug #13351] + To avoid this, pass nil explicitly. + +* mathn.rb + + * Removed from stdlib. [Feature #10169] + +* Rubygems + + * Removed "ubygems.rb" file from stdlib. It's needless since Ruby 1.9. + +=== Supported platform changes + +* Drop support of NaCl platform + + * https://bugs.chromium.org/p/chromium/issues/detail?id=239656#c160 + +=== Implementation improvements + +* (This might not be a "user visible feature change" but) Hash class's + hash function is now SipHash13. [Feature #13017] + +* SecureRandom now prefers OS-provided sources than OpenSSL. [Bug #9569] + +* Mutex rewritten to be smaller and faster [Feature #13517] + +* Performance of block passing using block parameters is improved by + lazy Proc allocation [Feature #14045] + +* Dynamic instrumentation for TracePoint hooks instead of using "trace" + instruction to avoid overhead [Feature #14104] + +* ERB now generates code from a template twice as fast as Ruby 2.4 + +=== Miscellaneous changes + +* Print backtrace and error message in reverse order if $stderr is unchanged + and a tty. [Feature #8661] [experimental] + +* Print error message in bold/underlined text if $stderr is unchanged and a + tty. [Feature #14140] [experimental] + +* configure option --with-ext now mandates its arguments. So for + instance if you run ./configure --with-ext=openssl,+ then the + openssl library is guaranteed compiled, otherwise the build fails + abnormally. + + Note however to always add the ",+" at the end of the argument. + Otherwise nothing but openssl are built. [Feature #13302] diff --git a/doc/NEWS/NEWS-2.6.0 b/doc/NEWS/NEWS-2.6.0 new file mode 100644 index 0000000000..6e70696de2 --- /dev/null +++ b/doc/NEWS/NEWS-2.6.0 @@ -0,0 +1,662 @@ +# -*- rdoc -*- + += NEWS for Ruby 2.6.0 + +This document is a list of user visible feature changes made between +releases except for bug fixes. + +Note that each entry is kept so brief that no reason behind or reference +information is supplied with. For a full list of changes with all +sufficient information, see the ChangeLog file or Redmine +(e.g. <tt>https://bugs.ruby-lang.org/issues/$FEATURE_OR_BUG_NUMBER</tt>) + +== Changes since the 2.5.0 release + +=== Language changes + +* <code>$SAFE</code> now is a process global state and can be set to 0 again. [Feature #14250] + +* Refinements take place at block passing. [Feature #14223] + +* Refinements take place at Kernel#public_send. [Feature #15326] + +* Refinements take place at Kernel#respond_to?. [Feature #15327] + +* +else+ without +rescue+ now causes a syntax error. [EXPERIMENTAL] [Feature #14606] + +* Constant names may start with a non-ASCII capital letter. [Feature #13770] + +* Endless ranges are introduced. You can use a Range that has no end, + like <code>(0..)</code> (or similarly <code>(0...)</code>). [Feature #12912] + + The following shows typical use cases: + + ary[1..] # identical to ary[1..-1] + (1...).each {|index| block } # infinite loop from index 1 + ary.zip(1..) {|elem, index| block } # ary.each.with_index(1) { } + +* Non-Symbol keys in a keyword arguments hash cause an exception. + +* The "shadowing outer local variable" warning is removed. [Feature #12490] + + You can now write the following without warning: + + user = users.find {|user| cond(user) } + +* Print +cause+ of the exception if the exception is not caught and printed + its backtraces and error message. [Feature #8257] + +* The flip-flop syntax is deprecated. [Feature #5400] + +=== Core classes updates (outstanding ones only) + +[Array] + + [New methods] + + * Added Array#union and Array#difference instance methods. [Feature #14097] + + [Modified method] + + * Array#to_h now accepts a block that maps elements to new key/value pairs. [Feature #15143] + + [Aliased methods] + + * Array#filter is a new alias for Array#select. [Feature #13784] + * Array#filter! is a new alias for Array#select!. [Feature #13784] + +[Binding] + + [New method] + + * Added Binding#source_location. [Feature #14230] + + This method returns the source location of the binding, a 2-element + array of <code>__FILE__</code> and <code>__LINE__</code>. + Traditionally, the same information could be retrieved by + <code>eval("[__FILE__, __LINE__]", binding)</code>, but we are + planning to change this behavior so that Kernel#eval ignores + binding's source location [Bug #4352]. So, users should use this + newly-introduced method instead of Kernel#eval. + +[Dir] + + [New methods] + + * Added Dir#each_child and Dir#children instance methods. [Feature #13969] + +[Enumerable] + + [New method] + + * Enumerable#chain returns an enumerator object that iterates over the + elements of the receiver and then those of each argument + in sequence. [Feature #15144] + + [Modified method] + + * Enumerable#to_h now accepts a block that maps elements to new key/value pairs. [Feature #15143] + + [Aliased method] + + * Enumerable#filter is a new alias for Enumerable#select. [Feature #13784] + +[Enumerator::ArithmeticSequence] + + * This is a new class to represent a generator of an arithmetic sequence, + that is a number sequence defined by a common difference. It can be used + for representing what is similar to Python's slice. You can get an + instance of this class from Numeric#step and Range#step. + +[Enumerator::Chain] + + * This is a new class to represent a chain of enumerables that works as a + single enumerator, generated by such methods as Enumerable#chain and + Enumerator#+. + +[Enumerator::Lazy] + + [Aliased method] + + * Enumerator::Lazy#filter is a new alias for + Enumerator::Lazy#select. [Feature #13784] + +[Enumerator] + + [New methods] + + * Enumerator#+ returns an enumerator object that iterates over the + elements of the receiver and then those of the other operand. [Feature #15144] + +[ENV] + + [Modified method] + + * ENV.to_h now accepts a block that maps names and values to new keys and values. [Feature #15143] + +[Exception] + + [New options] + + * Exception#full_message takes +:highlight+ and +:order+ + options. [Bug #14324] + +[Hash] + + [Modified methods] + + * Hash#merge, Hash#merge!, and Hash#update now accept multiple + arguments. [Feature #15111] + + * Hash#to_h now accepts a block that maps keys and values to new keys and values. [Feature #15143] + + [Aliased methods] + + * Hash#filter is a new alias for Hash#select. [Feature #13784] + + * Hash#filter! is a new alias for Hash#select!. [Feature #13784] + +[IO] + + [New option] + + * Added new mode character <code>'x'</code> to open files for exclusive + access. [Feature #11258] + +[Kernel] + + [Aliased method] + + * Kernel#then is a new alias for Kernel#yield_self. [Feature #14594] + + [New options] + + * Kernel#Complex, Kernel#Float, Kernel#Integer, and + Kernel#Rational take an +:exception+ option to specify the way of + error handling. [Feature #12732] + + * Kernel#system takes an +:exception+ option to raise an exception + on failure. [Feature #14386] + + [Incompatible changes] + + * Kernel#system and Kernel#exec do not close non-standard file descriptors + (the default of the +:close_others+ option is changed to +false+, + but we still set the +FD_CLOEXEC+ flag on descriptors we + create). [Misc #14907] + +[KeyError] + + [New options] + + * KeyError.new accepts +:receiver+ and +:key+ options to set receiver and + key in Ruby code. [Feature #14313] + +[Method] + + [New methods] + + * Added Method#<< and Method#>> for Proc composition. [Feature #6284] + +[Module] + + [Modified methods] + + * Module#method_defined?, Module#private_method_defined?, and + Module#protected_method_defined? now accept the second + parameter as optional. If it is +true+ (the default value), it checks + ancestor modules/classes, or checks only the class itself. [Feature #14944] + +[NameError] + + [New option] + + * NameError.new accepts a +:receiver+ option to set receiver in Ruby + code. [Feature #14313] + +[NilClass] + + [New method] + + * NilClass#=~ is added for compatibility. [Feature #15231] + +[NoMethodError] + + [New option] + + * NoMethodError.new accepts a +:receiver+ option to set receiver in Ruby + code. [Feature #14313] + +[Numeric] + + [Incompatible changes] + + * Numeric#step now returns an instance of the Enumerator::ArithmeticSequence + class rather than one of the Enumerator class. + +[OpenStruct] + + [Modified method] + + * OpenStruct#to_h now accepts a block that maps keys and values to new keys and values. [Feature #15143] + +[Proc] + + [New methods] + + * Added Proc#<< and Proc#>> for Proc composition. [Feature #6284] + + [Incompatible changes] + + * Proc#call doesn't change <code>$SAFE</code> any more. [Feature #14250] + +[Random] + + [New method] + + * Added Random.bytes. [Feature #4938] + +[Range] + + [New method] + + * Added Range#% instance method. [Feature #14697] + + [Incompatible changes] + + * Range#=== now uses the +#cover?+ instead of the +#include?+ method. [Feature #14575] + * Range#cover? now accepts a Range object. [Feature #14473] + * Range#step now returns an instance of the Enumerator::ArithmeticSequence + class rather than one of the Enumerator class. + +[Regexp/String] + + * Update Unicode version from 10.0.0 to 11.0.0. [Feature #14802] + + This includes a rewrite of the grapheme cluster (/\X/) algorithm + and special-casing for Georgian MTAVRULI on String#downcase. + + * Update Emoji version from 5.0 to 11.0.0 [Feature #14802] + +[RubyVM::AbstractSyntaxTree] + + [New methods] + + * RubyVM::AbstractSyntaxTree.parse parses a given string and returns AST + nodes. [experimental] + + * RubyVM::AbstractSyntaxTree.parse_file parses a given file and returns AST + nodes. [experimental] + + * RubyVM::AbstractSyntaxTree.of returns AST nodes of the given proc or + method. [experimental] + +[RubyVM] + + [New method] + + * RubyVM.resolve_feature_path identifies the file that will be loaded by + "require(feature)". [experimental] [Feature #15230] + +[String] + + * String#crypt is now deprecated. [Feature #14915] + + [New features] + + * String#split yields each substring to the block if given. [Feature #4780] + +[Struct] + + [Modified method] + + * Struct#to_h now accepts a block that maps keys and values to new keys and values. [Feature #15143] + + [Aliased method] + + * Struct#filter is a new alias for Struct#select. [Feature #13784] + +[Time] + + [New features] + + * Time.new and Time#getlocal accept a timezone object as well as + a UTC offset string. Time#+, Time#-, and Time#succ also preserve + the timezone. [Feature #14850] + +[TracePoint] + + [New features] + + * "script_compiled" event is supported. [Feature #15287] + + [New methods] + + * TracePoint#parameters [Feature #14694] + + * TracePoint#instruction_sequence [Feature #15287] + + * TracePoint#eval_script [Feature #15287] + + [Modified method] + + * TracePoint#enable accepts new keywords "target:" and + "target_line:". [Feature #15289] + +=== Stdlib updates (outstanding ones only) + +[BigDecimal] + + Update to version 1.4.0. This version includes several compatibility + issues, see Compatibility issues section below for details. + + [Modified method] + + * BigDecimal() accepts the new keyword "exception:" similar to Float(). + + [Note for the differences among recent versions] + + You should want to know the differences among recent versions of bigdecimal. + Please select the suitable version of bigdecimal according to the following + information. + + * 1.3.5 has BigDecimal.new without "exception:" keyword. You can see the + deprecation warning of BigDecimal.new when you specify "-w" option. + BigDecimal(), BigDecimal.new, and Object#to_d methods are the same. + + * 1.4.0 has BigDecimal.new with "exception:" keyword. You always see the + deprecation warning of BigDecimal.new. Object#to_d method is different + from BigDecimal() and BigDecimal.new. + + * 2.0.0 will be released soon after releasing Ruby 2.6.0. This version + will not have the BigDecimal.new method. + +[Bundler] + + * Add Bundler to Standard Library. [Feature #12733] + + * Use 1.17.2, the latest stable version. + +[Coverage] + + A oneshot_lines mode is added. [Feature #15022] + + This mode checks "whether each line was executed at least once or not", + instead of "how many times each line was executed". + A hook for each line is fired at most once, and after it is fired + the hook flag is removed, i.e., it runs with zero overhead. + + [New options] + + * Add +:oneshot_lines+ keyword argument to Coverage.start. + + * Add +:stop+ and +:clear+ keyword arguments to Coverage.result. + If +clear+ is true, it clears the counters to zero. + If +stop+ is true, it disables coverage measurement. + + [New methods] + + * Coverage.line_stub, which is a simple helper function that + creates the "stub" of line coverage from a given source code. + +[CSV] + + * Upgrade to 3.0.2. This includes performance improvements especially + for writing. Writing is about 2 times faster. + See https://github.com/ruby/csv/blob/master/NEWS.md. + +[ERB] + + [New options] + + * Add +:trim_mode+ and +:eoutvar+ keyword arguments to ERB.new. + Now non-keyword arguments other than the first one are softly deprecated + and will be removed when Ruby 2.5 becomes EOL. [Feature #14256] + + * erb command's <tt>-S</tt> option is deprecated, and will be removed + in the next version. + +[FileUtils] + + [New methods] + + * FileUtils#cp_lr. [Feature #4189] + +[Matrix] + + [New methods] + + * Matrix#antisymmetric?, Matrix#skew_symmetric? + + * Matrix#map!, Matrix#collect! [Feature #14151] + + * Matrix#[]= + + * Vector#map!, Vector#collect! + + * Vector#[]= + +[Net] + + [New options] + + * Add +:write_timeout+ keyword argument to Net::HTTP.new. [Feature #13396] + + [New methods] + + * Add Net::HTTP#write_timeout and Net::HTTP#write_timeout=. [Feature #13396] + + [New constant] + + * Add Net::HTTPClientException to deprecate Net::HTTPServerException, + whose name is misleading. [Bug #14688] + +[NKF] + + * Upgrade to nkf v2.1.5 + +[Psych] + + * Upgrade to Psych 3.1.0 + +[RDoc] + + * Become about 2 times faster. + + * Use SOURCE_DATE_EPOCH to generate files. + + * Fix method line number that slipped off. + + * Enable <code>--width</code>, <code>--exclude</code>, + and <code>--line-numbers</code> that were ignored. + + * Add support for blockquote by ">>>" in default markup notation. + + * Add support for "Raises" lines in TomDoc notation. + + * Fix syntax error output. + + * Fix many parsing bugs. + +[REXML] + + * Upgrade to REXML 3.1.9. + See https://github.com/ruby/rexml/blob/master/NEWS.md. + + [Improved some XPath implementations] + + * <code>concat()</code> function: Stringify all arguments before concatenating. + + * <code>string()</code> function: Support context node. + + * <code>string()</code> function: Support processing instruction node. + + * Support <code>"*:#{ELEMENT_NAME}"</code> syntax in XPath 2.0. + + [Fixed some XPath implementations] + + * <code>"//#{ELEMENT_NAME}[#{POSITION}]"</code> case + + * <code>string()</code> function: Fix <code>function(document)</code> + returns nodes that are out of root elements. + + * <code>"/ #{ELEMENT_NAME} "</code> case + + * <code>"/ #{ELEMENT_NAME} [ #{PREDICATE} ]"</code> case + + * <code>"/ #{AXIS}::#{ELEMENT_NAME}"</code> case + + * <code>"#{N}-#{M}"</code> case: One or more white spaces were required + before <code>"-"</code> + + * <code>"/child::node()"</code> case + + * <code>"#{FUNCTION}()/#{PATH}"</code> case + + * <code>"@#{ATTRIBUTE}/parent::"</code> case + + * <code>"name(#{NODE_SET})"</code> case + +[RSS] + + [New options] + + * RSS::Parser.parse now accepts options as Hash. +:validate+ , + +:ignore_unknown_element+ , +:parser_class+ options are available. + +[RubyGems] + + * Upgrade to RubyGems 3.0.1 + + * https://blog.rubygems.org/2018/12/19/3.0.0-released.html + + * https://blog.rubygems.org/2018/12/23/3.0.1-released.html + +[Set] + + [Aliased method] + + * Set#filter! is a new alias for Set#select!. [Feature #13784] + +[URI] + + [New constant] + + * Add URI::File to handle the file URI scheme. [Feature #14035] + +=== Compatibility issues (excluding feature bug fixes) + +[Dir] + + * Dir.glob with <code>'\0'</code>-separated pattern list will be deprecated, + and is now warned. [Feature #14643] + +[File] + + * File.read, File.binread, File.write, File.binwrite, File.foreach, and + File.readlines do not invoke external commands even if the path starts + with the pipe character <code>'|'</code>. [Feature #14245] + +[Object] + + * Object#=~ is deprecated. [Feature #15231] + +=== Stdlib compatibility issues (excluding feature bug fixes) + +* These standard libraries have been promoted to default gems. + + * e2mmap + * forwardable + * irb + * logger + * matrix + * mutex_m + * ostruct + * prime + * rexml + * rss + * shell + * sync + * thwait + * tracer + +[BigDecimal] + + * The following methods are removed. + + * BigDecimal.allocate + * BigDecimal.ver + + * Every BigDecimal object is frozen. [Feature #13984] + + * BigDecimal() parses the given string similar to Float(). + + * String#to_d parses the receiver string similar to String#to_f. + + * BigDecimal.new will be removed in version 2.0. + +[Pathname] + + * Pathname#read, Pathname#binread, Pathname#write, Pathname#binwrite, + Pathname#each_line and Pathname#readlines do not invoke external + commands even if the path starts with the pipe character <code>'|'</code>. + This follows [Feature #14245]. + +=== Implementation improvements + +* Speedup Proc#call because we don't need to care about <code>$SAFE</code> + any more. [Feature #14318] + + With +lc_fizzbuzz+ benchmark which uses Proc#call many times we can + measure x1.4 improvements. [Bug #10212] + +* Speedup block.call where +block+ is passed block parameter. [Feature #14330] + + Ruby 2.5 improves block passing performance. [Feature #14045] + + Additionally, Ruby 2.6 improves the performance of passed block calling. + +* Introduce an initial implementation of a JIT (Just-in-time) compiler. [Feature #14235] [experimental] + + * <tt>--jit</tt> command line option is added to enable JIT. <tt>--jit-verbose=1</tt> + is good for inspection. See <tt>ruby --help</tt> for others. + * To generate machine code, this JIT compiler uses the C compiler used for building + the interpreter. Currently GCC, Clang, and Microsoft Visual C++ are supported for it. + * <tt>--disable-mjit-support</tt> option is added to configure. This is added for JIT debugging, + but if you get an error on building a header file for JIT, you can use this option to skip + building it as a workaround. + * rb_waitpid reimplemented on Unix-like platforms to maintain + compatibility with processes created for JIT [Bug #14867] + +* VM generator script renewal; makes the generated VM more optimized. [GH-1779] + +* Thread cache enabled for pthreads platforms (for Thread.new and + Thread.start). [Feature #14757] + +* timer thread is eliminated for platforms with POSIX timers. [Misc #14937] + +* Transient Heap (theap) is supported. [Bug #14858] [Feature #14989] + + theap is a managed heap for short-living memory objects. For example, + making a small and short-living Hash object is x2 faster. With rdoc benchmark, + we measured 6-7% performance improvement. + +* Native implementations (arm32, arm64, ppc64le, win32, win64, x86, amd64) of + coroutines to improve performance of Fiber significantly. [Feature #14739] + +=== Miscellaneous changes + +* On macOS, shared libraries no longer include a full version number of Ruby + in their names. This eliminates the burden of each teeny upgrade on the + platform that users need to rebuild every extension library. + + [Before] + * libruby.2.6.0.dylib + * libruby.2.6.dylib -> libruby.2.6.0.dylib + * libruby.dylib -> libruby.2.6.0.dylib + + [After] + * libruby.2.6.dylib + * libruby.dylib -> libruby.2.6.dylib + +* Extracted misc/*.el files to https://github.com/ruby/elisp diff --git a/doc/NEWS/NEWS-2.7.0 b/doc/NEWS/NEWS-2.7.0 new file mode 100644 index 0000000000..7607a473de --- /dev/null +++ b/doc/NEWS/NEWS-2.7.0 @@ -0,0 +1,845 @@ +# -*- rdoc -*- + += NEWS for Ruby 2.7.0 + +This document is a list of user visible feature changes made between +releases except for bug fixes. + +Note that each entry is kept so brief that no reason behind or reference +information is supplied with. For a full list of changes with all +sufficient information, see the ChangeLog file or Redmine +(e.g. <tt>https://bugs.ruby-lang.org/issues/$FEATURE_OR_BUG_NUMBER</tt>). + +== Changes since the 2.6.0 release + +=== Language changes + +==== Pattern matching + +* Pattern matching is introduced as an experimental feature. [Feature #14912] + + case [0, [1, 2, 3]] + in [a, [b, *c]] + p a #=> 0 + p b #=> 1 + p c #=> [2, 3] + end + + case {a: 0, b: 1} + in {a: 0, x: 1} + :unreachable + in {a: 0, b: var} + p var #=> 1 + end + + case -1 + in 0 then :unreachable + in 1 then :unreachable + end #=> NoMatchingPatternError + + json = <<END + { + "name": "Alice", + "age": 30, + "children": [{ "name": "Bob", "age": 2 }] + } + END + + JSON.parse(json, symbolize_names: true) in {name: "Alice", children: [{name: name, age: age}]} + + p name #=> "Bob" + p age #=> 2 + + JSON.parse(json, symbolize_names: true) in {name: "Alice", children: [{name: "Charlie", age: age}]} + #=> NoMatchingPatternError + +* See the following slides for more details: + * https://speakerdeck.com/k_tsj/pattern-matching-new-feature-in-ruby-2-dot-7 + * Note that the slides are slightly obsolete. + +* The warning against pattern matching can be suppressed with + {-W:no-experimental option}[#label-Warning+option]. + +==== The spec of keyword arguments is changed towards 3.0 + +* Automatic conversion of keyword arguments and positional arguments is + deprecated, and conversion will be removed in Ruby 3. [Feature #14183] + + * When a method call passes a Hash at the last argument, and when it + passes no keywords, and when the called method accepts keywords, + a warning is emitted. To continue treating the hash as keywords, + add a double splat operator to avoid the warning and ensure + correct behavior in Ruby 3. + + def foo(key: 42); end; foo({key: 42}) # warned + def foo(**kw); end; foo({key: 42}) # warned + def foo(key: 42); end; foo(**{key: 42}) # OK + def foo(**kw); end; foo(**{key: 42}) # OK + + * When a method call passes keywords to a method that accepts keywords, + but it does not pass enough required positional arguments, the + keywords are treated as a final required positional argument, and a + warning is emitted. Pass the argument as a hash instead of keywords + to avoid the warning and ensure correct behavior in Ruby 3. + + def foo(h, **kw); end; foo(key: 42) # warned + def foo(h, key: 42); end; foo(key: 42) # warned + def foo(h, **kw); end; foo({key: 42}) # OK + def foo(h, key: 42); end; foo({key: 42}) # OK + + * When a method accepts specific keywords but not a keyword splat, and + a hash or keywords splat is passed to the method that includes both + Symbol and non-Symbol keys, the hash will continue to be split, and + a warning will be emitted. You will need to update the calling code + to pass separate hashes to ensure correct behavior in Ruby 3. + + def foo(h={}, key: 42); end; foo("key" => 43, key: 42) # warned + def foo(h={}, key: 42); end; foo({"key" => 43, key: 42}) # warned + def foo(h={}, key: 42); end; foo({"key" => 43}, key: 42) # OK + + * If a method does not accept keywords, and is called with keywords, + the keywords are still treated as a positional hash, with no warning. + This behavior will continue to work in Ruby 3. + + def foo(opt={}); end; foo( key: 42 ) # OK + +* Non-symbols are allowed as keyword argument keys if the method accepts + arbitrary keywords. [Feature #14183] + + * Non-Symbol keys in a keyword arguments hash were prohibited in 2.6.0, + but are now allowed again. [Bug #15658] + + def foo(**kw); p kw; end; foo("str" => 1) #=> {"str"=>1} + +* <code>**nil</code> is allowed in method definitions to explicitly mark + that the method accepts no keywords. Calling such a method with keywords + will result in an ArgumentError. [Feature #14183] + + def foo(h, **nil); end; foo(key: 1) # ArgumentError + def foo(h, **nil); end; foo(**{key: 1}) # ArgumentError + def foo(h, **nil); end; foo("str" => 1) # ArgumentError + def foo(h, **nil); end; foo({key: 1}) # OK + def foo(h, **nil); end; foo({"str" => 1}) # OK + +* Passing an empty keyword splat to a method that does not accept keywords + no longer passes an empty hash, unless the empty hash is necessary for + a required parameter, in which case a warning will be emitted. Remove + the double splat to continue passing a positional hash. [Feature #14183] + + h = {}; def foo(*a) a end; foo(**h) # [] + h = {}; def foo(a) a end; foo(**h) # {} and warning + h = {}; def foo(*a) a end; foo(h) # [{}] + h = {}; def foo(a) a end; foo(h) # {} + +* Above warnings can be suppressed also with {-W:no-deprecated option}[#label-Warning+option]. + +==== Numbered parameters + +* Numbered parameters as default block parameters are introduced. [Feature #4475] + + [1, 2, 10].map { _1.to_s(16) } #=> ["1", "2", "a"] + [[1, 2], [3, 4]].map { _1 + _2 } #=> [3, 7] + + You can still define a local variable named +_1+ and so on, + and that is honored when present, but renders a warning. + + _1 = 0 #=> warning: `_1' is reserved for numbered parameter; consider another name + [1].each { p _1 } # prints 0 instead of 1 + +==== proc/lambda without block is deprecated + +* Proc.new and Kernel#proc with no block in a method called with a block will + now display a warning. + + def foo + proc + end + foo { puts "Hello" } #=> warning: Capturing the given block using Kernel#proc is deprecated; use `&block` instead + + This warning can be suppressed with {-W:no-deprecated option}[#label-Warning+option]. + +* Kernel#lambda with no block in a method called with a block raises an exception. + + def bar + lambda + end + bar { puts "Hello" } #=> tried to create Proc object without a block (ArgumentError) + +==== Other miscellaneous changes + +* A beginless range is experimentally introduced. It might be useful + in +case+, new call-sequence of the <code>Comparable#clamp</code>, + constants and DSLs. [Feature #14799] + + ary[..3] # identical to ary[0..3] + + case RUBY_VERSION + when ..."2.4" then puts "EOL" + # ... + end + + age.clamp(..100) + + where(sales: ..100) + +* Setting <code>$;</code> to a non-nil value will now display a warning. [Feature #14240] + This includes the usage in String#split. + This warning can be suppressed with {-W:no-deprecated option}[#label-Warning+option]. + +* Setting <code>$,</code> to a non-nil value will now display a warning. [Feature #14240] + This includes the usage in Array#join. + This warning can be suppressed with {-W:no-deprecated option}[#label-Warning+option]. + +* Quoted here-document identifiers must end within the same line. + + <<"EOS + " # This had been warned since 2.4; Now it raises a SyntaxError + EOS + +* The flip-flop syntax deprecation is reverted. [Feature #5400] + +* Comment lines can be placed between fluent dot now. + + foo + # .bar + .baz # => foo.baz + +* Calling a private method with a literal +self+ as the receiver + is now allowed. [Feature #11297] [Feature #16123] + +* Modifier rescue now operates the same for multiple assignment as single + assignment. [Bug #8279] + + a, b = raise rescue [1, 2] + # Previously parsed as: (a, b = raise) rescue [1, 2] + # Now parsed as: a, b = (raise rescue [1, 2]) + +* +yield+ in singleton class syntax will now display a warning. This behavior + will soon be deprecated. [Feature #15575]. + + def foo + class << Object.new + yield #=> warning: `yield' in class syntax will not be supported from Ruby 3.0. [Feature #15575] + end + end + foo { p :ok } + + This warning can be suppressed with {-W:no-deprecated option}[#label-Warning+option]. + +* Argument forwarding by <code>(...)</code> is introduced. [Feature #16253] + + def foo(...) + bar(...) + end + + All arguments to +foo+ are forwarded to +bar+, including keyword and + block arguments. + Note that the parentheses are mandatory. <code>bar ...</code> is parsed + as an endless range. + +* Access and setting of <code>$SAFE</code> will now always display a warning. + <code>$SAFE</code> will become a normal global variable in Ruby 3.0. [Feature #16131] + +* <code>Object#{taint,untaint,trust,untrust}</code> and related functions in the C-API + no longer have an effect (all objects are always considered untainted), and will now + display a warning in verbose mode. This warning will be disabled even in non-verbose mode in + Ruby 3.0, and the methods and C functions will be removed in Ruby 3.2. [Feature #16131] + +* Refinements take place at Object#method and Module#instance_method. [Feature #15373] + +=== Command line options + +==== Warning option + +The +-W+ option has been extended with a following +:+, to manage categorized +warnings. [Feature #16345] [Feature #16420] + +* To suppress deprecation warnings: + + $ ruby -e '$; = ""' + -e:1: warning: `$;' is deprecated + + $ ruby -W:no-deprecated -e '$; = //' + +* It works with the +RUBYOPT+ environment variable: + + $ RUBYOPT=-W:no-deprecated ruby -e '$; = //' + +* To suppress experimental feature warnings: + + $ ruby -e '0 in a' + -e:1: warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby! + + $ ruby -W:no-experimental -e '0 in a' + +* To suppress both by using +RUBYOPT+, set space separated values: + + $ RUBYOPT='-W:no-deprecated -W:no-experimental' ruby -e '($; = "") in a' + +See also Warning in {Core classes updates}[#label-Core+classes+updates+-28outstanding+ones+only-29]. + +=== Core classes updates (outstanding ones only) + +[Array] + + [New methods] + + * Added Array#intersection. [Feature #16155] + + * Added Array#minmax, with a faster implementation than Enumerable#minmax. [Bug #15929] + +[Comparable] + + [Modified method] + + * Comparable#clamp now accepts a Range argument. [Feature #14784] + + -1.clamp(0..2) #=> 0 + 1.clamp(0..2) #=> 1 + 3.clamp(0..2) #=> 2 + # With beginless and endless ranges: + -1.clamp(0..) #=> 0 + 3.clamp(..2) #=> 2 + + +[Complex] + + [New method] + + * Added Complex#<=>. + So <code>0 <=> 0i</code> will not raise NoMethodError. [Bug #15857] + +[Dir] + + [Modified methods] + + * Dir.glob and Dir.[] no longer allow NUL-separated glob pattern. + Use Array instead. [Feature #14643] + +[Encoding] + + [New encoding] + + * Added new encoding CESU-8. [Feature #15931] + +[Enumerable] + + [New methods] + + * Added Enumerable#filter_map. [Feature #15323] + + [1, 2, 3].filter_map {|x| x.odd? ? x.to_s : nil } #=> ["1", "3"] + + * Added Enumerable#tally. [Feature #11076] + + ["A", "B", "C", "B", "A"].tally #=> {"A"=>2, "B"=>2, "C"=>1} + +[Enumerator] + + [New methods] + + * Added Enumerator.produce to generate an Enumerator from any custom + data transformation. [Feature #14781] + + require "date" + dates = Enumerator.produce(Date.today, &:succ) #=> infinite sequence of dates + dates.detect(&:tuesday?) #=> next Tuesday + + * Added Enumerator::Lazy#eager that generates a non-lazy enumerator + from a lazy enumerator. [Feature #15901] + + a = %w(foo bar baz) + e = a.lazy.map {|x| x.upcase }.map {|x| x + "!" }.eager + p e.class #=> Enumerator + p e.map {|x| x + "?" } #=> ["FOO!?", "BAR!?", "BAZ!?"] + + * Added Enumerator::Yielder#to_proc so that a Yielder object + can be directly passed to another method as a block + argument. [Feature #15618] + + * Added Enumerator::Lazy#with_index be lazy + Previously, Enumerator::Lazy#with_index was not defined, so it + picked up the default implementation from Enumerator, which was + not lazy. [Bug #7877] + + ("a"..).lazy.with_index(1) { |it, index| puts "#{index}:#{it}" }.take(3).force + # => 1:a + # 2:b + # 3:c + +[Fiber] + + [New method] + + * Added Fiber#raise that behaves like Fiber#resume but raises an + exception on the resumed fiber. [Feature #10344] + +[File] + + [New method] + + * Added File.absolute_path? to check whether a path is absolute or + not in a portable way. [Feature #15868] + + File.absolute_path?("/foo") # => true (on *nix) + File.absolute_path?("C:/foo") # => true (on Windows) + File.absolute_path?("foo") # => false + + [Modified method] + + * File.extname now returns a dot string for names ending with a dot on + non-Windows platforms. [Bug #15267] + + File.extname("foo.") #=> "." + +[FrozenError] + + [New method] + + * Added FrozenError#receiver to return the frozen object on which + modification was attempted. To set this object when raising + FrozenError in Ruby code, FrozenError.new accepts a +:receiver+ + option. [Feature #15751] + +[GC] + + [New method] + + * Added GC.compact method for compacting the heap. + This function compacts live objects in the heap so that fewer pages may + be used, and the heap may be more CoW (copy-on-write) friendly. [Feature #15626] + + Details on the algorithm and caveats can be found here: + https://bugs.ruby-lang.org/issues/15626 + +[IO] + + [New method] + + * Added IO#set_encoding_by_bom to check the BOM and set the external + encoding. [Bug #15210] + +[Integer] + + [Modified method] + + * Integer#[] now supports range operations. [Feature #8842] + + 0b01001101[2, 4] #=> 0b0011 + 0b01001100[2..5] #=> 0b0011 + 0b01001100[2...6] #=> 0b0011 + # ^^^^ + +[Method] + + [Modified method] + + * Method#inspect shows more information. [Feature #14145] + +[Module] + + [New methods] + + * Added Module#const_source_location to retrieve the location where a + constant is defined. [Feature #10771] + + * Added Module#ruby2_keywords for marking a method as passing keyword + arguments through a regular argument splat, useful when delegating + all arguments to another method in a way that can be backwards + compatible with older Ruby versions. [Bug #16154] + + [Modified methods] + + * Module#autoload? now takes an +inherit+ optional argument, like + Module#const_defined?. [Feature #15777] + + * Module#name now always returns a frozen String. The returned String is + always the same for a given Module. This change is + experimental. [Feature #16150] + +[NilClass / TrueClass / FalseClass] + + [Modified methods] + + * NilClass#to_s, TrueClass#to_s, and FalseClass#to_s now always return a + frozen String. The returned String is always the same for each of these + values. This change is experimental. [Feature #16150] + +[ObjectSpace::WeakMap] + + [Modified method] + + * ObjectSpace::WeakMap#[]= now accepts special objects as either key or + values. [Feature #16035] + +[Proc] + + [New method] + + * Added Proc#ruby2_keywords for marking the proc as passing keyword + arguments through a regular argument splat, useful when delegating + all arguments to another method or proc in a way that can be backwards + compatible with older Ruby versions. [Feature #16404] + +[Range] + + [New method] + + * Added Range#minmax, with a faster implementation than Enumerable#minmax. + It returns a maximum that now corresponds to Range#max. [Bug #15807] + + [Modified method] + + * Range#=== now uses Range#cover? for String arguments, too (in Ruby 2.6, it was + changed from Range#include? for all types except strings). [Bug #15449] + + +[RubyVM] + + [Removed method] + + * +RubyVM.resolve_feature_path+ moved to + <code>$LOAD_PATH.resolve_feature_path</code>. [Feature #15903] [Feature #15230] + +[String] + + [Unicode] + + * Update Unicode version and Emoji version from 11.0.0 to + 12.0.0. [Feature #15321] + + * Update Unicode version to 12.1.0, adding support for + U+32FF SQUARE ERA NAME REIWA. [Feature #15195] + + * Update Unicode Emoji version to 12.1. [Feature #16272] + +[Symbol] + + [New methods] + + * Added Symbol#start_with? and Symbol#end_with? methods. [Feature #16348] + +[Time] + + [New methods] + + * Added Time#ceil method. [Feature #15772] + + * Added Time#floor method. [Feature #15653] + + [Modified method] + + * Time#inspect is separated from Time#to_s and it shows + the time's sub second. [Feature #15958] + +[UnboundMethod] + + [New method] + + * Added UnboundMethod#bind_call method. [Feature #15955] + + <code>umethod.bind_call(obj, ...)</code> is semantically equivalent + to <code>umethod.bind(obj).call(...)</code>. This idiom is used in + some libraries to call a method that is overridden. The added + method does the same without allocation of an intermediate Method + object. + + class Foo + def add_1(x) + x + 1 + end + end + class Bar < Foo + def add_1(x) # override + x + 2 + end + end + + obj = Bar.new + p obj.add_1(1) #=> 3 + p Foo.instance_method(:add_1).bind(obj).call(1) #=> 2 + p Foo.instance_method(:add_1).bind_call(obj, 1) #=> 2 + +[Warning] + + [New methods] + + * Added Warning.[] and Warning.[]= to manage emitting/suppressing + some categories of warnings. [Feature #16345] [Feature #16420] + +[$LOAD_PATH] + + [New method] + + * Added <code>$LOAD_PATH.resolve_feature_path</code>. [Feature #15903] [Feature #15230] + +=== Stdlib updates (outstanding ones only) + +[Bundler] + + * Upgrade to Bundler 2.1.2. + See https://github.com/bundler/bundler/releases/tag/v2.1.2 + +[CGI] + + * CGI.escapeHTML becomes 2~5x faster when there is at least one escaped character. + See https://github.com/ruby/ruby/pull/2226 + +[CSV] + + * Upgrade to 3.1.2. + See https://github.com/ruby/csv/blob/master/NEWS.md. + +[Date] + + * Date.jisx0301, Date#jisx0301, and Date.parse support the new Japanese + era. [Feature #15742] + +[Delegator] + + * Object#DelegateClass accepts a block and module_evals it in the context + of the returned class, similar to Class.new and Struct.new. + +[ERB] + + * Prohibit marshaling ERB instance. + +[IRB] + + * Introduce syntax highlighting inspired by the Pry gem to Binding#irb + source lines, REPL input, and inspect output of some core-class objects. + + * Introduce multiline editing mode provided by Reline. + + * Show documentation when completion. + + * Enable auto indent and save/load history by default. + +[JSON] + + * Upgrade to 2.3.0. + +[Net::FTP] + + * Add Net::FTP#features to check available features, and Net::FTP#option to + enable/disable each of them. [Feature #15964] + +[Net::HTTP] + + * Add +ipaddr+ optional parameter to Net::HTTP#start to replace the address for + the TCP/IP connection. [Feature #5180] + +[Net::IMAP] + + * Add Server Name Indication (SNI) support. [Feature #15594] + +[open-uri] + + * Warn open-uri's "open" method at Kernel. + Use URI.open instead. [Misc #15893] + + * The default charset of "text/*" media type is UTF-8 instead of + ISO-8859-1. [Bug #15933] + +[OptionParser] + + * Now show "Did you mean?" for unknown options. [Feature #16256] + + test.rb: + + require "optparse" + OptionParser.new do |opts| + opts.on("-f", "--foo", "foo") {|v| } + opts.on("-b", "--bar", "bar") {|v| } + opts.on("-c", "--baz", "baz") {|v| } + end.parse! + + example: + + $ ruby test.rb --baa + Traceback (most recent call last): + test.rb:7:in `<main>': invalid option: --baa (OptionParser::InvalidOption) + Did you mean? baz + bar + +[Pathname] + + * Pathname.glob now delegates 3 arguments to Dir.glob + to accept +base+ keyword. [Feature #14405] + +[Racc] + + * Merge 1.4.15 from upstream repository and added cli of racc. + +[Reline] + + * New stdlib that is compatible with the readline stdlib but is + implemented in pure Ruby. It also provides a multiline editing mode. + +[REXML] + + * Upgrade to 3.2.3. + See https://github.com/ruby/rexml/blob/master/NEWS.md. + +[RSS] + + * Upgrade to RSS 0.2.8. + See https://github.com/ruby/rss/blob/master/NEWS.md. + +[RubyGems] + + * Upgrade to RubyGems 3.1.2. + * https://github.com/rubygems/rubygems/releases/tag/v3.1.0 + * https://github.com/rubygems/rubygems/releases/tag/v3.1.1 + * https://github.com/rubygems/rubygems/releases/tag/v3.1.2 + +[StringScanner] + + * Upgrade to 1.0.3. + See https://github.com/ruby/strscan/blob/master/NEWS.md. + +=== Compatibility issues (excluding feature bug fixes) + +* The following libraries are no longer bundled gems. + Install corresponding gems to use these features. + * CMath (cmath gem) + * Scanf (scanf gem) + * Shell (shell gem) + * Synchronizer (sync gem) + * ThreadsWait (thwait gem) + * E2MM (e2mmap gem) + +[Proc] + * The Proc#to_s format was changed. [Feature #16101] + +[Range] + * Range#minmax used to iterate on the range to determine the maximum. + It now uses the same algorithm as Range#max. In rare cases (e.g. + ranges of Floats or Strings), this may yield different results. [Bug #15807] + +=== Stdlib compatibility issues (excluding feature bug fixes) + +* Promote stdlib to default gems + * The following default gems were published on rubygems.org + * benchmark + * cgi + * delegate + * getoptlong + * net-pop + * net-smtp + * open3 + * pstore + * readline + * readline-ext + * singleton + * The following default gems were only promoted at ruby-core, + but not yet published on rubygems.org. + * monitor + * observer + * timeout + * tracer + * uri + * yaml +* The <tt>did_you_mean</tt> gem has been promoted up to a default gem from a bundled gem + +[pathname] + + * Kernel#Pathname when called with a Pathname argument now returns + the argument instead of creating a new Pathname. This is more + similar to other Kernel methods, but can break code that modifies + the return value and expects the argument not to be modified. + +[profile.rb, Profiler__] + + * Removed from standard library. It was unmaintained since Ruby 2.0.0. + +=== C API updates + +* Many <code>*_kw</code> functions have been added for setting whether + the final argument being passed should be treated as keywords. You + may need to switch to these functions to avoid keyword argument + separation warnings, and to ensure correct behavior in Ruby 3. + +* The <code>:</code> character in rb_scan_args format string is now + treated as keyword arguments. Passing a positional hash instead of + keyword arguments will emit a deprecation warning. + +* C API declarations with +ANYARGS+ are changed not to use +ANYARGS+. + See https://github.com/ruby/ruby/pull/2404 + +=== Implementation improvements + +[Fiber] + + * Allow selecting different coroutine implementations by using + +--with-coroutine=+, e.g. + + $ ./configure --with-coroutine=ucontext + $ ./configure --with-coroutine=copy + + * Replace previous stack cache with fiber pool cache. The fiber pool + allocates many stacks in a single memory region. Stack allocation + becomes O(log N) and fiber creation is amortized O(1). Around 10x + performance improvement was measured in micro-benchmarks. + https://github.com/ruby/ruby/pull/2224 + +[File] + * File.realpath now uses realpath(3) on many platforms, which can + significantly improve performance. [Feature #15797] + +[Hash] + * Change data structure of small Hash objects. [Feature #15602] + +[Monitor] + * Monitor class is written in C-extension. [Feature #16255] + +[Thread] + + * VM stack memory allocation is now combined with native thread stack, + improving thread allocation performance and reducing allocation related + failures. Around 10x performance improvement was measured in micro-benchmarks. + +[JIT] + + * JIT-ed code is recompiled to less-optimized code when an optimization assumption is invalidated. + + * Method inlining is performed when a method is considered as pure. + This optimization is still experimental and many methods are NOT considered as pure yet. + + * The default value of +--jit-max-cache+ is changed from 1,000 to 100. + + * The default value of +--jit-min-calls+ is changed from 5 to 10,000. + +[RubyVM] + + * Per-call-site method cache, which has been there since around 1.9, was + improved: cache hit rate raised from 89% to 94%. + See https://github.com/ruby/ruby/pull/2583 + +[RubyVM::InstructionSequence] + + * RubyVM::InstructionSequence#to_binary method generates compiled binary. + The binary size is reduced. [Feature #16163] + +=== Miscellaneous changes + +* Support for IA64 architecture has been removed. Hardware for testing was + difficult to find, native fiber code is difficult to implement, and it added + non-trivial complexity to the interpreter. [Feature #15894] + +* Require compilers to support C99. [Misc #15347] + + * Details of our dialect: https://bugs.ruby-lang.org/projects/ruby-master/wiki/C99 + +* Ruby's upstream repository is changed from Subversion to Git. + + * https://git.ruby-lang.org/ruby.git + + * RUBY_REVISION class is changed from Integer to String. + + * RUBY_DESCRIPTION includes Git revision instead of Subversion's one. + +* Support built-in methods in Ruby with the <code>_\_builtin_</code> syntax. [Feature #16254] + + Some methods are defined in *.rb (such as trace_point.rb). + For example, it is easy to define a method which accepts keyword arguments. diff --git a/doc/NEWS/NEWS-3.0.0.md b/doc/NEWS/NEWS-3.0.0.md new file mode 100644 index 0000000000..00c26fe585 --- /dev/null +++ b/doc/NEWS/NEWS-3.0.0.md @@ -0,0 +1,817 @@ +# NEWS for Ruby 3.0.0 + +This document is a list of user visible feature changes +since the **2.7.0** release, except for bug fixes. + +Note that each entry is kept to a minimum, see links for details. + +## Language changes + +* Keyword arguments are now separated from positional arguments. + Code that resulted in deprecation warnings in Ruby 2.7 will now + result in ArgumentError or different behavior. [[Feature #14183]] + +* Procs accepting a single rest argument and keywords are no longer + subject to autosplatting. This now matches the behavior of Procs + accepting a single rest argument and no keywords. + [[Feature #16166]] + + ```ruby + pr = proc{|*a, **kw| [a, kw]} + + pr.call([1]) + # 2.7 => [[1], {}] + # 3.0 => [[[1]], {}] + + pr.call([1, {a: 1}]) + # 2.7 => [[1], {:a=>1}] # and deprecation warning + # 3.0 => [[[1, {:a=>1}]], {}] + ``` + +* Arguments forwarding (`...`) now supports leading arguments. + [[Feature #16378]] + + ```ruby + def method_missing(meth, ...) + send(:"do_#{meth}", ...) + end + ``` + +* Pattern matching (`case/in`) is no longer experimental. [[Feature #17260]] + +* One-line pattern matching is redesigned. [EXPERIMENTAL] + + * `=>` is added. It can be used like a rightward assignment. + [[Feature #17260]] + + ```ruby + 0 => a + p a #=> 0 + + {b: 0, c: 1} => {b:} + p b #=> 0 + ``` + + * `in` is changed to return `true` or `false`. [[Feature #17371]] + + ```ruby + # version 3.0 + 0 in 1 #=> false + + # version 2.7 + 0 in 1 #=> raise NoMatchingPatternError + ``` + +* Find-pattern is added. [EXPERIMENTAL] + [[Feature #16828]] + + ```ruby + case ["a", 1, "b", "c", 2, "d", "e", "f", 3] + in [*pre, String => x, String => y, *post] + p pre #=> ["a", 1] + p x #=> "b" + p y #=> "c" + p post #=> [2, "d", "e", "f", 3] + end + ``` + +* Endless method definition is added. [EXPERIMENTAL] + [[Feature #16746]] + + ```ruby + def square(x) = x * x + ``` + +* Interpolated String literals are no longer frozen when + `# frozen-string-literal: true` is used. [[Feature #17104]] + +* Magic comment `shareable_constant_value` added to freeze constants. + See {Magic Comments}[rdoc-ref:syntax/comments.rdoc@Magic+Comments] for more details. + [[Feature #17273]] + +* A {static analysis}[rdoc-label:label-Static+analysis] foundation is + introduced. + * {RBS}[rdoc-label:label-RBS] is introduced. It is a type definition + language for Ruby programs. + * {TypeProf}[rdoc-label:label-TypeProf] is experimentally bundled. It is a + type analysis tool for Ruby programs. + +* Deprecation warnings are no longer shown by default (since Ruby 2.7.2). + Turn them on with `-W:deprecated` (or with `-w` to show other warnings too). + [[Feature #16345]] + +* `$SAFE` and `$KCODE` are now normal global variables with no special behavior. + C-API methods related to `$SAFE` have been removed. + [[Feature #16131]] [[Feature #17136]] + +* yield in singleton class definitions in methods is now a SyntaxError + instead of a warning. yield in a class definition outside of a method + is now a SyntaxError instead of a LocalJumpError. [[Feature #15575]] + +* When a class variable is overtaken by the same definition in an + ancestor class/module, a RuntimeError is now raised (previously, + it only issued a warning in verbose mode). Additionally, accessing a + class variable from the toplevel scope is now a RuntimeError. + [[Bug #14541]] + +* Assigning to a numbered parameter is now a SyntaxError instead of + a warning. + +## Command line options + +### `--help` option + +When the environment variable `RUBY_PAGER` or `PAGER` is present and has +a non-empty value, and the standard input and output are tty, the `--help` +option shows the help message via the pager designated by the value. +[[Feature #16754]] + +### `--backtrace-limit` option + +The `--backtrace-limit` option limits the maximum length of a backtrace. +[[Feature #8661]] + +## Core classes updates + +Outstanding ones only. + +* Array + + * The following methods now return Array instances instead of + subclass instances when called on subclass instances: + [[Bug #6087]] + + * Array#drop + * Array#drop_while + * Array#flatten + * Array#slice! + * Array#slice / Array#[] + * Array#take + * Array#take_while + * Array#uniq + * Array#* + + * Can be sliced with Enumerator::ArithmeticSequence + + ```ruby + dirty_data = ['--', 'data1', '--', 'data2', '--', 'data3'] + dirty_data[(1..).step(2)] # take each second element + # => ["data1", "data2", "data3"] + ``` + +* Binding + + * Binding#eval when called with one argument will use `"(eval)"` + for `__FILE__` and `1` for `__LINE__` in the evaluated code. + [[Bug #4352]] [[Bug #17419]] + +* ConditionVariable + + * ConditionVariable#wait may now invoke the `block`/`unblock` scheduler + hooks in a non-blocking context. [[Feature #16786]] + +* Dir + + * Dir.glob and Dir.[] now sort the results by default, and + accept the `sort:` keyword option. [[Feature #8709]] + +* ENV + + * ENV.except has been added, which returns a hash excluding the + given keys and their values. [[Feature #15822]] + + * Windows: Read ENV names and values as UTF-8 encoded Strings + [[Feature #12650]] + +* Encoding + + * Added new encoding IBM720. [[Feature #16233]] + + * Changed default for Encoding.default_external to UTF-8 on Windows + [[Feature #16604]] + +* Fiber + + * Fiber.new(blocking: true/false) allows you to create non-blocking + execution contexts. [[Feature #16786]] + + * Fiber#blocking? tells whether the fiber is non-blocking. [[Feature #16786]] + + * Fiber#backtrace and Fiber#backtrace_locations provide per-fiber backtrace. + [[Feature #16815]] + + * The limitation of Fiber#transfer is relaxed. [[Bug #17221]] + +* GC + + * GC.auto_compact= and GC.auto_compact have been added to control + when compaction runs. Setting `auto_compact=` to `true` will cause + compaction to occur during major collections. At the moment, + compaction adds significant overhead to major collections, so please + test first! [[Feature #17176]] + +* Hash + + * Hash#transform_keys and Hash#transform_keys! now accept a hash that maps + keys to new keys. [[Feature #16274]] + + * Hash#except has been added, which returns a hash excluding the + given keys and their values. [[Feature #15822]] + +* IO + + * IO#nonblock? now defaults to `true`. [[Feature #16786]] + + * IO#wait_readable, IO#wait_writable, IO#read, IO#write and other + related methods (e.g. IO#puts, IO#gets) may invoke the scheduler hook + `#io_wait(io, events, timeout)` in a non-blocking execution context. + [[Feature #16786]] + +* Kernel + + * Kernel#clone when called with the `freeze: false` keyword will call + `#initialize_clone` with the `freeze: false` keyword. + [[Bug #14266]] + + * Kernel#clone when called with the `freeze: true` keyword will call + `#initialize_clone` with the `freeze: true` keyword, and will + return a frozen copy even if the receiver is unfrozen. + [[Feature #16175]] + + * Kernel#eval when called with two arguments will use `"(eval)"` + for `__FILE__` and `1` for `__LINE__` in the evaluated code. + [[Bug #4352]] + + * Kernel#lambda now warns if called without a literal block. + [[Feature #15973]] + + * Kernel.sleep invokes the scheduler hook `#kernel_sleep(...)` in a + non-blocking execution context. [[Feature #16786]] + +* Module + + * Module#include and Module#prepend now affect classes and modules + that have already included or prepended the receiver, mirroring the + behavior if the arguments were included in the receiver before + the other modules and classes included or prepended the receiver. + [[Feature #9573]] + + ```ruby + class C; end + module M1; end + module M2; end + C.include M1 + M1.include M2 + p C.ancestors #=> [C, M1, M2, Object, Kernel, BasicObject] + ``` + + * Module#public, Module#protected, Module#private, Module#public_class_method, + Module#private_class_method, toplevel "private" and "public" methods + now accept single array argument with a list of method names. [[Feature #17314]] + + * Module#attr_accessor, Module#attr_reader, Module#attr_writer and Module#attr + methods now return an array of defined method names as symbols. + [[Feature #17314]] + + * Module#alias_method now returns the defined alias as a symbol. + [[Feature #17314]] + +* Mutex + + * `Mutex` is now acquired per-`Fiber` instead of per-`Thread`. This change + should be compatible for essentially all usages and avoids blocking when + using a scheduler. [[Feature #16792]] + +* Proc + + * Proc#== and Proc#eql? are now defined and will return true for + separate Proc instances if the procs were created from the same block. + [[Feature #14267]] + +* Queue / SizedQueue + + * Queue#pop, SizedQueue#push and related methods may now invoke the + `block`/`unblock` scheduler hooks in a non-blocking context. + [[Feature #16786]] + +* Ractor + + * New class added to enable parallel execution. See rdoc-ref:ractor.md for + more details. + +* Random + + * `Random::DEFAULT` now refers to the `Random` class instead of being a `Random` instance, + so it can work with `Ractor`. + [[Feature #17322]] + + * `Random::DEFAULT` is deprecated since its value is now confusing and it is no longer global, + use `Kernel.rand`/`Random.rand` directly, or create a `Random` instance with `Random.new` instead. + [[Feature #17351]] + + +* String + + * The following methods now return or yield String instances + instead of subclass instances when called on subclass instances: + [[Bug #10845]] + + * String#* + * String#capitalize + * String#center + * String#chomp + * String#chop + * String#delete + * String#delete_prefix + * String#delete_suffix + * String#downcase + * String#dump + * String#each_char + * String#each_grapheme_cluster + * String#each_line + * String#gsub + * String#ljust + * String#lstrip + * String#partition + * String#reverse + * String#rjust + * String#rpartition + * String#rstrip + * String#scrub + * String#slice! + * String#slice / String#[] + * String#split + * String#squeeze + * String#strip + * String#sub + * String#succ / String#next + * String#swapcase + * String#tr + * String#tr_s + * String#upcase + +* Symbol + + * Symbol#to_proc now returns a lambda Proc. [[Feature #16260]] + + * Symbol#name has been added, which returns the name of the symbol + if it is named. The returned string is frozen. [[Feature #16150]] + +* Fiber + + * Introduce Fiber.set_scheduler for intercepting blocking operations and + Fiber.scheduler for accessing the current scheduler. See + rdoc-ref:fiber.md for more details about what operations are supported and + how to implement the scheduler hooks. [[Feature #16786]] + + * Fiber.blocking? tells whether the current execution context is + blocking. [[Feature #16786]] + + * Thread#join invokes the scheduler hooks `block`/`unblock` in a + non-blocking execution context. [[Feature #16786]] + +* Thread + + * Thread.ignore_deadlock accessor has been added for disabling the + default deadlock detection, allowing the use of signal handlers to + break deadlock. [[Bug #13768]] + +* Warning + + * Warning#warn now supports a category keyword argument. + [[Feature #17122]] + +## Stdlib updates + +Outstanding ones only. + +* BigDecimal + + * Update to BigDecimal 3.0.0 + + * This version is Ractor compatible. + +* Bundler + + * Update to Bundler 2.2.3 + +* CGI + + * Update to 0.2.0 + + * This version is Ractor compatible. + +* CSV + + * Update to CSV 3.1.9 + +* Date + + * Update to Date 3.1.1 + + * This version is Ractor compatible. + +* Digest + + * Update to Digest 3.0.0 + + * This version is Ractor compatible. + +* Etc + + * Update to Etc 1.2.0 + + * This version is Ractor compatible. + +* Fiddle + + * Update to Fiddle 1.0.5 + +* IRB + + * Update to IRB 1.2.6 + +* JSON + + * Update to JSON 2.5.0 + + * This version is Ractor compatible. + +* Set + + * Update to set 1.0.0 + + * SortedSet has been removed for dependency and performance reasons. + + * Set#join is added as a shorthand for `.to_a.join`. + + * Set#<=> is added. + +* Socket + + * Add :connect_timeout to TCPSocket.new [[Feature #17187]] + +* Net::HTTP + + * Net::HTTP#verify_hostname= and Net::HTTP#verify_hostname have been + added to skip hostname verification. [[Feature #16555]] + + * Net::HTTP.get, Net::HTTP.get_response, and Net::HTTP.get_print + can take the request headers as a Hash in the second argument when the + first argument is a URI. [[Feature #16686]] + +* Net::SMTP + + * Add SNI support. + + * Net::SMTP.start arguments are keyword arguments. + + * TLS should not check the host name by default. + +* OpenStruct + + * Initialization is no longer lazy. [[Bug #12136]] + + * Builtin methods can now be overridden safely. [[Bug #15409]] + + * Implementation uses only methods ending with `!`. + + * Ractor compatible. + + * Improved support for YAML. [[Bug #8382]] + + * Use officially discouraged. Read OpenStruct@Caveats section. + +* Pathname + + * Ractor compatible. + +* Psych + + * Update to Psych 3.3.0 + + * This version is Ractor compatible. + +* Reline + + * Update to Reline 0.1.5 + +* RubyGems + + * Update to RubyGems 3.2.3 + +* StringIO + + * Update to StringIO 3.0.0 + + * This version is Ractor compatible. + +* StringScanner + + * Update to StringScanner 3.0.0 + + * This version is Ractor compatible. + +## Compatibility issues + +Excluding feature bug fixes. + +* Regexp literals and all Range objects are frozen. [[Feature #8948]] [[Feature #16377]] [[Feature #15504]] + + ```ruby + /foo/.frozen? #=> true + (42...).frozen? # => true + ``` + +* EXPERIMENTAL: Hash#each consistently yields a 2-element array. [[Bug #12706]] + + * Now `{ a: 1 }.each(&->(k, v) { })` raises an ArgumentError + due to lambda's arity check. + +* When writing to STDOUT redirected to a closed pipe, no broken pipe + error message will be shown now. [[Feature #14413]] + +* `TRUE`/`FALSE`/`NIL` constants are no longer defined. + +* Integer#zero? overrides Numeric#zero? for optimization. [[Misc #16961]] + +* Enumerable#grep and Enumerable#grep_v when passed a Regexp and no block no longer modify + Regexp.last_match. [[Bug #17030]] + +* Requiring 'open-uri' no longer redefines `Kernel#open`. + Call `URI.open` directly or `use URI#open` instead. [[Misc #15893]] + +* SortedSet has been removed for dependency and performance reasons. + +## Stdlib compatibility issues + +* Default gems + + * The following libraries are promoted to default gems from stdlib. + + * English + * abbrev + * base64 + * drb + * debug + * erb + * find + * net-ftp + * net-http + * net-imap + * net-protocol + * open-uri + * optparse + * pp + * prettyprint + * resolv-replace + * resolv + * rinda + * set + * securerandom + * shellwords + * tempfile + * tmpdir + * time + * tsort + * un + * weakref + + * The following extensions are promoted to default gems from stdlib. + + * digest + * io-nonblock + * io-wait + * nkf + * pathname + * syslog + * win32ole + +* Bundled gems + + * net-telnet and xmlrpc have been removed from the bundled gems. + If you are interested in maintaining them, please comment on + your plan to https://github.com/ruby/xmlrpc + or https://github.com/ruby/net-telnet. + +* SDBM has been removed from the Ruby standard library. [[Bug #8446]] + + * The issues of sdbm will be handled at https://github.com/ruby/sdbm + +* WEBrick has been removed from the Ruby standard library. [[Feature #17303]] + + * The issues of WEBrick will be handled at https://github.com/ruby/webrick + +## C API updates + +* C API functions related to `$SAFE` have been removed. + [[Feature #16131]] + +* C API header file `ruby/ruby.h` was split. [[GH-2991]] + + This should have no impact on extension libraries, + but users might experience slow compilations. + +* Memory view interface [EXPERIMENTAL] + + * The memory view interface is a C-API set to exchange a raw memory area, + such as a numeric array or a bitmap image, between extension libraries. + The extension libraries can share also the metadata of the memory area + that consists of the shape, the element format, and so on. + Using these kinds of metadata, the extension libraries can share even + a multidimensional array appropriately. + This feature is designed by referring to Python's buffer protocol. + [[Feature #13767]] [[Feature #14722]] + +* Ractor related C APIs are introduced (experimental) in "include/ruby/ractor.h". + +## Implementation improvements + +* New method cache mechanism for Ractor. [[Feature #16614]] + + * Inline method caches pointed from ISeq can be accessed by multiple Ractors + in parallel and synchronization is needed even for method caches. However, + such synchronization can be overhead so introducing new inline method cache + mechanisms, (1) Disposable inline method cache (2) per-Class method cache + and (3) new invalidation mechanism. (1) can avoid per-method call + synchronization because it only uses atomic operations. + See the ticket for more details. + +* The number of hashes allocated when using a keyword splat in + a method call has been reduced to a maximum of 1, and passing + a keyword splat to a method that accepts specific keywords + does not allocate a hash. + +* `super` is optimized when the same type of method is called in the previous call + if it's not refinements or an attr reader or writer. + +### JIT + +* Performance improvements of JIT-ed code + + * Microarchitectural optimizations + + * Native functions shared by multiple methods are deduplicated on JIT compaction. + + * Decrease code size of hot paths by some optimizations and partitioning cold paths. + + * Instance variables + + * Eliminate some redundant checks. + + * Skip checking a class and a object multiple times in a method when possible. + + * Optimize accesses in some core classes like Hash and their subclasses. + + * Method inlining support for some C methods + + * `Kernel`: `#class`, `#frozen?` + + * `Integer`: `#-@`, `#~`, `#abs`, `#bit_length`, `#even?`, `#integer?`, `#magnitude`, + `#odd?`, `#ord`, `#to_i`, `#to_int`, `#zero?` + + * `Struct`: reader methods for 10th or later members + + * Constant references are inlined. + + * Always generate appropriate code for `==`, `nil?`, and `!` calls depending on + a receiver class. + + * Reduce the number of PC accesses on branches and method returns. + + * Optimize C method calls a little. + +* Compilation process improvements + + * It does not keep temporary files in /tmp anymore. + + * Throttle GC and compaction of JIT-ed code. + + * Avoid GC-ing JIT-ed code when not necessary. + + * GC-ing JIT-ed code is executed in a background thread. + + * Reduce the number of locks between Ruby and JIT threads. + +## Static analysis + +### RBS + +* RBS is a new language for type definition of Ruby programs. + It allows writing types of classes and modules with advanced + types including union types, overloading, generics, and + _interface types_ for duck typing. + +* Ruby ships with type definitions for core/stdlib classes. + +* `rbs` gem is bundled to load and process RBS files. + +### TypeProf + +* TypeProf is a type analysis tool for Ruby code based on abstract interpretation. + + * It reads non-annotated Ruby code, tries inferring its type signature, and prints + the analysis result in RBS format. + + * Though it supports only a subset of the Ruby language yet, we will continuously + improve the coverage of language features, analysis performance, and usability. + +```ruby +# test.rb +def foo(x) + if x > 10 + x.to_s + else + nil + end +end + +foo(42) +``` + +``` +$ typeprof test.rb +# Classes +class Object + def foo : (Integer) -> String? +end +``` + +## Miscellaneous changes + +* Methods using `ruby2_keywords` will no longer keep empty keyword + splats, those are now removed just as they are for methods not + using `ruby2_keywords`. + +* When an exception is caught in the default handler, the error + message and backtrace are printed in order from the innermost. + [[Feature #8661]] + +* Accessing an uninitialized instance variable no longer emits a + warning in verbose mode. [[Feature #17055]] + +[Bug #4352]: https://bugs.ruby-lang.org/issues/4352 +[Bug #6087]: https://bugs.ruby-lang.org/issues/6087 +[Bug #8382]: https://bugs.ruby-lang.org/issues/8382 +[Bug #8446]: https://bugs.ruby-lang.org/issues/8446 +[Feature #8661]: https://bugs.ruby-lang.org/issues/8661 +[Feature #8709]: https://bugs.ruby-lang.org/issues/8709 +[Feature #8948]: https://bugs.ruby-lang.org/issues/8948 +[Feature #9573]: https://bugs.ruby-lang.org/issues/9573 +[Bug #10845]: https://bugs.ruby-lang.org/issues/10845 +[Bug #12136]: https://bugs.ruby-lang.org/issues/12136 +[Feature #12650]: https://bugs.ruby-lang.org/issues/12650 +[Bug #12706]: https://bugs.ruby-lang.org/issues/12706 +[Feature #13767]: https://bugs.ruby-lang.org/issues/13767 +[Bug #13768]: https://bugs.ruby-lang.org/issues/13768 +[Feature #14183]: https://bugs.ruby-lang.org/issues/14183 +[Bug #14266]: https://bugs.ruby-lang.org/issues/14266 +[Feature #14267]: https://bugs.ruby-lang.org/issues/14267 +[Feature #14413]: https://bugs.ruby-lang.org/issues/14413 +[Bug #14541]: https://bugs.ruby-lang.org/issues/14541 +[Feature #14722]: https://bugs.ruby-lang.org/issues/14722 +[Bug #15409]: https://bugs.ruby-lang.org/issues/15409 +[Feature #15504]: https://bugs.ruby-lang.org/issues/15504 +[Feature #15575]: https://bugs.ruby-lang.org/issues/15575 +[Feature #15822]: https://bugs.ruby-lang.org/issues/15822 +[Misc #15893]: https://bugs.ruby-lang.org/issues/15893 +[Feature #15921]: https://bugs.ruby-lang.org/issues/15921 +[Feature #15973]: https://bugs.ruby-lang.org/issues/15973 +[Feature #16131]: https://bugs.ruby-lang.org/issues/16131 +[Feature #16150]: https://bugs.ruby-lang.org/issues/16150 +[Feature #16166]: https://bugs.ruby-lang.org/issues/16166 +[Feature #16175]: https://bugs.ruby-lang.org/issues/16175 +[Feature #16233]: https://bugs.ruby-lang.org/issues/16233 +[Feature #16260]: https://bugs.ruby-lang.org/issues/16260 +[Feature #16274]: https://bugs.ruby-lang.org/issues/16274 +[Feature #16345]: https://bugs.ruby-lang.org/issues/16345 +[Feature #16377]: https://bugs.ruby-lang.org/issues/16377 +[Feature #16378]: https://bugs.ruby-lang.org/issues/16378 +[Feature #16555]: https://bugs.ruby-lang.org/issues/16555 +[Feature #16604]: https://bugs.ruby-lang.org/issues/16604 +[Feature #16614]: https://bugs.ruby-lang.org/issues/16614 +[Feature #16686]: https://bugs.ruby-lang.org/issues/16686 +[Feature #16746]: https://bugs.ruby-lang.org/issues/16746 +[Feature #16754]: https://bugs.ruby-lang.org/issues/16754 +[Feature #16786]: https://bugs.ruby-lang.org/issues/16786 +[Feature #16792]: https://bugs.ruby-lang.org/issues/16792 +[Feature #16815]: https://bugs.ruby-lang.org/issues/16815 +[Feature #16828]: https://bugs.ruby-lang.org/issues/16828 +[Misc #16961]: https://bugs.ruby-lang.org/issues/16961 +[Bug #17030]: https://bugs.ruby-lang.org/issues/17030 +[Feature #17055]: https://bugs.ruby-lang.org/issues/17055 +[Feature #17104]: https://bugs.ruby-lang.org/issues/17104 +[Feature #17122]: https://bugs.ruby-lang.org/issues/17122 +[Feature #17136]: https://bugs.ruby-lang.org/issues/17136 +[Feature #17176]: https://bugs.ruby-lang.org/issues/17176 +[Feature #17187]: https://bugs.ruby-lang.org/issues/17187 +[Bug #17221]: https://bugs.ruby-lang.org/issues/17221 +[Feature #17260]: https://bugs.ruby-lang.org/issues/17260 +[Feature #17273]: https://bugs.ruby-lang.org/issues/17273 +[Feature #17303]: https://bugs.ruby-lang.org/issues/17303 +[Feature #17314]: https://bugs.ruby-lang.org/issues/17314 +[Feature #17322]: https://bugs.ruby-lang.org/issues/17322 +[Feature #17351]: https://bugs.ruby-lang.org/issues/17351 +[Feature #17371]: https://bugs.ruby-lang.org/issues/17371 +[Bug #17419]: https://bugs.ruby-lang.org/issues/17419 +[GH-2991]: https://github.com/ruby/ruby/pull/2991 diff --git a/doc/NEWS/NEWS-3.1.0.md b/doc/NEWS/NEWS-3.1.0.md new file mode 100644 index 0000000000..fe292fc414 --- /dev/null +++ b/doc/NEWS/NEWS-3.1.0.md @@ -0,0 +1,660 @@ +# NEWS for Ruby 3.1.0 + +This document is a list of user-visible feature changes +since the **3.0.0** release, except for bug fixes. + +Note that each entry is kept to a minimum, see links for details. + +## Language changes + +* The block argument can now be anonymous if the block will + only be passed to another method. [[Feature #11256]] + + ```ruby + def foo(&) + bar(&) + end + ``` + +* Pin operator now takes an expression. [[Feature #17411]] + + ```ruby + Prime.each_cons(2).lazy.find_all{_1 in [n, ^(n + 2)]}.take(3).to_a + #=> [[3, 5], [5, 7], [11, 13]] + ``` + +* Pin operator now supports instance, class, and global variables. + [[Feature #17724]] + + ```ruby + @n = 5 + Prime.each_cons(2).lazy.find{_1 in [n, ^@n]} + #=> [3, 5] + ``` + +* One-line pattern matching is no longer experimental. + +* Parentheses can be omitted in one-line pattern matching. + [[Feature #16182]] + + ```ruby + [0, 1] => _, x + {y: 2} => y: + x #=> 1 + y #=> 2 + ``` + +* Multiple assignment evaluation order has been made consistent with + single assignment evaluation order. With single assignment, Ruby + uses a left-to-right evaluation order. With this code: + + ```ruby + foo[0] = bar + ``` + + The following evaluation order is used: + + 1. `foo` + 2. `bar` + 3. `[]=` called on the result of `foo` + + In Ruby before 3.1.0, multiple assignment did not follow this + evaluation order. With this code: + + ```ruby + foo[0], bar.baz = a, b + ``` + + Versions of Ruby before 3.1.0 would evaluate in the following + order + + 1. `a` + 2. `b` + 3. `foo` + 4. `[]=` called on the result of `foo` + 5. `bar` + 6. `baz=` called on the result of `bar` + + Starting in Ruby 3.1.0, the evaluation order is now consistent with + single assignment, with the left-hand side being evaluated before + the right-hand side: + + 1. `foo` + 2. `bar` + 3. `a` + 4. `b` + 5. `[]=` called on the result of `foo` + 6. `baz=` called on the result of `bar` + + [[Bug #4443]] + +* Values in Hash literals and keyword arguments can be omitted. + [[Feature #14579]] + + For example, + + * `{x:, y:}` is a syntax sugar of `{x: x, y: y}`. + * `foo(x:, y:)` is a syntax sugar of `foo(x: x, y: y)`. + + Constant names, local variable names, and method names are allowed as + key names. Note that a reserved word is considered as a local + variable or method name even if it's a pseudo variable name such as + `self`. + +* Non main-Ractors can get instance variables (ivars) of classes/modules + if ivars refer to shareable objects. + [[Feature #17592]] + +* A command syntax is allowed in endless method definitions, i.e., + you can now write `def foo = puts "Hello"`. + Note that `private def foo = puts "Hello"` does not parse. + [[Feature #17398]] + +## Command line options + +* `--disable-gems` is now explicitly declared as "just for debugging". + Never use it in any real-world codebase. + [[Feature #17684]] + +## Core classes updates + +Note: We're only listing outstanding class updates. + +* Array + + * Array#intersect? is added. [[Feature #15198]] + +* Class + + * Class#subclasses, which returns an array of classes + directly inheriting from the receiver, not + including singleton classes. + [[Feature #18273]] + + ```ruby + class A; end + class B < A; end + class C < B; end + class D < A; end + A.subclasses #=> [D, B] + B.subclasses #=> [C] + C.subclasses #=> [] + ``` + +* Enumerable + + * Enumerable#compact is added. [[Feature #17312]] + + * Enumerable#tally now accepts an optional hash to count. [[Feature #17744]] + + * Enumerable#each_cons and each_slice to return a receiver. [[GH-1509]] + + ```ruby + [1, 2, 3].each_cons(2){} + # 3.0 => nil + # 3.1 => [1, 2, 3] + + [1, 2, 3].each_slice(2){} + # 3.0 => nil + # 3.1 => [1, 2, 3] + ``` + +* Enumerator::Lazy + + * Enumerator::Lazy#compact is added. [[Feature #17312]] + +* File + + * File.dirname now accepts an optional argument for the level to + strip path components. [[Feature #12194]] + +* GC + + * "GC.measure_total_time = true" enables the measurement of GC. + Measurement can introduce overhead. It is enabled by default. + GC.measure_total_time returns the current setting. + GC.stat[:time] or GC.stat(:time) returns measured time + in milli-seconds. [[[Feature #10917]]] + + * GC.total_time returns measured time in nano-seconds. [[[Feature #10917]]] + +* Integer + + * Integer.try_convert is added. [[Feature #15211]] + +* Kernel + + * Kernel#load now accepts a module as the second argument, + and will load the file using the given module as the + top-level module. [[Feature #6210]] + +* Marshal + + * Marshal.load now accepts a `freeze: true` option. + All returned objects are frozen except for `Class` and + `Module` instances. Strings are deduplicated. [[Feature #18148]] + +* MatchData + + * MatchData#match is added [[Feature #18172]] + + * MatchData#match_length is added [[Feature #18172]] + +* Method / UnboundMethod + + * Method#public?, Method#private?, Method#protected?, + UnboundMethod#public?, UnboundMethod#private?, + UnboundMethod#protected? have been added. [[Feature #11689]] + +* Module + + * Module#prepend now modifies the ancestor chain if the receiver + already includes the argument. Module#prepend still does not + modify the ancestor chain if the receiver has already prepended + the argument. [[Bug #17423]] + + * Module#private, #public, #protected, and #module_function will + now return their arguments. If a single argument is given, it + is returned. If no arguments are given, nil is returned. If + multiple arguments are given, they are returned as an array. + [[Feature #12495]] + +* Process + + * Process.\_fork is added. This is a core method for fork(2). + Do not call this method directly; it is called by existing + fork methods: Kernel.#fork, Process.fork, and IO.popen("-"). + Application monitoring libraries can overwrite this method to + hook fork events. [[Feature #17795]] + +* Struct + + * Passing only keyword arguments to Struct#initialize is warned. + You need to use a Hash literal to set a Hash to a first member. + [[Feature #16806]] + + * StructClass#keyword_init? is added [[Feature #18008]] + +* String + + * Update Unicode version to 13.0.0 [[Feature #17750]] + and Emoji version to 13.0 [[Feature #18029]] + + * String#unpack and String#unpack1 now accept an `offset:` keyword + argument to start the unpacking after an arbitrary number of bytes + have been skipped. If `offset` is outside of the string bounds + `ArgumentError` is raised. [[Feature #18254]] + +* Thread + + * Thread#native_thread_id is added. [[Feature #17853]] + +* Thread::Backtrace + + * Thread::Backtrace.limit, which returns the value to limit backtrace + length set by `--backtrace-limit` command line option, is added. + [[Feature #17479]] + +* Thread::Queue + + * Thread::Queue.new now accepts an Enumerable of initial values. + [[Feature #17327]] + +* Time + + * Time.new now accepts optional `in:` keyword argument for the + timezone, as well as `Time.at` and `Time.now`, so that is now + you can omit minor arguments to `Time.new`. [[Feature #17485]] + + ```ruby + Time.new(2021, 12, 25, in: "+07:00") + #=> 2021-12-25 00:00:00 +0700 + ``` + + At the same time, time component strings are converted to + integers more strictly now. + + ```ruby + Time.new(2021, 12, 25, "+07:30") + #=> invalid value for Integer(): "+07:30" (ArgumentError) + ``` + + Ruby 3.0 or earlier returned probably unexpected result + `2021-12-25 07:00:00`, not `2021-12-25 07:30:00` nor + `2021-12-25 00:00:00 +07:30`. + + * Time#strftime supports RFC 3339 UTC for unknown offset local + time, `-0000`, as `%-z`. [[Feature #17544]] + +* TracePoint + + * TracePoint.allow_reentry is added to allow reenter while TracePoint + callback. + [[Feature #15912]] + +* $LOAD_PATH + + * $LOAD_PATH.resolve_feature_path does not raise. [[Feature #16043]] + +* Fiber Scheduler + + * Add support for `Addrinfo.getaddrinfo` using `address_resolve` hook. + [[Feature #17370]] + + * Introduce non-blocking `Timeout.timeout` using `timeout_after` hook. + [[Feature #17470]] + + * Introduce new scheduler hooks `io_read` and `io_write` along with a + low level `IO::Buffer` for zero-copy read/write. [[Feature #18020]] + + * IO hooks `io_wait`, `io_read`, `io_write`, receive the original IO object + where possible. [[Bug #18003]] + + * Make `Monitor` fiber-safe. [[Bug #17827]] + + * Replace copy coroutine with pthread implementation. [[Feature #18015]] + +* Refinement + + * New class which represents a module created by Module#refine. + `include` and `prepend` are deprecated, and `import_methods` is added + instead. [[Bug #17429]] + +## Stdlib updates + +* The following default gem are updated. + * RubyGems 3.3.3 + * base64 0.1.1 + * benchmark 0.2.0 + * bigdecimal 3.1.1 + * bundler 2.3.3 + * cgi 0.3.1 + * csv 3.2.2 + * date 3.2.2 + * did_you_mean 1.6.1 + * digest 3.1.0 + * drb 2.1.0 + * erb 2.2.3 + * error_highlight 0.3.0 + * etc 1.3.0 + * fcntl 1.0.1 + * fiddle 1.1.0 + * fileutils 1.6.0 + * find 0.1.1 + * io-console 0.5.10 + * io-wait 0.2.1 + * ipaddr 1.2.3 + * irb 1.4.1 + * json 2.6.1 + * logger 1.5.0 + * net-http 0.2.0 + * net-protocol 0.1.2 + * nkf 0.1.1 + * open-uri 0.2.0 + * openssl 3.0.0 + * optparse 0.2.0 + * ostruct 0.5.2 + * pathname 0.2.0 + * pp 0.3.0 + * prettyprint 0.1.1 + * psych 4.0.3 + * racc 1.6.0 + * rdoc 6.4.0 + * readline 0.0.3 + * readline-ext 0.1.4 + * reline 0.3.0 + * resolv 0.2.1 + * rinda 0.1.1 + * ruby2_keywords 0.0.5 + * securerandom 0.1.1 + * set 1.0.2 + * stringio 3.0.1 + * strscan 3.0.1 + * tempfile 0.1.2 + * time 0.2.0 + * timeout 0.2.0 + * tmpdir 0.1.2 + * un 0.2.0 + * uri 0.11.0 + * yaml 0.2.0 + * zlib 2.1.1 +* The following bundled gems are updated. + * minitest 5.15.0 + * power_assert 2.0.1 + * rake 13.0.6 + * test-unit 3.5.3 + * rexml 3.2.5 + * rbs 2.0.0 + * typeprof 0.21.1 +* The following default gems are now bundled gems. + * net-ftp 0.1.3 + * net-imap 0.2.2 + * net-pop 0.1.1 + * net-smtp 0.3.1 + * matrix 0.4.2 + * prime 0.1.2 + * debug 1.4.0 +* The following gems has been removed from the Ruby standard library. + * dbm + * gdbm + * tracer + +* Coverage measurement now supports suspension. You can use `Coverage.suspend` + to stop the measurement temporarily, and `Coverage.resume` to restart it. + See [[Feature #18176]] in detail. + +* Random::Formatter is moved to random/formatter.rb, so that you can + use `Random#hex`, `Random#base64`, and so on without SecureRandom. + [[Feature #18190]] + +## Compatibility issues + +Note: Excluding feature bug fixes. + +* `rb_io_wait_readable`, `rb_io_wait_writable` and `rb_wait_for_single_fd` are + deprecated in favour of `rb_io_maybe_wait_readable`, + `rb_io_maybe_wait_writable` and `rb_io_maybe_wait` respectively. + `rb_thread_wait_fd` and `rb_thread_fd_writable` are deprecated. [[Bug #18003]] + +## Stdlib compatibility issues + +* `ERB#initialize` warns `safe_level` and later arguments even without -w. + [[Feature #14256]] + +* `lib/debug.rb` is replaced with `debug.gem` + +* `Kernel#pp` in `lib/pp.rb` uses the width of `IO#winsize` by default. + This means that the output width is automatically changed depending on + your terminal size. [[Feature #12913]] + +* Psych 4.0 changes `Psych.load` as `safe_load` by the default. + You may need to use Psych 3.3.2 for migrating to this behavior. + [[Bug #17866]] + +## C API updates + +* Documented. [[GH-4815]] + +* `rb_gc_force_recycle` is deprecated and has been changed to a no-op. + [[Feature #18290]] + +## Implementation improvements + +* Inline cache mechanism is introduced for reading class variables. + [[Feature #17763]] + +* `instance_eval` and `instance_exec` now only allocate a singleton class when + required, avoiding extra objects and improving performance. [[GH-5146]] + +* The performance of `Struct` accessors is improved. [[GH-5131]] + +* `mandatory_only?` builtin special form to improve performance on + builtin methods. [[GH-5112]] + +* Experimental feature Variable Width Allocation in the garbage collector. + This feature is turned off by default and can be enabled by compiling Ruby + with flag `USE_RVARGC=1` set. [[Feature #18045]] [[Feature #18239]] + +## JIT + +* Rename Ruby 3.0's `--jit` to `--mjit`, and alias `--jit` to `--yjit` + on non-Windows x86-64 platforms and to `--mjit` on others. + +### MJIT + +* The default `--mjit-max-cache` is changed from 100 to 10000. + +* JIT-ed code is no longer cancelled when a TracePoint for class events + is enabled. + +* The JIT compiler no longer skips compilation of methods longer than + 1000 instructions. + +* `--mjit-verbose` and `--mjit-warning` output "JIT cancel" when JIT-ed + code is disabled because TracePoint or GC.compact is used. + +### YJIT: New experimental in-process JIT compiler + +New JIT compiler available as an experimental feature. [[Feature #18229]] + +See [this blog post](https://shopify.engineering/yjit-just-in-time-compiler-cruby +) introducing the project. + +* Disabled by default, use `--yjit` command-line option to enable YJIT. + +* Performance improvements on benchmarks based on real-world software, + up to 22% on railsbench, 39% on liquid-render. + +* Fast warm-up times. + +* Limited to Unix-like x86-64 platforms for now. + +## Static analysis + +### RBS + +* Generics type parameters can be bounded ([PR](https://github.com/ruby/rbs/pull/844)). + + ```rbs + # `T` must be compatible with the `_Output` interface. + # `PrettyPrint[String]` is ok, but `PrettyPrint[Integer]` is a type error. + class PrettyPrint[T < _Output] + interface _Output + def <<: (String) -> void + end + + attr_reader output: T + + def initialize: (T output) -> void + end + ``` + +* Type aliases can be generic. ([PR](https://github.com/ruby/rbs/pull/823)) + + ```rbs + # Defines a generic type `list`. + type list[T] = [ T, list[T] ] + | nil + + type str_list = list[String] + type int_list = list[Integer] + ``` + +* [rbs collection](https://github.com/ruby/rbs/blob/cdd6a3a896001e25bd1feda3eab7f470bae935c1/docs/collection.md) has been introduced to manage gems’ RBSs. + +* Many signatures for built-in and standard libraries have been added/updated. + +* It includes many bug fixes and performance improvements too. + +See the [CHANGELOG.md](https://github.com/ruby/rbs/blob/cdd6a3a896001e25bd1feda3eab7f470bae935c1/CHANGELOG.md) for more information. + +### TypeProf + +* [Experimental IDE support](https://github.com/ruby/typeprof/blob/ca15c5dae9bd62668463165f8409bd66ce7de223/doc/ide.md) has been implemented. +* Many bug fixes and performance improvements since Ruby 3.0.0. + +## Debugger + +* A new debugger [debug.gem](https://github.com/ruby/debug) is bundled. + debug.gem is a fast debugger implementation, and it provides many features + like remote debugging, colorful REPL, IDE (VSCode) integration, and more. + It replaces `lib/debug.rb` standard library. + +* `rdbg` command is also installed into `bin/` directory to start and control + debugging execution. + +## error_highlight + +A built-in gem called error_highlight has been introduced. +It shows fine-grained error locations in the backtrace. + +Example: `title = json[:article][:title]` + +If `json` is nil, it shows: + +``` +$ ruby test.rb +test.rb:2:in `<main>': undefined method `[]' for nil:NilClass (NoMethodError) + +title = json[:article][:title] + ^^^^^^^^^^ +``` + +If `json[:article]` returns nil, it shows: + +``` +$ ruby test.rb +test.rb:2:in `<main>': undefined method `[]' for nil:NilClass (NoMethodError) + +title = json[:article][:title] + ^^^^^^^^ +``` + +This feature is enabled by default. +You can disable it by using a command-line option `--disable-error_highlight`. +See [the repository](https://github.com/ruby/error_highlight) in detail. + +## IRB Autocomplete and Document Display + +The IRB now has an autocomplete feature, where you can just type in the code, and the completion candidates dialog will appear. You can use Tab and Shift+Tab to move up and down. + +If documents are installed when you select a completion candidate, the documentation dialog will appear next to the completion candidates dialog, showing part of the content. You can read the full document by pressing Alt+d. + +## Miscellaneous changes + +* lib/objspace/trace.rb is added, which is a tool for tracing the object + allocation. Just by requiring this file, tracing is started *immediately*. + Just by `Kernel#p`, you can investigate where an object was created. + Note that just requiring this file brings a large performance overhead. + This is only for debugging purposes. Do not use this in production. + [[Feature #17762]] + +* Now exceptions raised in finalizers will be printed to `STDERR`, unless + `$VERBOSE` is `nil`. [[Feature #17798]] + +* `ruby -run -e httpd` displays URLs to access. [[Feature #17847]] + +* Add `ruby -run -e colorize` to colorize Ruby code using + `IRB::Color.colorize_code`. + +[Bug #4443]: https://bugs.ruby-lang.org/issues/4443 +[Feature #6210]: https://bugs.ruby-lang.org/issues/6210 +[Feature #10917]: https://bugs.ruby-lang.org/issues/10917 +[Feature #11256]: https://bugs.ruby-lang.org/issues/11256 +[Feature #11689]: https://bugs.ruby-lang.org/issues/11689 +[Feature #12194]: https://bugs.ruby-lang.org/issues/12194 +[Feature #12495]: https://bugs.ruby-lang.org/issues/12495 +[Feature #12913]: https://bugs.ruby-lang.org/issues/12913 +[Feature #14256]: https://bugs.ruby-lang.org/issues/14256 +[Feature #14579]: https://bugs.ruby-lang.org/issues/14579 +[Feature #15198]: https://bugs.ruby-lang.org/issues/15198 +[Feature #15211]: https://bugs.ruby-lang.org/issues/15211 +[Feature #15912]: https://bugs.ruby-lang.org/issues/15912 +[Feature #16043]: https://bugs.ruby-lang.org/issues/16043 +[Feature #16182]: https://bugs.ruby-lang.org/issues/16182 +[Feature #16806]: https://bugs.ruby-lang.org/issues/16806 +[Feature #17312]: https://bugs.ruby-lang.org/issues/17312 +[Feature #17327]: https://bugs.ruby-lang.org/issues/17327 +[Feature #17370]: https://bugs.ruby-lang.org/issues/17370 +[Feature #17398]: https://bugs.ruby-lang.org/issues/17398 +[Feature #17411]: https://bugs.ruby-lang.org/issues/17411 +[Bug #17423]: https://bugs.ruby-lang.org/issues/17423 +[Bug #17429]: https://bugs.ruby-lang.org/issues/17429 +[Feature #17470]: https://bugs.ruby-lang.org/issues/17470 +[Feature #17479]: https://bugs.ruby-lang.org/issues/17479 +[Feature #17485]: https://bugs.ruby-lang.org/issues/17485 +[Feature #17544]: https://bugs.ruby-lang.org/issues/17544 +[Feature #17592]: https://bugs.ruby-lang.org/issues/17592 +[Feature #17684]: https://bugs.ruby-lang.org/issues/17684 +[Feature #17724]: https://bugs.ruby-lang.org/issues/17724 +[Feature #17744]: https://bugs.ruby-lang.org/issues/17744 +[Feature #17750]: https://bugs.ruby-lang.org/issues/17750 +[Feature #17762]: https://bugs.ruby-lang.org/issues/17762 +[Feature #17763]: https://bugs.ruby-lang.org/issues/17763 +[Feature #17795]: https://bugs.ruby-lang.org/issues/17795 +[Feature #17798]: https://bugs.ruby-lang.org/issues/17798 +[Bug #17827]: https://bugs.ruby-lang.org/issues/17827 +[Feature #17847]: https://bugs.ruby-lang.org/issues/17847 +[Feature #17853]: https://bugs.ruby-lang.org/issues/17853 +[Bug #17866]: https://bugs.ruby-lang.org/issues/17866 +[Bug #18003]: https://bugs.ruby-lang.org/issues/18003 +[Feature #18008]: https://bugs.ruby-lang.org/issues/18008 +[Feature #18015]: https://bugs.ruby-lang.org/issues/18015 +[Feature #18020]: https://bugs.ruby-lang.org/issues/18020 +[Feature #18029]: https://bugs.ruby-lang.org/issues/18029 +[Feature #18045]: https://bugs.ruby-lang.org/issues/18045 +[Feature #18148]: https://bugs.ruby-lang.org/issues/18148 +[Feature #18172]: https://bugs.ruby-lang.org/issues/18172 +[Feature #18176]: https://bugs.ruby-lang.org/issues/18176 +[Feature #18190]: https://bugs.ruby-lang.org/issues/18190 +[Feature #18229]: https://bugs.ruby-lang.org/issues/18229 +[Feature #18239]: https://bugs.ruby-lang.org/issues/18239 +[Feature #18254]: https://bugs.ruby-lang.org/issues/18254 +[Feature #18273]: https://bugs.ruby-lang.org/issues/18273 +[Feature #18290]: https://bugs.ruby-lang.org/issues/18290 + +[GH-1509]: https://github.com/ruby/ruby/pull/1509 +[GH-4815]: https://github.com/ruby/ruby/pull/4815 +[GH-5112]: https://github.com/ruby/ruby/pull/5112 +[GH-5131]: https://github.com/ruby/ruby/pull/5131 +[GH-5146]: https://github.com/ruby/ruby/pull/5146 |