T-Ruby v0.0.42 Released
T-Ruby v0.0.42 adds full Ruby 4.0 support, released just days after Ruby 4.0's Christmas release. (PR#28)
Ruby 4.0 Support
📖 See also: CLI Reference
This release brings full compatibility with Ruby 4.0, which was released on Christmas 2025:
RubyVersion Value Object
A new RubyVersion class handles version parsing, comparison, and feature detection:
version = TRuby::RubyVersion.new("3.2.0")
version.major # => 3
version.minor # => 2
version >= TRuby::RubyVersion.new("3.0") # => true
Version-Specific Code Generation
The new CodeEmitter strategy pattern generates appropriate code for different Ruby versions:
- Automatic target Ruby version detection from your environment
- Version-specific transformations for Ruby 3.0 through 4.0
UnsupportedRubyVersionErrorfor versions outside 3.0-4.x range
Block Parameter Type Erasure
Type annotations are now erased from block parameters.
CI Improvements
- Added
ruby-headto CI matrix for future compatibility testing continue-on-errorenabled for ruby-head builds
Dependency Updates
- Added
benchmarkgem as explicit dependency (resolves deprecation warning) - Made
listengem optional to fix Ruby 4.0 ffi compatibility
Upgrade
gem update t-ruby
Looking Ahead
With Ruby 4.0 now officially released, T-Ruby continues its commitment to supporting the latest Ruby versions while maintaining backwards compatibility with Ruby 3.0+.
