remap 2.2.48 → 2.2.49
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/remap/rule/map/required.rb +1 -1
- data/lib/remap/state/extension.rb +23 -27
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b08b87634002b0cae7bb2cd048e0ec99cfcec6769fdd583f9aabed3f350bdec4
|
4
|
+
data.tar.gz: de61b4d83778f29f4580a41a4e6eda80f5817ade7fbda0dddd7a6192034270e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e52d7bca5b4304ce6dd05fc7d868c49af4a0db0ccd9616a851c0ed0daa66425807f50baa6fbba9fcd4b1a8f5fcb177895c0b9bcb87fc3d1f34fee051c07fc172
|
7
|
+
data.tar.gz: 100f753a963b91ae5b8eca6ef7c480b19704e848efab92de313ffbd7c9048daf9db30a1422b4a65e7029c905def26b0690dd12c7279f4dd23c0eb8b4784ae805
|
@@ -223,6 +223,8 @@ module Remap
|
|
223
223
|
state.merge!(notices: notices + [notice])
|
224
224
|
in [{value:}, {mapper:}]
|
225
225
|
state.merge!(scope: value, mapper: mapper)
|
226
|
+
in [{path: p1}, {path: p2}]
|
227
|
+
state.merge!(path: p1 + p2)
|
226
228
|
in [{path:}, {key:, value:}]
|
227
229
|
state.merge!(path: path + [key], key: key, value: value)
|
228
230
|
in [{path:}, {key:}]
|
@@ -289,39 +291,33 @@ module Remap
|
|
289
291
|
#
|
290
292
|
# @return [State<U>]
|
291
293
|
def execute(&block)
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
end
|
302
|
-
end
|
303
|
-
|
304
|
-
r = Proc.new(&block).call(value, **only(*names), **options.only(*names)) do |reason|
|
305
|
-
ignore!(reason)
|
306
|
-
end
|
307
|
-
throw :done, r
|
308
|
-
rescue NameError => e
|
309
|
-
fatal!(e.message)
|
310
|
-
rescue KeyError => e
|
311
|
-
[e.key]
|
312
|
-
rescue IndexError
|
313
|
-
[]
|
294
|
+
value = fetch(:value) { return self }
|
295
|
+
|
296
|
+
path = catch :ignore do
|
297
|
+
names = block.parameters.reduce([]) do |acc, (type, name)|
|
298
|
+
case type
|
299
|
+
in :keyreq
|
300
|
+
acc + [name]
|
301
|
+
else
|
302
|
+
acc
|
314
303
|
end
|
315
|
-
|
316
|
-
set(path: path + tail_path).ignore!("Undefined path")
|
317
304
|
end
|
318
305
|
|
319
|
-
|
320
|
-
|
306
|
+
n1 = options.only(*names)
|
307
|
+
n2 = only(*names)
|
308
|
+
|
309
|
+
result = block[value, **n2, **n1] do |reason|
|
310
|
+
return ignore!(reason)
|
321
311
|
end
|
322
312
|
|
323
|
-
set(result)
|
313
|
+
return set(result)
|
324
314
|
end
|
315
|
+
|
316
|
+
set(path: path).ignore!("Undefined path")
|
317
|
+
rescue KeyError => e
|
318
|
+
set(path: [e.key]).ignore!(e.message)
|
319
|
+
rescue IndexError => e
|
320
|
+
ignore!(e.message)
|
325
321
|
end
|
326
322
|
|
327
323
|
# Passes {#value} to block and returns {self}
|