|
47 | 47 | //! rewriter could not have written in place (a blank line before it — |
48 | 48 | //! the in-place match swallows every blank line before the declaration, |
49 | 49 | //! and the append always writes one; it goes with the block) that |
50 | | -//! another locked spec depends on. Otherwise the gem is kept as a |
| 50 | +//! another locked spec depends on (a spec sub-line, or a Bundler 4.1 |
| 51 | +//! `OVERRIDES` `with:` target, #1989). Otherwise the gem is kept as a |
51 | 52 | //! direct pin: a stray exact pin installs the same bytes, while dropping |
52 | 53 | //! a real declaration would stop `Bundler.require` loading the gem. |
53 | 54 | //! * a `CHECKSUMS` entry the rewriter ADDED is only recognizable next to |
@@ -190,7 +191,11 @@ fn override_targets<'l>(lines: &'l [&'l str]) -> impl Iterator<Item = &'l str> + |
190 | 191 | let range = named_section(lines, "OVERRIDES").unwrap_or((0, 0)); |
191 | 192 | lines[range.0..range.1].iter().filter_map(|l| { |
192 | 193 | let entry = indented(l, 2)?.trim_end(); |
193 | | - // Gem names hold no `"` or `,`, so each `, ` starts a new argument. |
| 194 | + // Bundler writes `"<target>", with: "<gem>", in: "<parent>"` |
| 195 | + // (`Override#to_lock`: `inspect`ed values joined by `, `). A |
| 196 | + // `version:` value may itself hold `, `, so splitting on it can |
| 197 | + // break that value apart, but never the `with:` one: a gem name |
| 198 | + // holds no `"`, `,` or space. |
194 | 199 | entry.split(", ").find_map(|arg| { |
195 | 200 | arg.strip_prefix("with: \"")? |
196 | 201 | .strip_suffix('"') |
|
0 commit comments