Skip to content

Managed mode with file option ruby_package_prefixΒ #4019

@apoloval

Description

@apoloval

Feature

The managed mode of Buf accepts the following file options for Ruby:

  • ruby_package, to set the exact Ruby module path where code must be generated.
  • ruby_package_suffix, to set a Ruby module path that is appended at the end of the module that corresponds to the Protobuf package FQN.

However, there is no such a thing like ruby_package_prefix to set the Ruby module path that is prepended at the beginning of the module that corresponds to the directory structure of the proto file. In other words, a file option to have the same behavior than go_package_prefix.

This file option would be very useful for Buf modules that consist in many Protobuf files with many Protobuf subpackages and subdirectories, ensuring that you can generate the code in some path of your Ruby codebase and have the directory structure matching the Ruby module structure. And not having to write dozens of override rules to make it happen for every Proto package using ruby_package alone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions