Repository navigation
Commit f1264cd
* Start fix for #1509
Assisted-by: Claude Code:claude-opus-5-5
* Keep gem source pins for multi-line and {} blocks
Hosted rollback and remove dropped the `!` source pin from a gem
declared inside a `source(...)` block whose arguments span lines, or
inside a `source("...") { ... }` brace block. Bundler 4.0.19+ then
refused every frozen install of the restored Gemfile.lock, and the
brace form also came back with the gem at the wrong indent.
The Gemfile block scanner now keeps a statement open while a `(` or
`[` is unclosed, remembers that the statement began with `source`
until its `do` or `{`, and tracks `{ }` blocks alongside `do ... end`.
Fixes #1509
Assisted-by: Claude Code:claude-opus-5-5
* Tighten gem source-block brace and paren rules
A brace block now counts as the source's own block only right after
the `source(...)` argument list, so `source ENV.fetch(...) { ... } do`
keeps its `!` pin. Hash braces keep a statement open like parens, a
stray `}` no longer closes a `do` block, and `?(`-style character
literals are no longer read as brackets. A restored first gem in a
multi-line `source(` block no longer gets a blank line after the
opener. Only the end of an unfinished line is carried forward, so a
long open bracket no longer costs quadratic time.
Refs #1509
Assisted-by: Claude Code:claude-opus-5-5
* Keep keyword blocks inside brackets in gem scan
An `if` at the start of a line inside an open `(`, `[` or hash was
read as a modifier, so it opened nothing while its `end` still closed
the enclosing `source` block, and the gem lost its `!` pin on
rollback or remove. A stabby lambda's `-> {` was read as a hash.
A line that leaves only a bracket open now starts a fresh expression
on the next line, `-> {` opens a block, and an open bracket carries
only a `source` statement on to its block, so a bracket the scanner
misses elsewhere no longer hides every later source block.
Refs #1509
Assisted-by: Claude Code:claude-opus-5-5
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 313d532 commit f1264cd
2 files changed
Lines changed: 250 additions & 37 deletions
File tree
- crates
- socket-patch-cli/tests
- socket-patch-core/src/patch/redirect/upstream
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
443 | 449 | | |
444 | 450 | | |
445 | 451 | | |
| |||
533 | 539 | | |
534 | 540 | | |
535 | 541 | | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
536 | 548 | | |
537 | 549 | | |
538 | 550 | | |
| |||
838 | 850 | | |
839 | 851 | | |
840 | 852 | | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
841 | 863 | | |
842 | 864 | | |
843 | 865 | | |
| |||
1098 | 1120 | | |
1099 | 1121 | | |
1100 | 1122 | | |
| 1123 | + | |
| 1124 | + | |
1101 | 1125 | | |
1102 | 1126 | | |
1103 | 1127 | | |
| |||
1303 | 1327 | | |
1304 | 1328 | | |
1305 | 1329 | | |
| 1330 | + | |
| 1331 | + | |
1306 | 1332 | | |
1307 | 1333 | | |
1308 | 1334 | | |
| |||
2373 | 2399 | | |
2374 | 2400 | | |
2375 | 2401 | | |
| 2402 | + | |
| 2403 | + | |
2376 | 2404 | | |
2377 | 2405 | | |
2378 | 2406 | | |
| |||
2382 | 2410 | | |
2383 | 2411 | | |
2384 | 2412 | | |
| 2413 | + | |
| 2414 | + | |
| 2415 | + | |
| 2416 | + | |
2385 | 2417 | | |
2386 | 2418 | | |
2387 | 2419 | | |
| 2420 | + | |
| 2421 | + | |
2388 | 2422 | | |
2389 | 2423 | | |
2390 | 2424 | | |
| |||
0 commit comments