1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/NEWS

194 lines
5.5 KiB
Text
Raw Normal View History

# -*- 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
* Added 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.
=== Core classes updates (outstanding ones only)
* GC
* added environment variable:
* RUBY_HEAP_SLOTS_GROWTH_FACTOR: growth rate of the heap.
* 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.
* 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.
* extended methods:
* Module#refine is no longer experimental.
* Mutex
* misc
* Mutex#owned? is no longer experimental.
* Process
* New alternative methods to $0/$0=:
* Process.argv0() returns the original value of $0.
* Process.setproctitle() sets the process title without affecting $0.
* String
* New methods:
* String#scrub and String#scrub! verify and fix invalid byte sequence.
* extended methods:
* If invalid: :replace is specified for String#encode, replace
invalid byte sequence even if the destination encoding equals to
the source encoding.
* 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)
* IO
* incompatible changes:
* open ignore internal encoding if external encoding is ASCII-8BIT.
* Kernel#untrusted?, untrust, and trust
* These methods are deprecated and their behavior is 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.
* Numeric#quo
* Raises TypeError instead of ArgumentError if the receiver doesn't have
to_r method.
=== Stdlib updates (outstanding ones only)
* 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
* Pathname
* New methods:
* Pathname#write
* Pathname#binwrite
* OpenSSL::BN
* extended methods:
* OpenSSL::BN.new allows Fixnum/Bignum argument.
* open-uri
* Support multiple fields with same field name (like Set-Cookie).
* Resolv
* New methods:
* Resolv::DNS.fetch_resource
* One-shot multicast DNS support
* Support LOC resources
* Rinda::RingServer, Rinda::RingFinger
* Rinda now supports multicast sockets. See Rinda::RingServer and
Rinda::RingFinger for details.
* RubyGems
* Updated to 2.0.3. See
http://rubygems.rubyforge.org/rubygems-update/History_txt.html#label-2.0.3+%2F+2012-03-1
for release notes.
* Socket
* New methods:
* Socket.getifaddrs
* StringScanner
* extended methods:
* StringScanner#[] supports named captures.
* Syslog::Logger
* Added facility.
* Tempfile
* New methods:
* Tempfile.create
* CGI::Util
* All class methods modulized.
* 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.
* REXML::Parsers::StreamParser
* Supports "entity" event.
* REXML::Text
* REXML::Text#<< supports method chain like 'text << "XXX" << "YYY"'.
* REXML::Text#<< supports not "raw" mode.
* Set
* New methods:
* Set#intersect?
* Set#disjoint?
=== 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.
=== 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