Skip to main content

patch_lockfile

Function patch_lockfile 

Source
pub fn patch_lockfile(
    content: &str,
    fixes: &[FixSuggestion],
) -> (String, Vec<String>)
Expand description

Patch a Gemfile.lock’s raw text, replacing vulnerable gem versions with fixed versions.

Only modifies spec lines (indent=4) within GEM/GIT/PATH sections. Preserves platform suffixes, formatting, and all other content.

Returns the patched content and a list of gem names that were actually modified.