Skip to content
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

Fix "uninitialized constant" errors for StringIO and SimpleDelegator #312

Merged
merged 1 commit into from
Jul 28, 2022

Conversation

mattbrictson
Copy link
Owner

In instances when tomo is used without a Gemfile, or is used with a Gemfile that contains very few gems, running tomo might result in an "uninitialized constant" crash for StringIO or SimpleDelegator.

This happens because tomo is trying to use these constants without explicitly require-ing them. By luck, gems in a typical Gemfile will already require these, so by the time tomo runs, they have already been loaded. But this is not guaranteed.

Fix by using the proper require statements to insure that these constants are loaded.

In instances when tomo is used without a Gemfile, or is used with a
Gemfile that contains very few gems, running `tomo` might result in an
"uninitialized constant" crash for `StringIO` or `SimpleDelegator`.

This happens because tomo is trying to use these constants without
explicitly `require`-ing them. By luck, gems in a typical Gemfile will
already require these, so by the time tomo runs, they have already been
loaded. But this is not guaranteed.

Fix by using the proper `require` statements to insure that these
constants are loaded.
@mattbrictson mattbrictson added 🐛 Bug Fix Fixes a bug automerge Automatically merge this PR once all required checks pass labels Jul 28, 2022
@kodiakhq kodiakhq bot merged commit 373abff into main Jul 28, 2022
@kodiakhq kodiakhq bot deleted the bugs/fix-missing-constant branch July 28, 2022 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge this PR once all required checks pass 🐛 Bug Fix Fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant