summaryrefslogtreecommitdiff
path: root/NEWS
blob: 88cbefc08b65800ba5ee53c1f89bfb76de6553b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# -*- 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.

== Changes since the 2.2.0 release

=== Language changes

* frozen-string-literal pragma:
  * new pragma, frozen-string-literal has been experimentally introduced.
  * besides, --enable/--disable=frozen-string-literal options also have
    been introduced.
  * command line option --debug or --debug=frozen-string-literal enable
    additional debugging mode which shows created location with at frozen
    object error (RuntimeError) even if string is dynamically created string
    literal (for static string literals shows locations as default).
    [Feature #11725]

* safe navigation operator:

  * new method call syntax, `object&.foo', method #foo is called on
    `object' if it is not nil.
    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

=== 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]

* Enumerable

  * Enumerable#grep_v is added as inverse version of Enumerable#grep.
    [Feature #11049]
  * Enumerable#chunk_while [Feature #10769]

* 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]

* 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

* 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]

* 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.

* 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]

* 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
  * BasicSocket#recv and BasicSocket#recv_nonblock allow an output
    String buffer argument like IO#read and IO#read_nonblock to reduce
    GC overhead

* 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`.

* Pathname
  * Pathname#descend and Pathname#ascend supported blockless form.
    [Feature #11052]

* io/wait
  * IO#wait_readable no longer checks FIONREAD, it may be used for
    non-bytestream IO such as listen sockets.

* timeout
  * Object#timeout is now warned as deprecated when called.

* Net::FTP
  * Net::FTP#mlst is added.
  * Net::FTP#mlsd is added.

=== Stdlib compatibility issues (excluding feature bug fixes)

* lib/webrick/utils.rb
 * removed unused argument. https://github.com/ruby/ruby/pull/356

* lib/drb/drb.rb
 * removed unused argument. https://github.com/ruby/ruby/pull/515

* 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.

* lib/matrix.rb
 * Add Vector#round. https://github.com/ruby/ruby/pull/802

* ext/coverage/coverage.c
  * Coverage.peek_result: new method to allow coverage to be captured without
    stopping the coverage tool.

* 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.

* Net::FTP
  * Connections are in passive mode per default now.  The default mode can
    be changed by Net::FTP.default_passive=.  [Feature #11612]

* Rake
  * Rake is removed from stdlib.

=== 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]

=== Build system updates

=== Implementation changes

* OS/2 is no longer supported

* BeOS is no longer supported

* Borland-C is no longer supported

* Haiku now stable and best effort