Commit f1c7f11
authored
Fix Ruby 4.0 warning in default before_template and after_template (#986)
Fixes #985
`SGML#call` passes the caller's block to `before_template` and
`after_template` via `&block`, but the default no-op implementations had
no block parameter. Ruby 4.0 warns about this:
```
warning: the block passed to 'before_template' may be ignored
warning: the block passed to 'after_template' may be ignored
```
I added `(&)` to both signatures so they accept the block without
binding it to a variable. Subclasses that override these methods won't
be affected.2 files changed
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
329 | | - | |
| 329 | + | |
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
| 333 | + | |
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
33 | 38 | | |
0 commit comments