Skip to content

Exclude link-checker config from the packaged gem (STF-557)#190

Merged
horgh merged 1 commit into
mainfrom
greg/stf-557-gem-packaging
Jun 5, 2026
Merged

Exclude link-checker config from the packaged gem (STF-557)#190
horgh merged 1 commit into
mainfrom
greg/stf-557-gem-packaging

Conversation

@oschwald

@oschwald oschwald commented Jun 5, 2026

Copy link
Copy Markdown
Member

Follow-up to the merged STF-557 PR: the gemspec packages Dir['**/*'] minus an exclusion list that didn't cover the link-checking config added in that PR, so lychee.toml/mise.toml/mise.lock (and .gitignore) were shipping in the published gem. Add them to the exclusion list.

This addresses @horgh's review note; the original STF-557 PR had already merged, so this is a separate PR.

Part of STF-557.

🤖 Generated with Claude Code

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the gemspec to exclude configuration and lock files like .gitignore, lychee.toml, mise.lock, and mise.toml from the packaged gem. The reviewer suggested a best-practice improvement to use git ls-files instead of Dir['**/*'] to avoid packaging untracked local files.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread maxmind-geoip2.gemspec Outdated
Gem::Specification.new do |s|
s.authors = ['William Storey']
s.files = Dir['**/*'].difference(Dir['.github/**/*', 'dev-bin/**/*', 'test/**/*', 'CLAUDE.md', 'Gemfile*', 'Rakefile', '*.gemspec', 'README.dev.md'])
s.files = Dir['**/*'].difference(Dir['.github/**/*', '.gitignore', 'lychee.toml', 'mise.lock', 'mise.toml', 'dev-bin/**/*', 'test/**/*', 'CLAUDE.md', 'Gemfile*', 'Rakefile', '*.gemspec', 'README.dev.md'])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using Dir['**/*'] to determine the files to package in the gem is risky because it will include any untracked local files, temporary test databases, or potentially sensitive credentials/configuration files present in the working directory when gem build is run.

Using git ls-files is the standard best practice for Ruby gems. It ensures only tracked files are packaged, while falling back to Dir['**/*'] if git is unavailable (e.g., when building from a source tarball).

  s.files       = begin
                    IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL, &:read).split("\x0")
                  rescue StandardError
                    Dir['**/*']
                  end.difference(Dir['.github/**/*', '.gitignore', 'lychee.toml', 'mise.lock', 'mise.toml', 'dev-bin/**/*', 'test/**/*', 'CLAUDE.md', 'Gemfile*', 'Rakefile', '*.gemspec', 'README.dev.md'])

@oschwald oschwald force-pushed the greg/stf-557-gem-packaging branch from 91c2726 to f653708 Compare June 5, 2026 22:37
The gemspec packages Dir['**/*'] minus an exclusion list, which didn't cover
the link-checking config added in this PR, so lychee.toml/mise.toml/mise.lock
(and .gitignore) would ship in the published gem. Add them to the exclusion.

Part of STF-557.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@oschwald oschwald force-pushed the greg/stf-557-gem-packaging branch from f653708 to 4396ba3 Compare June 5, 2026 22:50
@horgh horgh merged commit 6d098bd into main Jun 5, 2026
38 checks passed
@horgh horgh deleted the greg/stf-557-gem-packaging branch June 5, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants