Repository navigation
fix(ruby): read parenthesised add_dependency calls in a .gemspec - #685
Open
hamid-digitalmarketer wants to merge 1 commit into
Open
hamid-digitalmarketer wants to merge 1 commit into
hamid-digitalmarketer wants to merge 1 commit into
Conversation
parseGemspec only matched the whitespace call style
(`spec.add_dependency "rails", "~> 7.1"`), so a gemspec that uses the
equally valid parenthesised style (`spec.add_dependency("rails", "~> 7.1")`)
produced no dependency rows at all: no drift, no exposure, no runtime.
Accept either whitespace or a parenthesised argument list after the method
name. quotedVersionConstraints already skips a closing paren, so every
quoted bound is still kept and drift still resolves from the lower bound.
Refs vibgrate#623
hamid-digitalmarketer
pushed a commit
to hamid-digitalmarketer/hamid-digitalmarketer
that referenced
this pull request
Nov 14, 2026
- merged 43 (was 39), open 67 (was 70), closed-unmerged 52 (was 51) - upstream projects 22 (was 20): added markline-dev/markline#56 and adbar/trafilatura#1086 to the table and the recent-merges list - in-review section points at the current queue (vibgrate/cli#685)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
parseGemspecinsrc/core-open/scanners/ruby-scanner.tsonly matched the whitespace call style:Both forms are valid Ruby and the parenthesised one is common in generated and RuboCop-formatted gemspecs. Because the regex required
\s+between the method name and the first quote, every parenthesised dependency produced no row at all — it never reached drift, exposure or the runtime rows.Fix
Accept either style after the method name:
quotedVersionConstraintsalready stops at the closing paren, so every quoted bound is still kept and drift still resolves from the lower bound. No behaviour change for the whitespace style.Tests
New
test/ruby-gemspec-parenthesised.test.ts(4 tests) covers a gemspec mixing both styles:add_dependency,add_runtime_dependency,add_development_dependency, with and without a version)>= 2.2, < 4→ resolves2.2.0,major-behindadd_development_dependencylands indevDependenciesunknowndrift)Before the change all 4 tests fail (rows missing); after it they pass.
npx eslint src/core-open/scanners/ruby-scanner.tsis clean.npx tsc --noEmitreports only the pre-existingonnxruntime-nodetyping gap insrc/vendor/fastembed/index.ts(optional dependency not installed locally), nothing from this change.Fixes #623.
Contributor contact: +92 316 7417135