Ruby 2.7.0 Is Available Now

The latest version of Ruby, 2.7.0, brings many new capabilities and performance improvements.

Recently, the team behind Ruby programming language announced the release of Ruby 2.7.0, which brings a bunch of new features and performance enhancements such as Pattern Matching, REPL improvement, Compaction GC and Separation of positional and keyword arguments.
Version 2.7 has introduced Pattern matching(a widely used feature in functional programming languages) as an experimental feature. [Feature #14912]
It allows you to traverse a given object and assign its value if it matches a pattern.
  1. require "json"  
  3. json = <<END  
  4. {  
  5. "name""Alice",  
  6. "age": 30,  
  7. "children": [{ "name""Bob""age": 2 }]  
  8. }  
  9. END  
  11. case JSON.parse(json, symbolize_names: true)  
  12. in {name: "Alice", children: [{name: "Bob", age: age}]}  
  13. p age #=> 2  
  14. end  
The team said that now irb, the bundled interactive environment (REPL; Read-Eval-Print-Loop), will also support multi-line editing. irb is powered by reline(a readline-compatible library implemented in pure Ruby) and also provides rdoc integration. It allows you to display the reference for a given class, module, or method.
Compaction GC is a new feature that can defragment a fragmented memory space.
Other notable new features include Numbered parameters as default block parameters, a beginless range, Enumerable#tally(counts the occurrence of each element), a private method can now be called with a literal self, and Enumerator::Lazy#eager(generates a non-lazy enumerator from a lazy enumerator).
To learn more you can visit the official announcement here.