-
Notifications
You must be signed in to change notification settings - Fork 26
Fix loading gem specification externally #397
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
base: main
Are you sure you want to change the base?
Conversation
|
Thanks @pboling , and sorry I missed this! Do you mind adding a ## [Unreleased](https://github.com/panorama-ed/memo_wise/compare/v1.13.0...HEAD)
**Gem enhancements:**
- Fixed issue with external tools loading `memo_wise.gemspec` from different directories [[#397]](https://github.com/panorama-ed/memo_wise/pull/397))
_No breaking changes!_
**Project enhancements:** none |
|
Will do. I think I may have improved the pattern a bit since this PR. Will review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue where the gem specification cannot be loaded by external gems due to a relative path reference. The fix adds #{__dir__}/ to make the version file path absolute relative to the gemspec location.
- Added
#{__dir__}/prefix to the version.rb path to enable external gem loading - Refactored the version loading expression from multi-line to single-line format
- Preserved all functionality and comments
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@JacobEvelyn Rebase is done! Added to CHANGELOG.md. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #397 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 3 3
Lines 197 197
Branches 89 89
=========================================
Hits 197 197 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
When a gem's specification is loaded by another gem, to get at the metadata, or other info, the pathing for loading the
version.rbwon't work properly. This isn't an issue when running the gem on its own, but other tools that do analysis of other libraries will not be able to load this gemspec. Fortunately the fix is very simple, just prefix#{__dir__}/, and__dir__was introduced in Ruby 1.9.1, so shouldn't pose a problem.I discovered this as I am now building a gem that loads other gem's gemspecs to get the data, with the goal of helping them fund-raise. https://github.com/galtzo-floss/floss_funding
Before merging:
Copy the table printed at the end of the latest benchmark results into theREADME.mdand update this PRCHANGELOG.md, add an entry following Keep a Changelog guidelines with semantic versioning