Ruby

What is new in Ruby 3.3

Ruby 3.3 boasts performance boosts (faster YJIT, M:N threads), a pure-Ruby JIT compiler (RJIT), a new parser (Prism), developer-friendly features in IRB, and multiple bug fixes.

Performance Gains in Ruby 3.3- String.dup vs. String#+

Ruby 3.3 optimizes String.dup to match the speed of String#+, allowing developers to choose based on preference without sacrificing performance.

Rubygems introduced a file option to specify Ruby version in Gemfile

Rubygems introduced a :file option so that we can read the Ruby version from a file.

Ruby 3.3 Implements Range#reverse_each Method For Very Large or Beginless Ranges And Error Handling For Endless Ranges

Range#reverse_each can now process beginless ranges with an Integer endpoint and raises TypeError for endless ranges.

Ruby 3.3 fixes duplicate keyword argument warning bug

Ruby 3.3 fixes inconsistent warnings for duplicate keyword arguments

Ruby 3.3 Introduces Range#overlap? method

Compare two ranges and see if they overlap each other. overlap? returns true if two ranges overlap each other, otherwise false.

Ruby 3.3 resolves the Range#size bug for rational endpoints

Ruby 3.3 addresses a bug in the Range#size method related to rational endpoints, ensuring accurate counting. Learn how this fix enhances functionality and resolves issues in working with ranges.

Sort Your Rails Models By The Order of their Associations

Sort your Rails models by the order of their belongs_to associations using ActiveRecord::Reflection.

Ruby adds a new core class called Data to represent simple immutable value objects

The Data class helps define simple classes for value-alike objects that can be extended with custom methods.

Rails "ActionController::Parameters.to_h" can now receive a block

ActionController::Parameters.to_h will now receive a block just like Hash#to_h and achieve parity. This gives the ability to customize the way parameters are passed to the controller.