memo_wise icon indicating copy to clipboard operation
memo_wise copied to clipboard

Fix loading gem specification externally

Open pboling opened this issue 4 months ago • 4 comments

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.md and update this PR~
  • [ ] If this change merits an update to CHANGELOG.md, add an entry following Keep a Changelog guidelines with semantic versioning

pboling avatar Aug 10 '25 11:08 pboling

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

JacobEvelyn avatar Nov 10 '25 17:11 JacobEvelyn

Will do. I think I may have improved the pattern a bit since this PR. Will review.

pboling avatar Nov 10 '25 18:11 pboling

@JacobEvelyn Rebase is done! Added to CHANGELOG.md.

pboling avatar Nov 11 '25 06:11 pboling

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.

codecov[bot] avatar Nov 11 '25 06:11 codecov[bot]