Skip to content

feat: Ruby language support for jsii-rosetta #3711

Description

@omarqureshi

Describe the feature

Add Ruby as a supported target language for jsii-rosetta, so the TypeScript example snippets embedded in CDK documentation are transliterated to idiomatic Ruby (for Construct Hub and inline docs), alongside the existing Python / Java / C# / Go renderers.

Part of the coordinated Ruby language support effort:

Proposed solution

A new RubyVisitor (src/languages/ruby.ts) that walks the TypeScript AST and renders idiomatic Ruby, registered as the RUBY target — the same visitor contract the other languages implement. Covered by translation fixtures and unit tests.

Scope & safety

  • Strictly additive — a new visitor plus a target-enum entry; no existing language's output changes.
  • Self-contained — the visitor has no dependency on the Ruby-capable jsii compiler, so the rosetta test suite passes on its own.
  • Follows the established convention for src/languages/* visitors, so it is reviewable against the Python/Java precedent.

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions