pat
pat

Reputation: 16226

Adding Sorbet RBI files to gems

I'm investigating what it might take to add Sorbet RBI files to gems that I maintain, and I'm trying to figure out the proper process for this. I don't want to have Sorbet as a runtime dependency for the gems, though, so that means having all the type information in a separate RBI file.

My current queries around this are:

Upvotes: 3

Views: 977

Answers (1)

bagman
bagman

Reputation: 46

My understanding (I'm in a similar boat) based reading through the custom RBI content is that they recommend writing the definitions in a rbi directory in the gem root directory. I don't think they should go in the the sorbet directory since that file gets quite large (and you don't want to have gem users having to download MBs of repeated definitions).

I've been putting the typed sigils in the library files that I have definitions for and having the RBI files separate. The srb tc picks up the definitions (and complains as appropriate). This means that I don't need to add sorbet as a gem dependency (other than for development).

Upvotes: 3

Related Questions