New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sorbet doesn't notice gems defined in gemspec file #1238
Labels
bug
Something isn't working
Comments
connorshea
added
bug
Something isn't working
unconfirmed
This issue has not yet been confirmed by the Sorbet team
labels
Jul 9, 2019
connorshea
changed the title
gem_loader.rb doesn't notice gems defined in gemspec file
Sorbet doesn't notice gems defined in gemspec file
Jul 9, 2019
aisamanra
removed
the
unconfirmed
This issue has not yet been confirmed by the Sorbet team
label
Jul 9, 2019
Big problem |
I believe this is the same bug -- I've found that including a gem in a project and generating the hidden definitions does not include that gem's dependencies. I've worked around this by explicitly listing the dependencies I'm using in my project's Gemfile. |
Going to close this in favor of Tapioca |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Input
I've created an example repository to demonstrate the problem: https://github.com/connorshea/sorbet-gemspec-issue-example
Note how the
yard.rbi
file changes with this commit that adds yard explicitly in the Gemfile.If you use a gemspec to define dependencies, instead of defining the dependencies in a
Gemfile
explicitly, Sorbet (I suspectgem_loader.rb
specifically) doesn't seem to find as many module definitions. I assume this is becausegem_loader.rb
for whatever reason doesn't handle thegemspec
keyword correctly in a Gemfile.Works:
Doesn't work:
Observed output
The file at
sorbet/rbi/gems/yard.rbi
is only 300 lines vs. 1200 lines whenyard
is required explicitly via the Gemfile.Expected behavior
I'd expect Sorbet to output the same
yard.rbi
either way.It doesn't seem like any other gems' generated rbis differ when Sorbet is initialized, only YARD (and presumably any other gems that have requires specified inI think this does actually effect all gems defined in a gemspec. If they're not explicitlygem_loader.rb
.require
d by a file in the project, Sorbet won't notice them. Whereas if they're defined in theGemfile
, Sorbet will notice them regardless of anyrequire
.The text was updated successfully, but these errors were encountered: