Remove Ruby, Elixir, and C# generators#228
Merged
leighmcculloch merged 5 commits intomasterfrom Mar 3, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Removes the legacy Ruby, Elixir, and C# generator implementations (and their spec output fixtures), and updates the project docs/tests/CLI to reflect that only JavaScript and Go generators remain built in.
Changes:
- Delete Ruby/Elixir/C# generator implementations and their spec output fixtures.
- Narrow generator spec coverage to JavaScript and Go and remove the Ruby/Elixir/C# autoloads.
- Update CLI usage banner and README guidance to reflect generator removals.
Reviewed changes
Copilot reviewed 46 out of 46 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| spec/output/generator_spec_ruby/union.x/union_key.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/union.x/my_union.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/union.x/int_union.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/union.x/MyXDR.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/test.x/my_namespace/nester/nested_union.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/test.x/my_namespace/nester/nested_struct.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/test.x/my_namespace/nester/nested_enum.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/test.x/my_namespace/nester.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/test.x/my_namespace/my_struct.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/test.x/my_namespace/lots_of_my_structs.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/test.x/my_namespace/has_stuff.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/test.x/my_namespace/color.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/test.x/MyXDR.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/struct.x/my_struct.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/struct.x/MyXDR.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/optional.x/has_options.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/optional.x/MyXDR.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/nesting.x/union_key.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/nesting.x/my_union/two.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/nesting.x/my_union/one.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/nesting.x/my_union.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/nesting.x/MyXDR.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/enum.x/message_type.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/enum.x/color3.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/enum.x/color2.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/enum.x/color.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/enum.x/MyXDR.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/const.x/MyXDR.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/block_comments.x/account_flags.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_ruby/block_comments.x/MyXDR.rb | Remove Ruby generator fixture output |
| spec/output/generator_spec_elixir/union.x/MyXDR_generated.ex | Remove Elixir generator fixture output |
| spec/output/generator_spec_elixir/test.x/MyXDR_generated.ex | Remove Elixir generator fixture output |
| spec/output/generator_spec_elixir/struct.x/MyXDR_generated.ex | Remove Elixir generator fixture output |
| spec/output/generator_spec_elixir/optional.x/MyXDR_generated.ex | Remove Elixir generator fixture output |
| spec/output/generator_spec_elixir/nesting.x/MyXDR_generated.ex | Remove Elixir generator fixture output |
| spec/output/generator_spec_elixir/enum.x/MyXDR_generated.ex | Remove Elixir generator fixture output |
| spec/output/generator_spec_elixir/const.x/MyXDR_generated.ex | Remove Elixir generator fixture output |
| spec/output/generator_spec_elixir/block_comments.x/MyXDR_generated.ex | Remove Elixir generator fixture output |
| spec/lib/xdrgen/generator_spec.rb | Restrict generator specs to JavaScript + Go |
| lib/xdrgen/generators/ruby.rb | Remove Ruby generator implementation |
| lib/xdrgen/generators/elixir.rb | Remove Elixir generator implementation |
| lib/xdrgen/generators/csharp.rb | Remove C# generator implementation |
| lib/xdrgen/generators.rb | Remove autoloads for deleted generators |
| lib/xdrgen/compilation.rb | Remove Ruby default language in Compilation initializer |
| lib/xdrgen/cli.rb | Update CLI usage banner / language option default behavior |
| README.md | Update documentation to reflect generator removals and new guidance |
Comments suppressed due to low confidence (4)
lib/xdrgen/compilation.rb:9
languagenow defaults tonil, butcompilestill falls back toGenerators.for_language(@language)when no customgeneratoris provided. If bothgeneratorandlanguageare nil, this currently fails with a confusing "Unsupported language: " error. Consider validating ininitialize/compilethat at least one oflanguageorgeneratoris provided and raising a clearerArgumentError(or defaulting the CLI to a specific language).
def initialize(source_paths, output_dir:".", language: nil, generator: nil, namespace: nil, options: {})
raise "An empty list of source paths (.x files) provided. At least one source file must be provided to compile." if source_paths.empty?
@source_paths = source_paths
@output_dir = output_dir
@namespace = namespace
README.md:23
- The NOTE says "Generators are no longer included in this repository", but this PR still keeps built-in generators (and later in the README you list
javascript/golang). Consider rephrasing to reflect the new reality more precisely (e.g., legacy built-ins are limited to JavaScript and Go; other generators were removed/moved).
> [!NOTE]
> **Generators are no longer included in this repository.** If you're building a
> code generator, use xdrgen as a library (see below). Generators that were
> previously included (Python, Rust) have been slowly moved out to other
> repositories, usually close to the Stellar XDR libraries they generated. For
> any that were not moved but deleted (C#, Elixir, Ruby), they can be found in
README.md:79
- The CLI language values appear to be
javascriptandgo(sinceGenerators.for_languagedoesconst_get(language.to_s.classify)and the class isGo, notGolang). Listinggolanghere will lead users to an "Unsupported language" error; consider changing this togoor adding an explicit alias in the CLI/generator lookup.
`xdrgen [-o OUTPUT_DIR] [-l LANGUAGE] [-n NAMESPACE] [INPUT_FILES ...]`
The CLI still has the following built-in generators:
- javascript
- golang
README.md:8
- Ruby version support is inconsistent: line 7 states "requires ruby 3.1 to 3.3", but later in the binary usage section it says "compatible with ruby 2.1 or higher". These can’t both be true; please update/remove the older claim to match the actual supported Ruby versions (ideally align with
xdrgen.gemspec’srequired_ruby_version).
`xdrgen` requires ruby 3.1 to 3.3 to run.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tomerweller
approved these changes
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Delete the Ruby, Elixir, and C# generator implementations along with their spec output fixtures. Remove Ruby as the default CLI language, update the usage banner to use JavaScript as the example, and narrow the generator test suite to JavaScript and Go. Add a README note directing users to the git history for any deleted generators they may need.
Why
These generators are maintained externally and not maintained within the @stellar org. The project no longer accepts new built-in generators — users are directed to use xdrgen as a library with externally maintained generators. This keeps generators hosted in repos of maintainers, where maintainers can address bugs and security reports, and closer to the use cases that in this ecosystem are typically a Stellar XDR library or SDK. This continues the cleanup started with the prior removal of Python, Java, and Rust generators that happened in #226 (@overcart) and #221 (@leighmcculloch).