Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix error seen when this gem installed but not specified as dependency in project #111

Merged
merged 2 commits into from
Dec 20, 2024

Conversation

PikachuEXE
Copy link
Collaborator

@PikachuEXE PikachuEXE commented Dec 18, 2024

Related issues

To test:

  • gem uninstall gem-release
  • gem install gem-release -v '2.2.3.alpha4'

Update 1: Instead of rescuing LoadError, use require_relative as suggested in #111 (review)

@coveralls
Copy link

coveralls commented Dec 18, 2024

Coverage Status

coverage: 93.95%. remained the same
when pulling 61f46cf on fix/rubygems-plugin
into 5b274f8 on master.

Copy link
Contributor

@pboling pboling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer require_relative for loading internal files.

require 'gem/release'
require 'rubygems/command_manager'
begin
require 'gem/release'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A better solution would be to use require_relative here. This is the answer for ensuring that libraries always load their internal files, rather than risking loading the wrong file via a load path search.

See: rubocop/rubocop#8748 (comment)

@PikachuEXE
Copy link
Collaborator Author

Took me a while to get it right
You can install via gem install gem-release -v '2.2.3.alpha4' to test (uninstall all other gem-release versions first I guess

@tvdeyen
Copy link

tvdeyen commented Dec 19, 2024

Woohoo!! Thanks to much @PikachuEXE installing '2.2.3.alpha4' resolved this issue for me.

Copy link
Contributor

@pboling pboling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@PikachuEXE PikachuEXE merged commit e94c08e into master Dec 20, 2024
14 checks passed
@PikachuEXE PikachuEXE deleted the fix/rubygems-plugin branch December 20, 2024 00:32
@PikachuEXE
Copy link
Collaborator Author

Fix released in https://rubygems.org/gems/gem-release/versions/2.2.3

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants