Ruby 2.4 is the latest stable version of Ruby. Many new features and improvements are included for the increasingly diverse and expanding demands for Ruby. With this major update from Ruby 2.3 in Fedora 24 to Ruby 2.4 in Fedora 26, Fedora becomes the superior Ruby development platform.
- Name: Vít Ondruch
- Email: email@example.com
- Release notes owner: Simon Clark (sclark)
Ruby 2.4 is upstream's new major release of Ruby. Many new features and improvements are included.
Introduce hash table improvement (by Vladimir Makarov)
Improve the internal structure of hash table (st_table) by introducing open addressing and an inclusion order array. This improvement has been discussed with many people, especially with Yura Sokolov.
Binding#irb: Start a REPL session similar to binding.pry
While you are debugging, you may often use p to see the value of variables. With pry you can use binding.pry in your application to launch a REPL and run any Ruby code. r56624 introduces binding.irb which behaves like that with irb.
Unify Fixnum and Bignum into Integer
Though ISO/IEC 30170:2012 doesn’t specify details of the Integer class, Ruby had two visible Integer classes: Fixnum and Bignum. Ruby 2.4 unifies them into Integer. All C extensions which touch the Fixnum or Bignum class need to be fixed.
String supports Unicode case mappings
String/Symbol#upcase/downcase/swapcase/capitalize(!) now handle Unicode case mappings instead of only ASCII case mappings.
Ruby 2.4 also contains the following performance improvements including language changes:
- Array#max, Array#min
- [x, y].max and [x, y].min are optimized to not create a temporary array under certain conditions.
- Added Regexp#match?, which executes a regexp match without creating a back reference object and changing $~ to reduce object allocation.
- Speed up instance variable access
- Thread#report_on_exception and Thread.report_on_exception
- Ruby ignores exceptions in threads unless another thread explicitly joins them. With report_on_exception = true, you can notice if a thread has died due to an unhandled exception.
- Thread deadlock detection now shows threads with their backtrace and dependency
- Ruby has deadlock detection around waiting threads, but its report doesn’t include enough information for debugging. Ruby 2.4’s deadlock detection shows threads with their backtrace and dependent threads.
Other notable changes
- Support OpenSSL 1.1.0
- ext/tk is now removed from stdlib Feature #8539
- XMLRPC is now removed from stdlib Feature #12160
Benefit to Fedora
With a latest release, Ruby language is supporting the newest language features, which enables even faster and easier development of Ruby applications.
- Proposal owners:
- Finish packaging of Ruby 2.4. Current changes available in private-ruby-2.4 branch of ruby package in dist-git.
- Rebuilding of Ruby packages providing native extensions (i.e. packages which depends on libruby).
- Other developers:
- Rebuild of packages with binary extensions (i.e. packages which depends on libruby) will be handled automatically, but some packages might need fixes/updates to support Ruby 2.4 properly.
- Release engineering:
- Separate Koji tag for package rebuild will be needed.
- Policies and guidelines: N/A (not needed for this Change)
- Trademark approval: N/A (not needed for this Change)
- User specific Ruby binary extensions need to be rebuild.
How To Test
- No special hardware is needed.
- To test, install Ruby 2.4. The test builds are pusblished on Ruby-SIG ML
- Try to locally rebuild your packages using Ruby 2.4.
- Use the packages with your applications previously written in Ruby.
- If something doesn't work as it should, let us know.
The Ruby programs/scripts should behave as they were used to.
$ dnf repoquery --disablerepo=* --enablerepo=rawhide --enablerepo=rawhide-source --arch=src --whatrequires 'ruby-devel' | sort | uniq | wc -l 163
- Contingency mechanism: We would like to get a special buildroot tag to be able to rebuild necessary the packages with Ruby 2.4. If anything goes wrong, the tag could be easily dropped and previous version of Ruby 2.3 and its dependencies stays intact. The tag would be merged into F26 after everything is rebuild.
- Contingency deadline: Change Checkpoint: Proposal submission deadline (System Wide Changes)
- Blocks release? No
- Blocks product? No
- The Ruby 2.4 bumps soname, therefore Ruby packages, which use binary extensions, should be rebuilt. Nevertheless, since upstream paid great attention to source compatibility, no changes to your code are needed.