Ruby 2.7 in Focal

Lucas Kanashiro lucas.kanashiro at canonical.com
Fri Mar 27 20:19:40 UTC 2020


The Ruby 2.7 transition is now complete and it is another new feature for
users of the upcoming Ubuntu Focal Fossa release.

Ruby 2.7 is probably the last Ruby 2.x series release (the next one should
be 3.0) and it comes with some nice features and improvements like: Pattern
Matching, REPL improvement, Compaction GC, Separation of positional and
keyword arguments and much more. To have a broad overview about the cool
features and improvements check the Ruby 2.7 Release Announcement [1].
Below you can find some changes introduced by this new release.

Experimental features:

* Pattern matching
* Beginless range (i.e. array = [0,1,2,3,4,5]; p array[..2] #=> [0, 1, 2])

Features that emit warnings now and will become errors in the future:

* Using the last argument as keyword parameters
* Numbered parameters: '_1', '_2', and so on are reserved for numbered
parameter
* Proc.new and Kernel#proc with no block in a method called with a block
* Set special variables '$;' and '$,' to non-nil values
* 'yield' in singleton class syntax
* Access and setting of $SAFE, it will become a normal global variable in
Ruby 3.0

Deprecated features, which will raise exceptions now:

* Kernel#lambda with no block in a method called with a block raises an
exception
* Line break is prohibited as an identifier of the quote here document
* Dir.glob and Dir.[] no longer allow NUL-separated glob pattern. Use Array
instead.

Moreover, some libraries are not bundled anymore in Ruby 2.7. If you need
them please install them separately:

* CMath
* Scanf
* Shell
* Synchronizer (ruby-sync)
* ThreadsWait (ruby-thwait)
* E2MM (ruby-e2mmap)

For more information about Ruby 2.7 check the upstream documentation [2]
(section Reference Documentation).

[1] https://www.ruby-lang.org/en/news/2019/12/25/ruby-2-7-0-released/
<https://www.ruby-lang.org/en/news/2019/12/25/ruby-2-7-0-released/)>
[2] https://www.ruby-lang.org/en/documentation/
<https://www.ruby-lang.org/en/documentation/)>

Enjoy it!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-devel/attachments/20200327/0bbf6a14/attachment.html>


More information about the ubuntu-devel mailing list