Gemfiles are basically your only code-sharing option in Ruby. One good thing about Bundler is that it’s smart enough to allow reading gems from subfolders of a larger project, so you wouldn’t necessarily need to split it out of the project it belongs to.
path "schema" do
You could then define the
schema subfolder with its own gemspec, and then any project that needs it would do:
gem "my_service-schema", git: "https://your-host.com/path/to/my_service.git", glob: "schema/*.gemspec"
I did this to share generated Ruby code from a protobufs definition, and it works well.