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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a564dcf130adbf8c40eb089d14f498f993362b74823728ec8ad44b98014034e6
4
- data.tar.gz: 3dcac97cd1e4c630ec55ccdbdb6c43922f2ce5367d770e471ebaa77f5ae3fc8c
3
+ metadata.gz: b08b87634002b0cae7bb2cd048e0ec99cfcec6769fdd583f9aabed3f350bdec4
4
+ data.tar.gz: de61b4d83778f29f4580a41a4e6eda80f5817ade7fbda0dddd7a6192034270e9
5
5
  SHA512:
6
- metadata.gz: 237c0305757a4a12e5d3c24358fd9ed6295d0159baf0bb5786a9b019e3b50c98bd163334b35b04bab99ef1f19adeb232aec234a2aed76ad16ade778c3950606e
7
- data.tar.gz: 1c6637383207baf0bd32fd6398f34dc935a5237e2fa67eafa2fccaa1db0d1f9d3f569c6f0695f9c148e737b1c4de15a974a09ba193d0af55ffaf3bef21bad07d
6
+ metadata.gz: e52d7bca5b4304ce6dd05fc7d868c49af4a0db0ccd9616a851c0ed0daa66425807f50baa6fbba9fcd4b1a8f5fcb177895c0b9bcb87fc3d1f34fee051c07fc172
7
+ data.tar.gz: 100f753a963b91ae5b8eca6ef7c480b19704e848efab92de313ffbd7c9048daf9db30a1422b4a65e7029c905def26b0690dd12c7279f4dd23c0eb8b4784ae805
@@ -16,7 +16,7 @@ module Remap
16
16
  end
17
17
 
18
18
  s3 = s2.then(&path.output)
19
- s4 = s3.set(path: state.path)
19
+ s4 = s3.merge(path: state.path)
20
20
 
21
21
  s4.except(:key)
22
22
  end
@@ -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
- bind do |value|
293
- result = catch :done do
294
- tail_path = catch :ignore do
295
- names = block.parameters.reduce([]) do |acc, (type, name)|
296
- case type
297
- in :keyreq
298
- acc + [name]
299
- else
300
- acc
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
- if result.equal?(Dry::Core::Constants::Undefined)
320
- ignore!("Undefined returned, skipping!")
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}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remap
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.48
4
+ version: 2.2.49
5
5
  platform: ruby
6
6
  authors:
7
7
  - Linus Oleander