Commit cff7664
Pattern matching support for arguments
Implement `Rake::TaskArguments#deconstruct_keys` for use in Ruby 3.1
and up. This means in an idiomatic rake task we can use rightward
assignment to say:
```
task :get, %i[tenant id] do |_t, args|
args => {tenant:, id:}
...
end
```
... and omit the `.to_h` from `args`, raising `NoMatchingPatternError`
if either of the two params is absent from the task args.1 parent a4454e6 commit cff7664
2 files changed
+11
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
97 | 101 | | |
98 | 102 | | |
99 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
57 | 64 | | |
58 | 65 | | |
59 | 66 | | |
| |||
0 commit comments