Skip to content

Skip directories ending with .rb when collecting analysis targets#454

Merged
sinsoku merged 1 commit intoruby:masterfrom
sinsoku:skip-directories-with-rb-suffix
May 10, 2026
Merged

Skip directories ending with .rb when collecting analysis targets#454
sinsoku merged 1 commit intoruby:masterfrom
sinsoku:skip-directories-with-rb-suffix

Conversation

@sinsoku
Copy link
Copy Markdown
Collaborator

@sinsoku sinsoku commented May 10, 2026

Dir.glob("**/*.{rb,rbs}") matches not only files but also directories whose names end with .rb or .rbs.
Such directories exist in real projects (e.g. the http_parser.rb gem directory inside rubygems' VCR cassettes), and Service#batch then crashes with Errno::EISDIR while trying to File.read them.

Filter the glob result to regular files only.

`Dir.glob("**/*.{rb,rbs}")` matches not only files but also directories
whose names end with `.rb` or `.rbs`. Such directories exist in real
projects (e.g. the `http_parser.rb` gem directory inside rubygems'
VCR cassettes), and `Service#batch` then crashes with `Errno::EISDIR`
while trying to `File.read` them.

Filter the glob result to regular files only.
@sinsoku sinsoku force-pushed the skip-directories-with-rb-suffix branch from 2da4fbf to ba6be58 Compare May 10, 2026 12:39
@sinsoku sinsoku enabled auto-merge (squash) May 10, 2026 12:39
@sinsoku sinsoku merged commit 19ff60c into ruby:master May 10, 2026
6 checks passed
@sinsoku sinsoku deleted the skip-directories-with-rb-suffix branch May 10, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants