2013-02-25 04:44:08 +04:00
|
|
|
# -*- rdoc -*-
|
|
|
|
|
2013-12-25 20:05:13 +04:00
|
|
|
= NEWS for Ruby 2.2.0
|
2008-12-12 12:46:28 +03:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2013-12-25 20:05:13 +04:00
|
|
|
== Changes since the 2.1.0 release
|
2010-09-15 20:14:05 +04:00
|
|
|
|
2013-02-23 18:23:39 +04:00
|
|
|
=== Language changes
|
2013-08-01 21:33:29 +04:00
|
|
|
|
2014-09-11 15:59:15 +04:00
|
|
|
* nil/true/false
|
|
|
|
* nil/true/false objects are frozen. [Feature #8923]
|
|
|
|
|
2014-09-20 06:49:24 +04:00
|
|
|
* Hash literal
|
|
|
|
* Symbol key followed by a colon can be quoted. [Feature #4276]
|
|
|
|
|
2014-10-03 19:09:48 +04:00
|
|
|
* default argument
|
|
|
|
fixed a very longstanding bug that an optional argument was not
|
|
|
|
accessible in its default value expression. [Bug #9593]
|
|
|
|
|
2013-02-23 18:23:39 +04:00
|
|
|
=== Core classes updates (outstanding ones only)
|
2013-03-10 22:23:00 +04:00
|
|
|
|
2014-07-01 18:51:13 +04:00
|
|
|
* Binding
|
|
|
|
* New methods:
|
|
|
|
* Binding#local_variables
|
2014-07-01 21:24:02 +04:00
|
|
|
* Binding#receiver
|
2014-07-01 18:51:13 +04:00
|
|
|
|
2014-09-04 19:54:04 +04:00
|
|
|
* Dir
|
|
|
|
* New methods:
|
|
|
|
* Dir#fileno
|
|
|
|
|
2014-02-14 19:45:11 +04:00
|
|
|
* Enumerable
|
2014-05-18 04:06:05 +04:00
|
|
|
* New methods:
|
|
|
|
* Enumerable#slice_after
|
2014-09-20 10:52:29 +04:00
|
|
|
* Enumerable#slice_when
|
2014-02-14 19:45:11 +04:00
|
|
|
* Extended methods:
|
2014-03-24 17:51:28 +04:00
|
|
|
* min, min_by, max and max_by supports optional argument to return
|
|
|
|
multiple elements.
|
|
|
|
|
2014-05-18 04:37:10 +04:00
|
|
|
* Float
|
|
|
|
* New methods:
|
|
|
|
* Float#next_float
|
|
|
|
* Float#prev_float
|
|
|
|
|
2014-05-22 15:49:22 +04:00
|
|
|
* File
|
|
|
|
* New methods:
|
|
|
|
* File.birthtime
|
|
|
|
* File#birthtime
|
|
|
|
|
|
|
|
* File::Stat
|
|
|
|
* New methods:
|
|
|
|
* File::Stat#birthtime
|
|
|
|
|
2014-09-11 15:56:29 +04:00
|
|
|
* GC
|
2014-12-12 07:09:28 +03:00
|
|
|
* GC.latest_gc_info returns :state to represent current GC status.
|
2014-09-11 15:56:29 +04:00
|
|
|
* Improvements
|
|
|
|
* Introduce incremental marking for major GC. [Feature #10137]
|
|
|
|
|
2014-11-14 08:03:38 +03:00
|
|
|
* IO
|
|
|
|
* Improvements
|
|
|
|
* IO#nonblock_read and IO#nonblock_write for pipes on Windows are supported.
|
|
|
|
|
2014-08-02 05:26:58 +04:00
|
|
|
* Kernel
|
|
|
|
* New methods:
|
|
|
|
* Kernel#itself
|
2014-11-15 10:28:08 +03:00
|
|
|
* Improvements
|
|
|
|
* Kernel#throw raises UncaughtThrowError, subclass of ArgumentError when
|
|
|
|
there is no corresponding catch block, instead of ArgumentError.
|
2014-08-02 05:26:58 +04:00
|
|
|
|
2014-05-05 17:37:09 +04:00
|
|
|
* Process
|
|
|
|
* Extended method:
|
|
|
|
* Process execution methods such as Process.spawn opens the file in write
|
|
|
|
mode for redirect from [:out, :err].
|
|
|
|
|
2014-10-23 05:21:25 +04:00
|
|
|
* String
|
|
|
|
* New methods:
|
|
|
|
* String#unicode_normalize
|
|
|
|
* String#unicode_normalize!
|
|
|
|
* String#unicode_normalized?
|
|
|
|
|
2014-02-25 20:34:00 +04:00
|
|
|
* Symbol
|
2014-03-26 18:19:10 +04:00
|
|
|
* Improvements
|
2014-03-27 09:42:57 +04:00
|
|
|
* Most symbols which are returned by String#to_sym and
|
|
|
|
String#intern are GC-able.
|
2014-02-14 19:45:11 +04:00
|
|
|
|
2014-06-19 08:42:16 +04:00
|
|
|
* Method
|
|
|
|
* New methods:
|
|
|
|
* Method#curry([arity]) returns a curried Proc.
|
2014-07-26 20:22:41 +04:00
|
|
|
* Method#super_method returns a Method of superclass, which would be called
|
|
|
|
when super is used.
|
2014-06-19 08:42:16 +04:00
|
|
|
|
2013-02-23 18:23:39 +04:00
|
|
|
=== Core classes compatibility issues (excluding feature bug fixes)
|
2013-03-07 21:54:49 +04:00
|
|
|
|
2014-09-20 19:01:44 +04:00
|
|
|
* Enumerable
|
|
|
|
* Enumerable#slice_before's state management deprecated.
|
|
|
|
* Enumerable#chunk's state management deprecated.
|
|
|
|
|
2014-09-11 15:56:29 +04:00
|
|
|
* GC
|
|
|
|
* incompatible changes:
|
|
|
|
* Rename GC.stat entries. [Feature #9924]
|
|
|
|
See https://docs.google.com/spreadsheets/d/11Ua4uBr6o0k-nORrZLEIIUkHJ9JRzRR0NyZfrhEEnc8/edit?usp=sharing
|
|
|
|
|
2014-03-02 22:01:55 +04:00
|
|
|
* IO
|
|
|
|
* incompatible changes:
|
2014-12-16 10:48:22 +03:00
|
|
|
* 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.
|
2014-12-17 14:12:23 +03:00
|
|
|
Use IO#fsync if you want to guarantee updating metadata.
|
2014-05-03 09:28:46 +04:00
|
|
|
|
|
|
|
* 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.
|
2014-05-04 05:23:01 +04:00
|
|
|
* Math.atan2 now returns values like as expected by C99 if both two
|
|
|
|
arguments are infinity.
|
2014-05-03 09:28:46 +04:00
|
|
|
|
2014-03-14 08:29:36 +04:00
|
|
|
* 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.
|
2014-03-02 22:01:55 +04:00
|
|
|
|
2014-05-05 17:37:09 +04:00
|
|
|
* 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.
|
|
|
|
|
2013-02-23 18:23:39 +04:00
|
|
|
=== Stdlib updates (outstanding ones only)
|
2013-03-11 21:27:03 +04:00
|
|
|
|
2014-11-27 15:26:39 +03:00
|
|
|
* Continuation
|
|
|
|
* callcc is obsolete. use Fiber instead.
|
|
|
|
|
2014-07-01 11:21:08 +04:00
|
|
|
* Digest
|
2014-10-31 16:21:51 +03:00
|
|
|
|
|
|
|
* 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::*.
|
2014-07-01 11:21:08 +04:00
|
|
|
* Digest::HMAC has been removed just as previously noticed.
|
|
|
|
|
2014-11-01 00:13:09 +03:00
|
|
|
* DL
|
|
|
|
* DL has been removed from stdlib. Please use Fiddle instead!
|
|
|
|
|
2014-05-18 04:58:34 +04:00
|
|
|
* Etc
|
|
|
|
* New methods:
|
|
|
|
* Etc.uname
|
2014-05-18 05:48:47 +04:00
|
|
|
* Etc.sysconf
|
|
|
|
* Etc.confstr
|
|
|
|
* IO#pathconf
|
2014-10-02 07:28:46 +04:00
|
|
|
* Etc.nprocessors
|
2014-05-18 04:58:34 +04:00
|
|
|
|
2014-03-08 15:01:48 +04:00
|
|
|
* Find, Pathname
|
|
|
|
* Extended methods:
|
|
|
|
* find method accepts "ignore_error" keyword argument.
|
|
|
|
|
2014-10-08 00:16:55 +04:00
|
|
|
* 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).
|
2014-10-29 05:43:28 +03:00
|
|
|
* Matrix#adjugate returns the adjugate of the matrix.
|
2014-10-08 00:16:55 +04:00
|
|
|
* 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.
|
2014-11-03 05:47:49 +03:00
|
|
|
* 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.
|
2014-11-19 20:32:58 +03:00
|
|
|
* Vector#angle_with returns the angle with its argument
|
2014-11-19 20:44:46 +03:00
|
|
|
* New instance and class method independent? to test linear independence.
|
2014-10-08 00:16:55 +04:00
|
|
|
|
2014-05-05 16:49:27 +04:00
|
|
|
* Pathname
|
|
|
|
* Pathname#/ is aliased to Pathname#+.
|
2014-06-28 17:47:14 +04:00
|
|
|
* New methods:
|
|
|
|
* Pathname#birthtime
|
2014-05-05 16:49:27 +04:00
|
|
|
|
2014-11-25 10:03:36 +03:00
|
|
|
* Rake
|
|
|
|
* Updated to Rake 10.4.0. For full release notes see:
|
|
|
|
|
|
|
|
http://docs.seattlerb.org/rake/History_rdoc.html#label-10.4.0
|
|
|
|
|
2014-10-01 12:32:41 +04:00
|
|
|
* 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
|
|
|
|
|
2014-11-27 06:46:13 +03:00
|
|
|
* TSort
|
|
|
|
* TSort.tsort_each, TSort.each_strongly_connected_component and
|
|
|
|
TSort.each_strongly_connected_component_from returns an enumerator if
|
|
|
|
no block given.
|
|
|
|
|
2014-10-13 12:53:16 +04:00
|
|
|
* XMLRPC
|
|
|
|
* Added new parser class named LibXMLStreamParser.
|
|
|
|
|
2013-02-23 18:23:39 +04:00
|
|
|
=== Stdlib compatibility issues (excluding feature bug fixes)
|
2013-04-25 09:27:41 +04:00
|
|
|
|
2014-08-26 04:31:00 +04:00
|
|
|
* lib/mathn.rb
|
|
|
|
* Show deprecated warning [Feature #10169]
|
|
|
|
|
2014-07-01 13:23:16 +04:00
|
|
|
* ext/date/lib/date/format.rb
|
|
|
|
* Removed because it's empty file.
|
|
|
|
|
2014-07-01 11:21:08 +04:00
|
|
|
* Digest
|
|
|
|
* Digest::HMAC has finally ceased to exist. Use OpenSSL::HMAC or an external gem instead.
|
|
|
|
|
2014-05-03 22:47:41 +04:00
|
|
|
* time.rb
|
2014-05-04 15:52:26 +04:00
|
|
|
* 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.
|
2014-05-03 22:47:41 +04:00
|
|
|
* Time.httpdate produces always UTC Time object.
|
2014-05-05 06:47:53 +04:00
|
|
|
* Time.strptime raises ArgumentError when no date information.
|
2014-05-24 09:04:14 +04:00
|
|
|
|
2014-08-22 07:21:55 +04:00
|
|
|
* lib/rational.rb
|
|
|
|
* Removed because it is deprecated from 2009.
|
|
|
|
|
|
|
|
* lib/complex.rb
|
|
|
|
* Removed because it is deprecated from 2009.
|
|
|
|
|
2014-08-22 06:38:59 +04:00
|
|
|
* lib/prettyprint.rb
|
|
|
|
* Removed PrettyPrint#first?
|
|
|
|
|
2014-05-24 09:04:25 +04:00
|
|
|
* lib/minitest/*.rb
|
|
|
|
* Removed because it conflicts to minitest 5. [Feature #9711]
|
|
|
|
|
2014-05-17 12:05:35 +04:00
|
|
|
* lib/test/**/*.rb
|
|
|
|
* Removed because it conflicts to minitest 5, and it was just an wrapper
|
|
|
|
of minitest 4. [Feature #9711]
|
2014-05-03 22:47:41 +04:00
|
|
|
|
2014-06-22 04:22:19 +04:00
|
|
|
* lib/uri
|
|
|
|
* support RFC 3986. [Feature #2542]
|
|
|
|
|
2014-08-15 05:21:18 +04:00
|
|
|
* GServer
|
|
|
|
* GServer is extracted to gserver gem. It's unmaintain code.
|
|
|
|
|
2014-07-02 05:41:02 +04:00
|
|
|
* Logger
|
|
|
|
* Logger::Application is extracted to logger-application gem. It's unmaintain code.
|
|
|
|
|
2014-12-15 11:54:07 +03:00
|
|
|
* ObjectSpace (after requiring "objspace")
|
|
|
|
* ObjectSpace.memsize_of(obj) returns a size includes sizeof(RVALUE).
|
|
|
|
[Bug #8984]
|
|
|
|
|
2014-05-23 19:32:19 +04:00
|
|
|
* 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]
|
|
|
|
|
2014-06-26 06:52:46 +04:00
|
|
|
* Psych
|
|
|
|
* Removed Psych::EngineManager [Bug #8344]
|
|
|
|
|
2013-06-14 04:53:37 +04:00
|
|
|
=== Built-in global variables compatibility issues
|
|
|
|
|
2013-02-23 18:23:39 +04:00
|
|
|
=== C API updates
|
2013-11-23 08:46:34 +04:00
|
|
|
|
2014-02-15 06:43:32 +04:00
|
|
|
* 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.
|
2014-10-10 06:27:41 +04:00
|
|
|
rb_io_mode_flags -> rb_io_modestr_fmode
|
|
|
|
rb_io_modenum_flags -> rb_io_oflags_fmode
|
2014-02-15 06:43:32 +04:00
|
|
|
|
|
|
|
* struct RBignum is hidden. [Feature #6083]
|
2014-02-15 06:47:19 +04:00
|
|
|
Use rb_integer_pack and rb_integer_unpack instead.
|
2014-03-23 03:34:21 +04:00
|
|
|
|
2014-05-17 20:37:41 +04:00
|
|
|
* struct RRational is hidden. [Feature #9513]
|
|
|
|
Use rb_rational_num and rb_rational_den instead.
|
|
|
|
|
2014-04-22 13:52:06 +04:00
|
|
|
* 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.
|
|
|
|
|
2014-03-23 03:34:21 +04:00
|
|
|
* 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.
|
2014-03-26 18:19:10 +04:00
|
|
|
|
|
|
|
* rb_sym2str() added. This is almost same as `rb_id2str(SYM2ID(sym))`
|
|
|
|
but not pinning a dynamic symbol.
|
|
|
|
|
2014-04-17 09:22:57 +04:00
|
|
|
* rb_str_cat_cstr() added. This is same as `rb_str_cat2()`.
|
2014-04-18 16:48:26 +04:00
|
|
|
|
2014-11-05 09:05:14 +03:00
|
|
|
* `rb_str_substr()` and `rb_str_subseq()` will share middle of a string,
|
2014-11-06 06:55:53 +03:00
|
|
|
but not only the end of a string, in the future. Therefore, result
|
2014-11-05 09:05:14 +03:00
|
|
|
strings may not be NUL-terminated, `StringValueCStr()` is needed
|
|
|
|
calling to obtain a NUL-terminated C string.
|
2014-09-11 15:56:29 +04:00
|
|
|
|
|
|
|
* rb_tracepoint_new() supports new internal events accessible only from C:
|
|
|
|
* RUBY_INTERNAL_EVENT_GC_ENTER
|
|
|
|
* RUBY_INTERNAL_EVENT_GC_EXIT
|
2014-09-11 16:01:38 +04:00
|
|
|
r47528
|
2014-09-19 00:37:52 +04:00
|
|
|
|
2014-10-23 16:42:57 +04:00
|
|
|
* rb_hash_delete() now does not call the block given to the current method.
|
|
|
|
|
2014-11-26 16:28:15 +03:00
|
|
|
* rb_extract_keywords() and rb_get_kwargs() exported. See README.EXT
|
|
|
|
for details.
|
|
|
|
|
2014-09-19 00:37:52 +04:00
|
|
|
=== 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]
|
2014-11-25 11:07:44 +03:00
|
|
|
|
|
|
|
=== 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]
|
2014-11-27 07:20:14 +03:00
|
|
|
* Enable lazy sweep on GC caused by malloc().
|
2014-11-25 11:07:44 +03:00
|
|
|
|
|
|
|
* 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]
|
2014-11-25 16:39:19 +03:00
|
|
|
|
|
|
|
* Process
|
|
|
|
* Process creation methods, such as spawn(), uses vfork() system call.
|
|
|
|
vfork() is faster than fork() when the parent process uses huge memory.
|