Skip to content
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

Make gemspec file generated by bundle gem properly exclude itself from packaged gem #6339

Merged
merged 2 commits into from
Feb 6, 2023

Conversation

amatsuda
Copy link
Member

@amatsuda amatsuda commented Feb 4, 2023

This patch follows up f444478 by @nobu

What was the end-user or developer problem that led to this PR?

There used to be a commit f444478 that intended to exclude the gemspec file from gem package, but the gemspec file is in fact still included in gems that we build today, even though the test included in that commit (that asserts it "does not include the gemspec file in files") is passing.

This was because:

  1. The patch was incomplete, and it failed to actually exclude the gemspec file
  2. The test code was referencing a wrong gemspec which of course does not include the newly generated gemspec file during the test. So the test wasn't really testing anything

What is your fix for the problem, implemented in this PR?

This patch fixes both broken test and the newgem template. Now the gemspec file should be properly excluded as intended.

Make sure the following tasks are checked

The previous code loads bundler's gemspec which does not include the generated
gemspec file, and thus the test was passing where it should indeed fail.
With this change, the test properly fails now.
by comparing the file names with full path.

Follows up f444478
Copy link
Member

@deivid-rodriguez deivid-rodriguez left a comment

Choose a reason for hiding this comment

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

Makes total sense, thanks for fixing this @amatsuda!

@deivid-rodriguez deivid-rodriguez merged commit 9c953a5 into rubygems:master Feb 6, 2023
@deivid-rodriguez deivid-rodriguez changed the title Exclude gemspec file itself from gem (take 2) Make gemspec file generated by bundle gem properly exclude itself from packaged gem Feb 6, 2023
@amatsuda amatsuda deleted the exclude_gemspec branch February 10, 2023 05:42
deivid-rodriguez added a commit that referenced this pull request Feb 15, 2023
Exclude gemspec file itself from gem (take 2)

(cherry picked from commit 9c953a5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants