Skip to content

Commit

Permalink
plugin-generator: update gemspec to remove unnecessary files
Browse files Browse the repository at this point in the history
We should reflect recent gemspec moves.

`test_files` is not documented anymore:

* https://guides.rubygems.org/specification-reference

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

Signed-off-by: Daijiro Fukuda <[email protected]>
  • Loading branch information
daipom committed Jun 20, 2024
1 parent 0dba6ca commit 23a50a0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions templates/new_gem/fluent-plugin.gemspec.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ Gem::Specification.new do |spec|
spec.homepage = "TODO: Put your gem's website or public repo URL here."
spec.license = "<%= @license.name %>"

test_files, files = `git ls-files -z`.split("\x0").partition do |f|
f.match(%r{^(test|spec|features)/})
spec.files = Dir.chdir(__dir__) do
`git ls-files -z`.split("\x0").reject do |f|
(File.expand_path(f) == __FILE__) ||
f.start_with?(*%w[test/ spec/ features/ .git .circleci appveyor Gemfile])
end
end
spec.files = files
spec.executables = files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = test_files
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_development_dependency "bundler", "~> <%= bundler_version %>"
Expand Down

0 comments on commit 23a50a0

Please sign in to comment.