From 1e96b0a2262cfa92430854ba906896cd0af8ede6 Mon Sep 17 00:00:00 2001 From: f440 Date: Sun, 14 Jul 2024 11:16:10 +0900 Subject: [PATCH 1/2] gemspec: Remove test files, Gemfile, and ChangeLog from package --- acts_as_list.gemspec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/acts_as_list.gemspec b/acts_as_list.gemspec index 77f53b9c..02e9a7f2 100644 --- a/acts_as_list.gemspec +++ b/acts_as_list.gemspec @@ -23,8 +23,7 @@ Gem::Specification.new do |s| end # Load Paths... - s.files = `git ls-files`.split("\n") - s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") + s.files = `git ls-files -z`.split("\x0").reject { |f| f.start_with?(*%w[test/ Gemfile CHANGELOG]) } s.executables = `git ls-files -- bin/*`.split("\n").map {|f| File.basename(f)} s.require_paths = ["lib"] From f40cbe9b67e80bf5e617948a0f46ab5de2090e2f Mon Sep 17 00:00:00 2001 From: f440 Date: Mon, 15 Jul 2024 18:14:50 +0900 Subject: [PATCH 2/2] Update spec.files to include CHANGELOG and use newer bundler method --- acts_as_list.gemspec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/acts_as_list.gemspec b/acts_as_list.gemspec index 02e9a7f2..bce41b97 100644 --- a/acts_as_list.gemspec +++ b/acts_as_list.gemspec @@ -23,7 +23,13 @@ Gem::Specification.new do |s| end # Load Paths... - s.files = `git ls-files -z`.split("\x0").reject { |f| f.start_with?(*%w[test/ Gemfile CHANGELOG]) } + gemspec = File.basename(__FILE__) + s.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 s.executables = `git ls-files -- bin/*`.split("\n").map {|f| File.basename(f)} s.require_paths = ["lib"]