Skip to content

Commit

Permalink
Merge pull request #4535 from daipom/plugin-generator-update-template…
Browse files Browse the repository at this point in the history
…-gemspec

plugin-generator: update gemspec to remove unnecessary files
  • Loading branch information
ashie authored Jul 7, 2024
2 parents 329c9ae + 23a50a0 commit d07d6ea
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 d07d6ea

Please sign in to comment.