#12951 closed enhancement (fixed)

ruby-2.7.0

Reported by: Douglas R. Reno Owned by: Bruce Dubbs
Priority: normal Milestone: 9.1
Component: BOOK Version: SVN
Severity: normal Keywords:
Cc:

Description

New minor version

Change History (3)

comment:1 by Bruce Dubbs, 19 months ago

Owner: changed from blfs-book to Bruce Dubbs
Status: newassigned

comment:2 by Bruce Dubbs, 19 months ago

Changes since the 2.6.0 release

  • Pattern matching is introduced as an experimental feature.
  • Automatic conversion of keyword arguments and positional arguments is deprecated, and conversion will be removed in Ruby 3. [Feature #14183]
  • When a method call passes a Hash at the last argument, and when it passes no keywords, and when the called method accepts keywords, a warning is emitted. To continue treating the hash as keywords, add a double splat operator to avoid the warning and ensure correct behavior in Ruby 3.
  • When a method call passes keywords to a method that accepts keywords, but it does not pass enough required positional arguments, the keywords are treated as a final required positional argument, and a warning is emitted. Pass the argument as a hash instead of keywords to avoid the warning and ensure correct behavior in Ruby 3.
  • When a method accepts specific keywords but not a keyword splat, and a hash or keywords splat is passed to the method that includes both Symbol and non-Symbol keys, the hash will continue to be split, and a warning will be emitted. You will need to update the calling code to pass separate hashes to ensure correct behavior in Ruby 3.
  • If a method does not accept keywords, and is called with keywords, the keywords are still treated as a positional hash, with no warning. This behavior will continue to work in Ruby 3.
  • Non-symbols are allowed as keyword argument keys if the method accepts arbitrary keywords.
  • Non-Symbol keys in a keyword arguments hash were prohibited in 2.6.0, but are now allowed again.
  • <code>nil</code> is allowed in method definitions to explicitly mark that the method accepts no keywords. Calling such a method with keywords will result in an ArgumentError.
  • Passing an empty keyword splat to a method that does not accept keywords no longer passes an empty hash, unless the empty hash is necessary for a required parameter, in which case a warning will be emitted. Remove the double splat to continue passing a positional hash.
  • Numbered parameters as default block parameters are introduced.
  • Proc.new and Kernel#proc with no block in a method called with a block is warned now.
  • Kernel#lambda with no block in a method called with a block raises an exception.
  • A beginless range is experimentally introduced. It might be useful in +case+, new call-sequence of the <code>Comparable#clamp</code>, constants and DSLs.
  • Setting <code>$;</code> to a non-nil value is warned now. Use of it in String#split is warned too. This warning can be suppressed with {-W:no-deprecated option}#label-Warning+option.
  • Setting <code>$,</code> to a non-nil value is warned now. Use of it in Array#join is warned too. This warning can be suppressed with {-W:no-deprecated option}#label-Warning+option.
  • Quoted here-document identifiers must end within the same line.
  • The flip-flop syntax deprecation is reverted.
  • Comment lines can be placed between fluent dot now.
  • Calling a private method with a literal +self+ as the receiver is now allowed.
  • Modifier rescue now operates the same for multiple assignment as single assignment.
  • +yield+ in singleton class syntax is warned and will be deprecated later.
  • Argument forwarding by <code>(...)</code> is introduced.
  • Access and setting of <code>$SAFE</code> is now always warned. <code>$SAFE</code> will become a normal global variable in Ruby 3.0.
  • <code>Object#{taint,untaint,trust,untrust}</code> and related functions in the C-API no longer have an effect (all objects are always considered untainted), and are now warned in verbose mode. This warning will be disabled even in non-verbose mode in Ruby 3.0, and the methods and C functions will be removed in Ruby 3.2.
  • Refinements take place at Object#method and Module#instance_method.

comment:3 by Bruce Dubbs, 19 months ago

Resolution: fixed
Status: assignedclosed

Fixed at revision 22522.

Note: See TracTickets for help on using tickets.