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.
Motivation
When Bundler is configured to cache gems inside the
vendor/cache
folder in the app directory, for source gems, it creates git clones in that folder. Those gems are consumed from those git clones, so they look like they are part of the application code, as far as Tapioca is concerned.Implementation
By adding an explicit check for the source files coming from
Bundler.app_cache
folder, we can make sure we treat those source locations are gem sources.Tests
I am afraid we don't have a good way to test these yet. But, this was tested on a real Shopify app which was using
vendor/cache
folder as default. The current install of Tapioca ended up not generating any RBI files for source gems. We debugged it with @leoncustodio to this issue and confirmed that with this patch, we were able to make Tapioca produce RBI files for those gems as well.