2013-02-25 00:44:08 +00:00
|
|
|
# -*- rdoc -*-
|
|
|
|
|
2014-12-25 13:53:36 +00:00
|
|
|
= NEWS for Ruby 2.3.0
|
2008-12-12 09:46:28 +00: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.
|
|
|
|
|
2014-12-25 13:53:36 +00:00
|
|
|
== Changes since the 2.2.0 release
|
2010-09-15 16:14:05 +00:00
|
|
|
|
2013-02-23 14:23:39 +00:00
|
|
|
=== Language changes
|
2013-08-01 17:33:29 +00:00
|
|
|
|
2015-09-27 06:44:02 +00:00
|
|
|
* frozen-string-literal pragma:
|
|
|
|
* new pragma, frozen-string-literal has been experimentally introduced.
|
2015-09-27 06:47:00 +00:00
|
|
|
* besides, --enable/--disable=frozen-string-literal options also have
|
|
|
|
been introduced.
|
2015-09-27 06:44:02 +00:00
|
|
|
|
2015-10-22 06:30:12 +00:00
|
|
|
* safe navigation operator:
|
|
|
|
|
2015-11-06 03:39:23 +00:00
|
|
|
* new method call syntax, `object&.foo', method #foo is called on
|
2015-10-22 06:30:12 +00:00
|
|
|
`object' if it is not nil.
|
2015-10-23 16:53:41 +00:00
|
|
|
this is similar to `try!' in Active Support, except:
|
2015-10-22 06:30:12 +00:00
|
|
|
* method name is syntactically required
|
|
|
|
obj.try! {} # valid
|
2015-11-06 03:39:23 +00:00
|
|
|
obj&. {} # syntax error
|
2015-10-23 16:53:41 +00:00
|
|
|
* arguments are evaluated only if a call is made:
|
|
|
|
obj.try!(:foo, bar()) # bar() is always evaluated
|
2015-11-06 03:39:23 +00:00
|
|
|
obj&.foo(bar()) # bar() is conditionally evaluated
|
2015-10-22 06:30:12 +00:00
|
|
|
* attribute assignment is valid
|
2015-11-06 03:39:23 +00:00
|
|
|
obj&.attr += 1
|
2015-10-22 06:30:12 +00:00
|
|
|
|
2013-02-23 14:23:39 +00:00
|
|
|
=== Core classes updates (outstanding ones only)
|
2013-03-10 18:23:00 +00:00
|
|
|
|
2015-07-30 03:32:46 +00:00
|
|
|
* ARGF
|
|
|
|
|
|
|
|
* ARGF.read_nonblock supports `exception: false' like IO#read_nonblock.
|
|
|
|
[Feature #11358]
|
|
|
|
|
2015-06-21 14:53:28 +00:00
|
|
|
* Array
|
|
|
|
|
|
|
|
* Array#bsearch_index [Feature #10730]
|
2015-11-09 12:27:26 +00:00
|
|
|
* Array#dig [Feature #11643]
|
2015-06-21 14:53:28 +00:00
|
|
|
|
2015-05-14 10:42:42 +00:00
|
|
|
* Enumerable
|
|
|
|
|
2015-05-16 10:45:03 +00:00
|
|
|
* Enumerable#grep_v is added as inverse version of Enumerable#grep.
|
2015-06-14 08:53:27 +00:00
|
|
|
[Feature #11049]
|
2015-06-14 08:54:19 +00:00
|
|
|
* Enumerable#chunk_while [Feature #10769]
|
2015-05-14 10:42:42 +00:00
|
|
|
|
2015-09-18 11:11:14 +00:00
|
|
|
* File
|
|
|
|
|
|
|
|
* File.mkfifo [Feature #11536]
|
2015-11-08 07:27:25 +00:00
|
|
|
* Add File::TMPFILE corresponding to O_TMPFILE
|
2015-09-18 11:11:14 +00:00
|
|
|
|
2015-06-21 14:53:28 +00:00
|
|
|
* Hash
|
|
|
|
|
|
|
|
* Hash#fetch_values [Feature #10017]
|
2015-11-09 12:27:26 +00:00
|
|
|
* Hash#dig [Feature #11643]
|
2015-11-10 05:02:02 +00:00
|
|
|
* Hash#<=, Hash#<, Hash#>=, Hash#> [Feature #10984]
|
2015-11-10 07:57:17 +00:00
|
|
|
* Hash#to_proc [Feature #11653]
|
2015-06-21 14:53:28 +00:00
|
|
|
|
2015-06-12 12:14:06 +00:00
|
|
|
* 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]
|
|
|
|
|
2015-07-29 01:39:14 +00:00
|
|
|
* new option parameter `flags' is added.
|
|
|
|
this parameter is bitwise-ORed to oflags generated by normal mode argument.
|
|
|
|
[Feature #11253]
|
|
|
|
|
2015-10-22 09:58:01 +00:00
|
|
|
* Kernel
|
|
|
|
|
|
|
|
* Kernel#loop, when stopped by a StopIteration exception, returns
|
2015-10-27 13:01:19 +00:00
|
|
|
what the enumerator has returned instead of nil. [Feature #11498]
|
2015-10-22 09:58:01 +00:00
|
|
|
|
2015-07-30 04:20:00 +00:00
|
|
|
* Module
|
|
|
|
* Module#deprecate_constant [Feature #11398]
|
|
|
|
|
2015-06-18 04:50:33 +00:00
|
|
|
* NameError
|
2015-06-21 14:48:35 +00:00
|
|
|
* NameError#receiver is added to take the receiver object. [Feature #10881]
|
2015-06-18 04:50:33 +00:00
|
|
|
|
2015-07-30 03:32:46 +00:00
|
|
|
* Numeric
|
|
|
|
|
|
|
|
* Numeric#positive? and Numeric#negative? are added, which return
|
|
|
|
true when the receiver is positive and negative respectively.
|
|
|
|
[Feature #11151]
|
|
|
|
|
2015-10-05 21:34:24 +00:00
|
|
|
* Proc
|
|
|
|
|
|
|
|
* Proc#call (and also #[], #===, #yield) are optimized.
|
2015-11-17 02:22:29 +00:00
|
|
|
Backtrace doesn't show each method (show block lines directly).
|
|
|
|
TracePoint also ignores these calls. [Feature #11569]
|
2015-10-05 21:34:24 +00:00
|
|
|
|
2015-11-21 00:46:53 +00:00
|
|
|
* Queue (Thread::Queue)
|
|
|
|
|
|
|
|
* Queue#close is added to notice a termination. [Feature #10600]
|
|
|
|
|
2015-11-17 06:34:52 +00:00
|
|
|
* Regexp/String: Updated Unicode version from 7.0.0 to 8.0.0
|
|
|
|
|
2015-11-16 09:21:56 +00:00
|
|
|
* Struct
|
|
|
|
* Struct#dig [Feature #11686]
|
|
|
|
|
2015-07-30 03:32:46 +00:00
|
|
|
* Thread
|
|
|
|
* Thread#name, Thread#name= are added to handle thread names [Feature #11251]
|
|
|
|
|
2013-02-23 14:23:39 +00:00
|
|
|
=== Core classes compatibility issues (excluding feature bug fixes)
|
2013-03-07 17:54:49 +00:00
|
|
|
|
2015-01-15 01:44:57 +00:00
|
|
|
* Array
|
|
|
|
* Array#select!, Array#keep_if, Array#reject!, and Array#delete_if
|
|
|
|
no longer changes the receiver array instantly every time the
|
2015-01-21 00:22:42 +00:00
|
|
|
block is called. [Feature #10714]
|
2015-01-15 01:44:57 +00:00
|
|
|
|
2015-01-25 03:04:10 +00:00
|
|
|
* Array#flatten and Array#flatten! no longer try to call #to_ary
|
|
|
|
method on elements beyond the given level. [Bug #10748]
|
|
|
|
|
2015-04-06 13:53:24 +00:00
|
|
|
* 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.
|
|
|
|
|
2015-06-13 11:50:21 +00:00
|
|
|
* File::Stat
|
2015-06-13 12:02:17 +00:00
|
|
|
* On Windows File::Stat#ino always returned 0, but now returns
|
2015-06-13 11:50:21 +00:00
|
|
|
BY_HANDLE_FILE_INFORMATION.nFileIndexHigh/Low.
|
|
|
|
|
2015-01-15 22:16:30 +00:00
|
|
|
* IO
|
2015-01-21 00:10:45 +00:00
|
|
|
* IO#close doesn't raise when the IO object is closed. [Feature #10718]
|
2015-08-17 02:57:39 +00:00
|
|
|
* IO#each_codepoint raises an exception at incomplete character
|
|
|
|
before EOF when conversion takes place. [Bug #11444]
|
2015-01-15 22:16:30 +00:00
|
|
|
|
2015-06-19 05:53:41 +00:00
|
|
|
* 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]
|
|
|
|
|
2015-06-12 12:22:36 +00:00
|
|
|
* pack/unpack (Array/String)
|
|
|
|
* j and J directives for pointer width integer type. [Feature #11215]
|
|
|
|
|
|
|
|
|
2013-02-23 14:23:39 +00:00
|
|
|
=== Stdlib updates (outstanding ones only)
|
2013-03-11 17:27:03 +00:00
|
|
|
|
2015-11-17 15:25:07 +00:00
|
|
|
* 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]
|
|
|
|
|
2015-03-12 03:03:04 +00:00
|
|
|
* Socket
|
2015-06-15 21:28:00 +00:00
|
|
|
* Socket#connect_nonblock, Socket#accept_nonblock,
|
|
|
|
TCPServer#accept_nonblock, UNIXServer#accept_nonblock,
|
|
|
|
BasicSocket#recv_nonblock, BasicSocket#recvmsg_nonblock,
|
2015-10-22 20:36:08 +00:00
|
|
|
BasicSocket#sendmsg_nonblock all support `exception: false` to return
|
2015-06-15 21:28:00 +00:00
|
|
|
:wait_readable or :wait_writable symbols instead of raising
|
|
|
|
IO::WaitReadable or IO::WaitWritable exceptions
|
|
|
|
* BasicSocket#recv and BasicSocket#recv_nonblock allow an output
|
|
|
|
String buffer argument like IO#read and IO#read_nonblock to reduce
|
|
|
|
GC overhead
|
2015-03-12 03:03:04 +00:00
|
|
|
|
2015-04-10 10:38:13 +00:00
|
|
|
* ObjectSpace (objspace)
|
2015-08-21 11:30:24 +00:00
|
|
|
* ObjectSpace.count_symbols is added.
|
2015-04-10 10:38:13 +00:00
|
|
|
* ObjectSpace.count_imemo_objects is added.
|
2015-05-28 19:40:04 +00:00
|
|
|
* ObjectSpace.internal_class_of is added.
|
|
|
|
* ObjectSpace.internal_super_of is added.
|
2015-04-10 10:38:13 +00:00
|
|
|
|
2015-03-12 03:03:04 +00:00
|
|
|
* OpenSSL
|
connect_nonblock supports "exception: false"
This is for consistency with accept_nonblock arguments and gives a
minor speedup from avoiding exceptions.
[ruby-core:68838] [Feature #11024]
* ext/openssl/ossl_ssl.c (ossl_ssl_connect_nonblock):
support `exception: false'
* (get_no_exception): move function location
* ext/socket/socket.c (sock_connect_nonblock):
support `exception: false'
* test/openssl/test_pair.rb (test_connect_accept_nonblock_no_exception):
test `exception: false' on connect,
rename from `test_accept_nonblock_no_exception'
* test/socket/test_nonblock.rb (test_connect_nonblock_no_exception):
new test
Benchmark results:
default 0.050000 0.100000 0.150000 ( 0.151307)
exception: false 0.030000 0.080000 0.110000 ( 0.108840)
----------------------------8<-----------------------
require 'socket'
require 'benchmark'
require 'io/wait'
require 'tmpdir'
host = '127.0.0.1'
serv = TCPServer.new(host, 0) # UNIX sockets may not hit EINPROGRESS
nr = 5000 # few iterations to avoid running out of ports
addr = serv.getsockname
pid = fork do
begin
serv.accept.close
rescue => e
warn "#$$: #{e.message} (#{e.class})"
end while true
end
at_exit { Process.kill(:TERM, pid) }
serv.close
Benchmark.bmbm do |x|
x.report("default") do
nr.times do
s = Socket.new(:INET, :STREAM)
s.setsockopt(:SOL_SOCKET, :SO_REUSEADDR, 1)
begin
s.connect_nonblock(addr)
rescue IO::WaitWritable
s.wait_writable
end
s.close
end
end
x.report("exception: false") do
nr.times do
s = Socket.new(:INET, :STREAM)
s.setsockopt(:SOL_SOCKET, :SO_REUSEADDR, 1)
case s.connect_nonblock(addr, exception: false)
when :wait_writable
s.wait_writable
end
s.close
end
end
end
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-12 01:41:51 +00:00
|
|
|
* OpenSSL::SSL::SSLSocket#accept_nonblock and
|
|
|
|
OpenSSL::SSL::SSLSocket#connect_nonblock supports `exception: false`.
|
2015-03-12 03:03:04 +00:00
|
|
|
|
2015-06-14 15:14:46 +00:00
|
|
|
* Pathname
|
|
|
|
* Pathname#descend and Pathname#ascend supported blockless form.
|
|
|
|
[Feature #11052]
|
|
|
|
|
2015-04-15 20:17:19 +00:00
|
|
|
* io/wait
|
|
|
|
* IO#wait_readable no longer checks FIONREAD, it may be used for
|
|
|
|
non-bytestream IO such as listen sockets.
|
|
|
|
|
2015-07-13 10:11:38 +00:00
|
|
|
* timeout
|
|
|
|
* Object#timeout is now warned as deprecated when called.
|
|
|
|
|
2015-09-18 07:56:57 +00:00
|
|
|
* Net::FTP
|
|
|
|
* Net::FTP#mlst is added.
|
|
|
|
* Net::FTP#mlsd is added.
|
|
|
|
|
2013-02-23 14:23:39 +00:00
|
|
|
=== Stdlib compatibility issues (excluding feature bug fixes)
|
2013-04-25 05:27:41 +00:00
|
|
|
|
2015-01-03 00:01:49 +00:00
|
|
|
* lib/webrick/utils.rb
|
|
|
|
* removed unused argument. https://github.com/ruby/ruby/pull/356
|
|
|
|
|
2015-01-04 00:21:08 +00:00
|
|
|
* lib/drb/drb.rb
|
|
|
|
* removed unused argument. https://github.com/ruby/ruby/pull/515
|
|
|
|
|
2015-02-13 12:31:30 +00:00
|
|
|
* lib/base64.rb
|
|
|
|
* Base64.urlsafe_encode64: added a "padding" option to suppress
|
|
|
|
the padding character ("=").
|
|
|
|
* Base64.urlsafe_decode64: now it accepts not only correctly-padded
|
|
|
|
input but also unpadded input.
|
|
|
|
|
2015-03-05 23:45:42 +00:00
|
|
|
* lib/matrix.rb
|
|
|
|
* Add Vector#round. https://github.com/ruby/ruby/pull/802
|
|
|
|
|
2015-02-13 15:53:47 +00:00
|
|
|
* ext/coverage/coverage.c
|
|
|
|
* Coverage.peek_result: new method to allow coverage to be captured without
|
|
|
|
stopping the coverage tool.
|
|
|
|
|
2015-11-07 16:48:49 +00:00
|
|
|
* Net::HTTP
|
|
|
|
* default value of Net::HTTP#open_timeout is now 60 (was nil).
|
|
|
|
|
2015-05-22 07:48:39 +00:00
|
|
|
* Net::Telnet
|
|
|
|
* Net::Telnet is extracted to net-telnet gem. It's unmaintain code.
|
|
|
|
|
2015-11-11 03:48:45 +00:00
|
|
|
* Net::FTP
|
|
|
|
* Connections are in passive mode per default now. The default mode can
|
2015-11-11 13:28:33 +00:00
|
|
|
be changed by Net::FTP.default_passive=. [Feature #11612]
|
2015-11-11 03:48:45 +00:00
|
|
|
|
2015-05-22 07:48:39 +00:00
|
|
|
* Rake
|
|
|
|
* Rake is removed from stdlib.
|
|
|
|
|
2013-06-14 00:53:37 +00:00
|
|
|
=== Built-in global variables compatibility issues
|
|
|
|
|
2015-06-19 16:24:33 +00:00
|
|
|
* $SAFE
|
|
|
|
* $SAFE=2 and $SAFE=3 are obsolete. If $SAFE is set to 2 or larger,
|
2015-06-21 14:48:48 +00:00
|
|
|
an ArgumentError is raised. [Feature #5455]
|
2015-06-19 16:24:33 +00:00
|
|
|
|
2013-02-23 14:23:39 +00:00
|
|
|
=== C API updates
|
2013-11-23 04:46:34 +00:00
|
|
|
|
2015-06-28 03:07:37 +00:00
|
|
|
* 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.
|
|
|
|
|
2015-11-10 02:59:47 +00:00
|
|
|
* rb_timespec_now() is added to fetch current datetime as struct timespec.
|
2015-11-11 13:28:33 +00:00
|
|
|
[Feature #11558]
|
2015-11-10 02:59:47 +00:00
|
|
|
|
|
|
|
* rb_time_timespec_new() is added to create a time object with epoch,
|
2015-11-11 13:28:33 +00:00
|
|
|
nanosecond, and UTC/localtime/time offset arguments. [Feature #11558]
|
2015-11-10 02:59:47 +00:00
|
|
|
|
2014-09-18 20:37:52 +00:00
|
|
|
=== Build system updates
|
|
|
|
|
2014-11-25 08:07:44 +00:00
|
|
|
=== Implementation changes
|
2015-11-23 03:54:42 +00:00
|
|
|
|
2015-10-18 01:18:55 +00:00
|
|
|
* OS/2 is no longer supported
|
2015-11-23 03:54:42 +00:00
|
|
|
|
2015-10-18 02:11:23 +00:00
|
|
|
* Borland-C is no longer supported
|
2015-11-23 03:54:42 +00:00
|
|
|
|
|
|
|
* Haiku now stable and best effort
|