It is that time of the year again! As tradition dictates, Christmas is approaching, and with it comes the gift of a new Ruby release.

I experimented with Ruby 4.0.0-preview3 for a few days, and I am excited to share with you the highlights of this upcoming version.

Let’s dive into what’s new and what makes this release special.

What’s new in core classes

Ruby::Box

This new feature was introduced to provide a way to create isolated context executions within the same Ruby process.

It allows you to run code in a separate "box" that has its own global variables, constants, and class definitions.

Take the following code as an example:

# file: greetings.rb
class String
def shout
self.upcase...

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help