gemspec: Remove unnecessary files from gem file#4534
Merged
ashie merged 1 commit intofluent:masterfrom Jul 6, 2024
Merged
Conversation
This reduces Gem file size: 867k -> 558k Remove: * test files * git files * Gemfile `test_files` is not documented anymore: * https://guides.rubygems.org/specification-reference Looks like it is not recommended: * rubygems/bundler#3207 Looks like we should also remove git files and Gemfile because the template of Bundler 2.4.13 is as follows: spec.files = Dir.chdir(__dir__) do `git ls-files -z`.split("\x0").reject do |f| (File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor Gemfile]) end end The removed files except for `test/*` are as follows: before = `git ls-files`.split($\) after = Dir.chdir(__dir__) do `git ls-files -z`.split("\x0").reject do |f| (File.expand_path(f) == __FILE__) || f.start_with?(*%w[test/ .git Gemfile]) end end before.reject{|path| path.start_with? "test/"}.difference after => [".github/DISCUSSION_TEMPLATE/q-a-japanese.yml", ".github/DISCUSSION_TEMPLATE/q-a.yml", ".github/ISSUE_TEMPLATE.md", ".github/ISSUE_TEMPLATE/bug_report.yml", ".github/ISSUE_TEMPLATE/config.yml", ".github/ISSUE_TEMPLATE/feature_request.yml", ".github/PULL_REQUEST_TEMPLATE.md", ".github/workflows/stale-actions.yml", ".github/workflows/test-ruby-head.yml", ".github/workflows/test.yml", ".gitignore", "Gemfile"] after.difference before => [] Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue(s) this PR fixes:
None.
What this PR does / why we need it:
Remove the following files from the gem file:
This reduces the gem file size: 867k -> 558k.
We should reflect recent gemspec moves as the current
filesandtest_filesare written more than 10 years ago:test_filesis not documented anymore:Looks like it is not recommended:
Looks like we should also remove git files and Gemfile because the template of Bundler 2.4.13 is as follows:
The removed files except for
test/*are as follows:Docs Changes:
Not needed.
Release Note:
Not needed.