5 This document is a list of user visible feature changes made between
6 releases except for bug fixes.
8 Note that each entry is kept so brief that no reason behind or
9 reference information is supplied with. For a full list of changes
10 with all sufficient information, see the ChangeLog file.
12 == Changes since the 1.9.3 release
16 * Added keyword arguments.
18 * Added %i and %I for symbol list creation (similar to %w and %W).
20 * Default source encoding is changed to UTF-8. (was US-ASCII)
22 * No warning for unused variables starting with '_'
24 === Core classes updates (outstanding ones only)
28 * added ARGF#codepoints and ARGF#each_codepoint, like the corresponding
33 * added Array#bsearch for binary search.
34 * incompatible changes:
35 * random parameter of Array#shuffle! and Array#sample now
36 will be called with one argument, maximum value.
37 * when given Range arguments, Array#values_at now returns nil for each
38 value that is out-of-range.
42 * added Enumerable#lazy method for lazy enumeration.
46 * added Enumerator#size for lazy size evaluation.
48 * Enumerator.new accept an argument for lazy size evaluation.
49 * new class Enumerator::Lazy for lazy enumeration
53 * ENV.to_h is a new alias for ENV.to_hash
56 * incompatible changes:
57 * Fiber#resume cannot resume a fiber which invokes "Fiber#transfer".
61 * File.fnmatch? now expands braces in the pattern if
62 File::FNM_EXTGLOB option is given.
66 * introduced the bitmap marking which suppresses to copy a memory page
68 * introduced the non-recursive marking which avoids unexpected stack overflow.
72 * added GC::Profiler.raw_data which returns raw profile data for GC.
76 * added Hash#to_h as explicit conversion method, like Array#to_a.
78 * Hash#default_proc= can be passed nil to clear the default proc.
82 * IO#lines, #bytes, #chars and #codepoints are deprecated.
86 * added Kernel#Hash conversion method like Array() or Float().
87 * added Kernel#__dir__ which returns the absolute path of the
88 directory of the file from which this method is called.
89 * added Kernel#caller_locations which returns an array of
90 frame information objects.
92 * Kernel#warn accepts multiple args in like puts.
93 * Kernel#caller accepts second optional argument `n' which specify
95 * Kernel#to_enum and enum_for accept a block for lazy size evaluation.
96 * incompatible changes:
97 * system() and exec() close non-standard file descriptors
98 (The default of :close_others option is changed to true by default.)
99 * respond_to? against a protected method now returns false unless
100 the second argument is true.
101 * __callee__ has returned to the original behavior, and now
102 returns the called name but not the original name in an
104 * Kernel#inspect does not call #to_s anymore
105 (it used to call redefined #to_s).
109 * added LoadError#path method to return the file name that could not be
114 * added Module#prepend which is similar to Module#include,
115 however a method in the prepended module overrides the
116 corresponding method in the prepending module.
117 * added Module.prepended and Module.prepend_features, similar
118 to included and append_features.
119 * added Module#refine, which extends a class or module locally. [experimental]
121 * Module#define_method accepts a UnboundMethod from a Module.
122 * Module#const_get accepts a qualified constant string, e.g.
123 Object.const_get("Foo::Bar::Baz")
127 * added Mutex#owned? which returns the mutex is held by current
128 thread or not. [experimental]
129 * incompatible changes:
130 * Mutex#lock, Mutex#unlock, Mutex#try_lock, Mutex#synchronize
131 and Mutex#sleep are no longer allowed to be used from trap handler
132 and raise a ThreadError in such case.
133 * Mutex#sleep may spurious wakeup. Check after wakeup.
137 * added nil.to_h which returns {}
139 * ObjectSpace::WeakMap
140 * new low level class to hold weak references to objects.
143 * incompatible change:
144 * removed Proc#== and #eql? so two procs are == only when they are
149 * added getsid for getting session id (unix only).
153 * added Range#size for lazy size evaluation.
154 * added Range#bsearch for binary search.
156 * RubyVM (MRI specific)
157 * added RubyVM::InstructionSequence.of to get the instruction sequence
158 from a method or a block.
159 * added RubyVM::InstructionSequence#path, #absolute_path, #label,
160 #base_label and #first_lineno to retrieve information from where
161 the instruction sequence was defined.
162 * added Environment variables to specify stack usage:
163 * RUBY_THREAD_VM_STACK_SIZE: vm stack size used at thread creation.
164 default: 128KB (32bit CPU) or 256KB (64bit CPU).
165 * RUBY_THREAD_MACHINE_STACK_SIZE: machine stack size used at thread
166 creation. default: 512KB or 1024KB.
167 * RUBY_FIBER_VM_STACK_SIZE: vm stack size used at fiber creation.
168 default: 64KB or 128KB.
169 * RUBY_FIBER_MACHINE_STACK_SIZE: machine stack size used at fiber
170 creation. default: 256KB or 512KB.
171 These variables are checked only at launched time.
172 * added constant DEFAULT_PARAMS to get above default parameters.
176 * added Signal.signame which returns signal name
178 * incompatible changes:
179 * Signal.trap raises ArgumentError when :SEGV, :BUS, :ILL, :FPE, :VTALRM
184 * added String#b returning a copied string whose encoding is ASCII-8BIT.
185 * change return value:
186 * String#lines now returns an array instead of an enumerator.
187 * String#chars now returns an array instead of an enumerator.
188 * String#codepoints now returns an array instead of an enumerator.
189 * String#bytes now returns an array instead of an enumerator.
193 * added Struct#to_h returning values with keys corresponding to the
194 instance variable names.
198 * added Thread#thread_variable_get for getting thread local variables
199 (these are different than Fiber local variables).
200 * added Thread#thread_variable_set for setting thread local variables.
201 * added Thread#thread_variables for getting a list of the thread local
203 * added Thread#thread_variable? for testing to see if a particular thread
204 variable has been set.
205 * added Thread.handle_interrupt as well as instance and singleton methods
206 pending_interrupt? for asynchronous handling of exceptions
207 * added Thread#backtrace_locations which returns similar information of
208 Kernel#caller_locations.
209 * new class Thread::Backtrace::Location to hold backtrace location
210 information. These are returned by Thread#backtrace_locations and
211 Kernel#caller_locations.
212 * incompatible changes:
213 * Thread#join and Thread#value now raises a ThreadError if target thread
214 is the current or main thread.
217 * change return value:
218 * Time#to_s now returns US-ASCII encoding instead of BINARY.
221 * new class. This class is replacement of set_trace_func.
222 Easy to use and efficient implementation.
226 * added main.define_method which defines a global function.
227 * added main.using, which imports refinements into the current file or
228 eval string. [experimental]
230 === Core classes compatibility issues (excluding feature bug fixes)
241 These methods no longer return an Enumerator, although passing a
242 block is still supported for backwards compatibility.
244 Code like str.lines.with_index(1) { |line, lineno| ... } no longer
245 works because str.lines returns an array. Replace lines with
246 each_line in such cases.
257 * StringIO#codepoints
259 * Zlib::GzipReader#lines
260 * Zlib::GzipReader#bytes
262 These methods are deprecated in favor of each_line, each_byte,
263 each_char and each_codepoint.
268 These methods were removed. Two procs are == only when they are
275 Fixnums, Bignums and Floats are frozen.
282 https://github.com/k-takata/Onigmo
284 * The :close_others option is true by default for system() and exec().
285 Also, the close-on-exec flag is set by default for all new file descriptors.
286 This means file descriptors doesn't inherit to spawned process unless
287 explicitly requested such as system(..., fd=>fd).
289 * Kernel#respond_to? against a protected method now returns false
290 unless the second argument is true.
292 * Kernel#respond_to_missing?
293 * Kernel#initialize_clone
294 * Kernel#initialize_dup
296 These methods are now private.
298 * Thread#join, Thread#value
302 * Mutex#lock, Mutex#unlock, Mutex#try_lock, Mutex#synchronize and Mutex#sleep
306 === Stdlib updates (outstanding ones only)
309 * Add HTML5 tag maker.
310 * CGI#header has been renamed to CGI#http_header and
311 aliased to CGI#header.
312 * When HTML5 tagmaker called, overwrite CGI#header,
313 CGI#header function is to create a <header> element.
316 * Removed CSV::dump and CSV::load to protect users from dangerous
317 serialization vulnerability
320 * Iconv has been removed. Use String#encode instead.
324 * added IO#cooked which sets the terminal to cooked mode within the given block.
325 * added IO#cooked! which sets the terminal to cooked.
327 * IO#raw, IO#raw!, and IO#getch accept keyword arguments, :min and :time.
331 * added IO#wait_writable method.
332 * added IO#wait_readable method as alias of IO#wait.
339 * Proxies are now automatically detected from the http_proxy environment
340 variable. See Net::HTTP::new for details.
341 * gzip and deflate compression are now requested for all requests by
342 default. See Net::HTTP for details.
343 * SSL sessions are now reused across connections for a single instance.
344 This speeds up connection by using a previously negotiated session.
345 * Requests may be created from a URI which sets the request_uri and host
346 header of the request (but does not change the host connected to).
347 * Responses contain the URI requested which allows easier implementation of
350 * Net::HTTP#local_host
351 * Net::HTTP#local_host=
352 * Net::HTTP#local_port
353 * Net::HTTP#local_port=
355 * Net::HTTP#connect uses local_host and local_port if specified.
359 * Net::IMAP.default_port
360 * Net::IMAP.default_imap_port
361 * Net::IMAP.default_tls_port
362 * Net::IMAP.default_ssl_port
363 * Net::IMAP.default_imaps_port
367 * ObjectSpace.reachable_objects_from(obj)
370 * Consistently raise an error when trying to encode nil values. All instances
371 of OpenSSL::ASN1::Primitive now raise TypeError when calling to_der on an
372 instance whose value is nil. All instances of OpenSSL::ASN1::Constructive
373 raise NoMethodError in the same case. Constructing such values is still
375 * TLS 1.1 & 1.2 support by setting OpenSSL::SSL::SSLContext#ssl_version to
376 :TLSv1_2, :TLSv1_2_server, :TLSv1_2_client or :TLSv1_1, :TLSv1_1_server
377 :TLSv1_1_client. The version being effectively used can be queried
378 with OpenSSL::SSL#ssl_version. Furthermore, it is also possible to
379 blacklist the new TLS versions with OpenSSL::SSL::OP_NO_TLSv1_1 and
380 OpenSSL::SSL::OP_NO_TLSv1_2.
381 * Added OpenSSL::SSL::SSLContext#renegotiation_cb. A user-defined callback
382 may be set which gets called whenever a new handshake is negotiated. This
383 also allows to programmatically decline (client) renegotiation attempts.
384 * Support for "0/n" splitting of records as BEAST mitigation via
385 OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS.
386 * The default options for OpenSSL::SSL::SSLContext have changed to
387 OpenSSL::SSL::OP_ALL & ~OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS
388 instead of OpenSSL::SSL::OP_ALL only. This enables the countermeasure for
389 the BEAST attack by default.
390 * OpenSSL requires passwords for decrypting PEM-encoded files to be at least
391 four characters long. This led to awkward situations where an export with
392 a password with fewer than four characters was possible, but accessing the
393 file afterwards failed. OpenSSL::PKey::RSA, OpenSSL::PKey::DSA and
394 OpenSSL::PKey::EC therefore now enforce the same check when exporting a
395 private key to PEM with a password - it has to be at least four characters
397 * SSL/TLS support for the Next Protocol Negotiation extension. Supported
398 with OpenSSL 1.0.1 and higher.
399 * OpenSSL::OPENSSL_FIPS allows client applications to detect whether OpenSSL
400 is FIPS-enabled. OpenSSL.fips_mode= allows turning on and off FIPS mode
401 manually in order to adapt to situations where FIPS mode would be an
402 explicit requirement.
403 * Authenticated Encryption with Associated Data (AEAD) is supported via
404 Cipher#auth_data= and Cipher#auth_tag/Cipher#auth_tag=.
405 Currently (OpenSSL 1.0.1c), only GCM mode is supported.
410 * OpenStruct#each_pair
413 * OpenStruct#to_h converts the struct to a hash.
415 * OpenStruct.new also accepts an OpenStruct / Struct.
419 * Pathname#find returns an enumerator if no block is given.
422 * rake has been updated to version 0.9.5.
424 This version is backwards-compatible with previous rake versions and
425 contains many bug fixes.
428 http://rake.rubyforge.org/doc/release_notes/rake-0_9_5_rdoc.html for a list
429 of changes in rake 0.9.3, 0.9.4 and 0.9.5.
432 * RDoc has been updated to version 4.0
434 This version is largely backwards-compatible with previous rdoc versions.
435 The most notable change is an update to the ri data format (ri data must
436 be regenerated for gems shared across rdoc versions). Further API changes
437 are internal and won't affect most users.
439 Notable changes include:
441 * Page support for ri. Try `ri ruby:` for a list of pages in ruby or
442 `ri ruby:syntax/literals` for the syntax documentation for literals.
444 This also works for gems such as `ri rspec:README` for the rspec gem's
446 * Markdown support. See ri RDoc::Markdown for details.
448 See https://github.com/rdoc/rdoc/blob/master/History.rdoc for a full list
449 of changes in rdoc 4.0.
453 * Resolv::DNS#timeouts=
454 * Resolv::DNS::Config#timeouts=
457 * REXML::Document#write supports Hash arguments.
458 * REXML::Document#write supports new :encoding option. It changes
459 XML document encoding. Without :encoding option, encoding in
460 XML declaration is used for XML document encoding.
465 RubyGems 2.0.0 features the following improvements:
467 * Improved support for default gems shipping with ruby 2.0.0+
468 * A gem can have arbitrary metadata through Gem::Specification#metadata
469 * `gem search` now defaults to --remote and is anchored like gem list.
470 * Added --document to replace --rdoc and --ri. Use --no-document to
471 disable documentation, --document=rdoc to only generate rdoc.
472 * Only ri-format documentation is generated by default.
473 * `gem server` uses RDoc::Servlet from RDoc 4.0 to generate HTML
476 For an expanded list of updates and bug fixes see:
477 https://github.com/rubygems/rubygems/blob/master/History.txt
480 * Shellwords#shellescape now stringifies the given object using to_s.
481 * Shellwords#shelljoin accepts non-string objects in the given
482 array, each of which is stringified using to_s.
485 * deprecated methods:
486 * StringIO#lines, #bytes, #chars and #codepoints are deprecated.
489 * Added Syslog::Logger which provides a Logger API atop Syslog.
490 * Syslog::Priority, Syslog::Level, Syslog::Option and Syslog::Macros
491 are introduced for easy detection of available constants on a
495 * incompatible changes:
496 * Dir.mktmpdir uses FileUtils.remove_entry instead of
497 FileUtils.remove_entry_secure. This means that applications should not
498 change the permission of the created temporary directory to make
499 writable from other users.
502 * Syck has been removed. YAML now completely depends on libyaml being
504 * libyaml is now bundled with ruby, for cases where the library is not
508 * Added streaming support for Zlib::Inflate and Zlib::Deflate. This allows
509 processing of a stream without the use of large amounts of memory.
510 * Added support for the new deflate strategies Zlib::RLE and Zlib::FIXED.
511 * Zlib streams are now processed without the GVL. This allows gzip, zlib and
512 deflate streams to be processed in parallel.
513 * deprecated methods:
514 * Zlib::GzipReader#lines and #bytes are deprecated.
516 === Stdlib compatibility issues (excluding feature bug fixes)
518 * OpenStruct new methods can conflict with custom attributes named
519 "each_pair", "eql?", "hash" or "to_h".
521 * Dir.mktmpdir in lib/tmpdir.rb
527 * NUM2SHORT() and NUM2USHORT() added. They are similar to NUM2INT, but short.
529 * rb_newobj_of() and NEWOBJ_OF() added. They create a new object of a given class.