Skip to main content

T-Ruby v0.0.40 Released

T-Ruby v0.0.40 brings significant parser improvements, including access modifier support and heredoc detection. (PR#22)

Access Modifier Support

📖 See also: Class Annotations

You can now use Ruby's access modifiers directly with method definitions:

private def secret_method(key: String): String
# ...
end

protected def internal_method(data: Hash): Boolean
# ...
end

T-Ruby correctly parses these patterns and preserves access modifier keywords during type erasure.

Heredoc Detection

A new HeredocDetector prevents false positive method detection inside heredoc strings:

message = <<~SQL
def fake_method # This won't be parsed as a method
SELECT * FROM users
end
SQL

Supports all heredoc variants: <<DELIM, <<-DELIM, <<~DELIM, <<'DELIM', <<"DELIM".

Block Comment Support

Parser now correctly skips =begin/=end block comments.

RBS Access Modifier Support

Generated .rbs files now include access modifiers:

private def secret_method: (key: String) -> String

Legacy Code Removal

This release removes deprecated legacy compiler code:

  • LegacyParser class removed
  • LegacyCompiler class removed
  • TRuby::RBSGenerator removed (use IR::RBSGenerator)
  • use_ir and use_combinator parameters removed (IR is now always used)

Upgrade

gem update t-ruby