Closed ybiquitous closed 4 months ago
@ybiquitous Good catch! Thank you for the patch!
However, I still prefer to use git ls-files
which very effectively prevents local temporary files or any other unrelated files being mixed into the gem package by accident. So, could you rewrite the patch to use git ls-files
?
While the bundle gem
command today generates this ugly and complex code block,
For example, here's the default code that bundle gem
command today generates (which to me seems too ugly and complex).
https://github.com/rubygems/rubygems/blob/dd0a6163530b58229eb36141aa2e8c426231dbbd/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt#L28-L36
I guess something equally simple with your code like this would just work in our case, and would produce a similar result with your code.
`git ls-files lib`.split << 'README.md' <<'MIT_LICENSE'
@amatsuda Thanks for the review! Your thoughts on git ls-files
make sense to me.
And, I also agree that bundle gem
generates too ugly spec.files =
. 😅
I just pushed 5206374 based on your suggestion. Can you take a look again? Thanks.
@ybiquitous Thank you!
This aims to reduce the gem size by excluding unneeded files like test files, CI files, etc. Note that
test_files
in a gemspec is no longer supported.Gem size diff:
Newly included files in the gem: