Closed f440 closed 2 months ago
Thanks for this. Thanks @f440. I used bundler to create my other gem (I think!) and it has the following for files:
spec.files = Dir.chdir(File.expand_path(__dir__)) do
`git ls-files -z`.split("\x0").reject do |f|
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
end
end
Not including the CHANGELOG seems weird to me so I think I want to keep that in the package. That'd feel similar to not packaging docs. I also don't see them skipping Gemfile (and this is bundler generated).
Actually I just tried using bundler 2.5.15 (what I had installed) to generate a test gem and it came up with this:
spec.files = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL) do |ls|
ls.readlines("\x0", chomp: true).reject do |f|
(f == gemspec) ||
f.start_with?(*%w[bin/ test/ spec/ features/ .git .github appveyor Gemfile])
end
end
Perhaps we should just run with that?
Thank you for checking!
Package users typically don't check the documentation in the expanded directory. When they want to know about changes, they're more likely to look at the Changelog: https://...
displayed by bundle info acts_as_list
. However, I want to respect your decision.
I've incorporated your suggested content as is, with some adjustments to prevent errors.
Thanks @f440, definitely that'd usually be the case. Could be handy if someone finds themself offline with only the gem installation to work from but that would be rare :D I'll merge this now. Do you want a release straight away or are you happy to wait?
Thanks for merging this! I'm ready for a release whenever you feel it's appropriate. Thank you for creating such a useful library!
You're most welcome :D I can't take all the credit. There have been many talented authors before me on this one :)
If you ever get the chance, check out my new positioning gem: https://github.com/brendon/positioning
I've released this as 1.2.2
.
This pull request updates the
*.gemspec
file to optimize the gem package size and structure. The changes include:files
to exclude test files,Gemfile
, andfrom the package.CHANGELOG
test_files
specification as it is no longer recommended.These changes reduce the extracted package size from 324 KB to
140 KB160 KB.Benefits:
References:
*.gemspec
file generated bybundle gem
command