From 1b86adce3ed0a174d922a12b502b261385a3fccf Mon Sep 17 00:00:00 2001 From: Marek Suchánek Date: Apr 13 2020 18:11:06 +0000 Subject: Checked that my Ruby RN doesn't break anything; fixes in list alignment for the Ruby 2.7 RN --- diff --git a/modules/release-notes/pages/developers/Development_Ruby.adoc b/modules/release-notes/pages/developers/Development_Ruby.adoc index 547e275..7315762 100644 --- a/modules/release-notes/pages/developers/Development_Ruby.adoc +++ b/modules/release-notes/pages/developers/Development_Ruby.adoc @@ -140,7 +140,7 @@ Automatic conversion of keyword arguments and positional arguments is deprecated * 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. - ++ [source,ruby] ---- def foo(key: 42); end; foo({key: 42}) # warned @@ -150,7 +150,7 @@ Automatic conversion of keyword arguments and positional arguments is deprecated ---- * 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. - ++ [source,ruby] ---- def foo(h, **kw); end; foo(key: 42) # warned @@ -160,7 +160,7 @@ Automatic conversion of keyword arguments and positional arguments is deprecated ---- * 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. - ++ [source,ruby] ---- def foo(h={}, key: 42); end; foo("key" => 43, key: 42) # warned @@ -169,21 +169,21 @@ Automatic conversion of keyword arguments and positional arguments is deprecated ---- * 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. - ++ [source,ruby] ---- def foo(opt={}); end; foo( key: 42 ) # OK ---- * Non-symbols are allowed as keyword argument keys if the method accepts arbitrary keywords. - ++ [source,ruby] ---- def foo(**kw); p kw; end; foo("str" => 1) #=> {"str"=>1} ---- * `**nil` 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`. - ++ [source,ruby] ---- def foo(h, **nil); end; foo(key: 1) # ArgumentError @@ -194,7 +194,7 @@ Automatic conversion of keyword arguments and positional arguments is deprecated ---- * 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. - ++ [source,ruby] ---- h = {}; def foo(*a) a end; foo(**h) # [] @@ -211,8 +211,6 @@ See the link:https://www.ruby-lang.org/en/news/2019/12/25/ruby-2-7-0-released/[u == Jekyll has been updated to version 4 -// TODO: Make sure that I didn't break anything by nesting the previous release note one level deeper. - The *Jekyll* static page generator and its plug-ins have been updated to version 4.0.0. This version includes the following changes compared to version 3.8: