Fix loading gem specification externally
When a gem's specification is loaded by another gem, to get at the metadata, or other info, the pathing for loading the version.rb won'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 the
README.mdand update this PR~ - [ ] If this change merits an update to
CHANGELOG.md, add an entry following Keep a Changelog guidelines with semantic versioning
Thanks @pboling , and sorry I missed this! Do you mind adding a CHANGELOG.md entry for this? Something like:
## [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.
@JacobEvelyn Rebase is done! Added to CHANGELOG.md.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 100.00%. Comparing base (b14bb9b) to head (1f6f6bc).
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
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.