Skip to content

Commit 6291b25

Browse files
eitoballclaude
andcommitted
Exclude CLAUDE.md and docs/ from packaged gem files
spec.files globbed every file on disk, so AI-assistant instructions and session notes ended up shipped inside net-ping-2.1.0, breaking downstream RPM packaging (issue #46). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 461ec1d commit 6291b25

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

net-ping.gemspec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ Gem::Specification.new do |spec|
99
spec.homepage = 'https://github.com/chernesk/net-ping'
1010
spec.summary = 'A ping interface for Ruby.'
1111
spec.test_file = 'test/test_net_ping.rb'
12-
spec.files = Dir['**/*'].reject { |f| f.include?('git') || File.extname(f) == '.gem' }
12+
spec.files = Dir['**/*'].reject do |f|
13+
f.include?('git') || File.extname(f) == '.gem' || f == 'CLAUDE.md' || f.start_with?('docs/')
14+
end
1315
spec.metadata = {
1416
'bug_tracker_uri' => "#{spec.homepage}/issues",
1517
'changelog_uri' => "#{spec.homepage}/blob/master/CHANGES",

test/test_net_ping_gem_packaging.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ def test_gem_create_excludes_generated_artifacts_from_spec_files_and_keeps_bundl
7878
delete_files(built_gem_files)
7979
end
8080

81+
def test_gem_create_excludes_non_distributable_project_files_from_spec_files
82+
load_specifications.each do |path, spec|
83+
non_distributable = spec.files.select do |f|
84+
f == 'CLAUDE.md' || f.start_with?('docs/')
85+
end
86+
87+
assert_equal([], non_distributable, path)
88+
end
89+
end
90+
8191
def test_gem_check_uses_fixed_expectations_instead_of_loaded_specifications
8292
stdout, stderr, status = run_rake('clean', 'gem:create')
8393

0 commit comments

Comments
 (0)