summaryrefslogtreecommitdiff
path: root/NEWS
blob: 53424b086c2d606b29d9ace19f4157f75f462755 (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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
= NEWS

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

=== Lexical changes

* empty symbol literal

  Empty symbol (:"") is allowed.

* new hash immediates

  Ruby 1.9 style hash syntax e.g. { key: value } is now supported.
  Just like the normal hash syntax, you can put key-value pairs
  without enclosing parentheses at the end of a method argument list.
  e.g. some_method foo: 1, bar: 2

* new method invocation syntax

  Ruby 1.9 style special method invocation syntax f.(x), which is
  equivalent to f.call(x), is supported.  This is mainly for use
  in invoking a Proc.

* trailing comma in argument list

  A trailing comma can be put at the end of an argument list.
  e.g.
    MyStruct = Struct.new(
      :id,
      :name,
      :created_at,
      :description,
    )

=== Configuration changes

* version specific directories

  A new configure option --with-ruby-version is added, which allows
  user to specify the version string (defaulted to "1.8") for version
  specific directories such as library directories, ri directories and
  gem directories.

=== Library updates (outstanding ones only)

* global functions

  * loop

    Return an enumerator if no block is given.

* builtin classes

  * Array#try_convert
  * Hash#try_convert
  * IO#try_convert
  * Regexp#try_convert
  * String#try_convert

    New methods.

  * Array#sample

    New method which replaces #choice.

  * Array#sort_by!

    New method.

  * Enumerable#each_entry

    New method.

  * Enumerable#each_with_object
  * Enumerator#with_object

    New methods.

  * Enumerator.new { |y| ... }

    Now can generate an enumerator from a block that defines
    enumeration instead of an enumerable object.

  * Enumerator#rewind

    Now calls the "rewind" method of the enclosed object if defined.

  * Enumerator#inspect

    Implemented.

  * Hash#default_proc=

    New method.

  * Hash#key

    Renamed from Hash#index.

  * Kernel#singleton_class

    New method.

  * ENV.key

    Renamed from ENV.index.

  * IO#ungetbyte

    Added as an alias to #ungetc.

  * Proc#===

    New method primarily for use in the case-when construct.

  * Process.daemon

    New method.

  * Range#cover?

    New alias to #include? for the forward compatibility with 1.9, in
    which the behavior of Range#include? has changed.

  * Regexp

    The regular expression /\s/ now properly matches a vertical tab
    character (VT: "\v") and /\S/ does not.  It was a bug that /\s/
    did not match VT when /[\s]/ does.  It is clear that VT should
    always be regarded as white space, not to mention String#strip.

  * String#getbyte
  * String#setbyte
  * String#ord

    New methods for the forward compatibility with 1.9, in which the
    behavior of String#[] and String#[]= have changed.  String#ord is
    $KCODE aware.

  * Symbol#succ
  * Symbol#next
  * Symbol#<=>
  * Symbol#casecmp
  * Symbol#=~
  * Symbol#[]
  * Symbol#slice
  * Symbol#length
  * Symbol#size
  * Symbol#empty?
  * Symbol#match
  * Symbol#upcase
  * Symbol#downcase
  * Symbol#capitalize
  * Symbol#swapcase

    New methods.

* base64

  * Base64#strict_encode64
  * Base64#strict_decode64
  * Base64#urlsafe_encode64
  * Base64#urlsafe_decode64

    New methods.

* dbm
* gdbm
* sdbm

  * {DBM,GDBM,SDBM}#key

    Renamed from #index.

* digest

  * Digest::Class.base64digest
  * Digest::Instance#base64digest
  * Digest::Instance#base64digest!

    New methods.

* fileutils

  * New option for FileUtils.rmdir(): :parents

* 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#each
    * Matrix#each_with_index
    * Matrix#empty?

* open-uri

  * Added a lot of new options:

    * :ftp_active_mode => bool

      Specify false to enable FTP passive mode.  It is adviced that
      this option should be explicitly set for forward compatibility
      because the default mode is changed in Ruby >= 1.9.

    * :read_timeout => seconds
    * :proxy_http_basic_authentication => [uri, user, password]
    * :redirect => bool
    * :ssl_verify_mode => OpenSSL::SSL::VERIFY_*
    * :ssl_ca_cert => filename

* rational

  * Performace improved by making overall code optimization and
    introducing Fixnum#gcd implemented in C.

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

    http://www.ruby-lang.org/en/news/2008/08/23/dos-vulnerability-in-rexml/

* rss

  * 0.2.4 -> 0.2.7.

  * RSS::Maker.make
    * raise an exception instead of returning nil for invalid feed making.
    * requires block.

  * RSS::Maker.[]
    * new method to return maker class.

  * RSS::Maker.supported?(version)
    * new method to check if 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=

* securerandom

  SecureRandom.uuid

    New method to generate a v4 random UUID.

* set

  Set#classify
  Set#collect!
  Set#delete_if
  Set#divide
  Set#reject!
  SortedSet#delete_if

    Return an enumerator if no block is given.

* stringio

  * StringIO#ungetbyte

    Added as an alias to #ungetc.

=== Compatibility issues (excluding feature bug fixes)

* builtin classes

  * Enumerator#rewind

    See above.

* open-uri

 * URI::InvalidURIError is converted to OpenURI::HTTPError if an
   invalid HTTP URI is given.