Skip to content

Handling Version Loading in Gems Properly#504

Merged
Yang-33 merged 2 commits intomasterfrom
do-not-require-version-in-gemspec-file-not-to-affect-test
Apr 10, 2025
Merged

Handling Version Loading in Gems Properly#504
Yang-33 merged 2 commits intomasterfrom
do-not-require-version-in-gemspec-file-not-to-affect-test

Conversation

@Yang-33
Copy link
Copy Markdown
Contributor

@Yang-33 Yang-33 commented Apr 10, 2025

If the version file is not loaded in the library code but is loaded in the gemspec file, issues like (#379) load errors or missing constants can occur.

To be cautious, the gemspec avoids requiring the version file directly. Instead, it reads the file content. This approach also includes a simple validation to ensure the version string follows the SemVer format, so mistakes in the version file can be detected early.

Additionally, this change fixes an actual case where the version file was not being required properly.

@Yang-33 Yang-33 requested a review from a team April 10, 2025 01:22
@Yang-33 Yang-33 self-assigned this Apr 10, 2025
@Yang-33 Yang-33 linked an issue Apr 10, 2025 that may be closed by this pull request
@Yang-33 Yang-33 enabled auto-merge April 10, 2025 01:24
@Yang-33 Yang-33 removed a link to an issue Apr 10, 2025
Copy link
Copy Markdown
Contributor

@mokuzon mokuzon left a comment

Choose a reason for hiding this comment

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

Cool, thank you!

@Yang-33 Yang-33 added this pull request to the merge queue Apr 10, 2025
Merged via the queue into master with commit f478b3d Apr 10, 2025
8 checks passed
@Yang-33 Yang-33 deleted the do-not-require-version-in-gemspec-file-not-to-affect-test branch April 10, 2025 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants