remap 2.2.34 → 2.2.38

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: 864996caad52b60c1bd199bf1289950f1f9992d4b0501e7e772bf1ebae7dc204
4
- data.tar.gz: 922aafbe39603c7fbdcac19bfb20188b98426a6542b61fd8becee587dc3fc7a0
3
+ metadata.gz: 8fdfe8ed64a781f1239e1738a2e71b99acc864e60508353fc7d22c848b128cbb
4
+ data.tar.gz: 654613c35e8d8294a94f748ca170da5bd19199dc66ba33c8ec055333e1deaf98
5
5
  SHA512:
6
- metadata.gz: d1534113f0ac7ce2919ba0247fe4c4d36dcc2f3bff526a13c6f1886a326e91480d284a1d49534967d73a7e43c6f50ac0ab3e60e05bc44f76f358dc96b04e07d3
7
- data.tar.gz: ca3dcd403d881f29c30cb2aaefc5e711b5729bb5a43f053acbbf340ce4c8edc3e3f89beb33f8465b707c5343052e30c4a457377065fce75fd71d19a56a6f41f8
6
+ metadata.gz: a56c3113747f8efc8721bf3d2731c0292c4c54e6570969b72f774433be0f7c64874af9fbb448bfe146978cc39d31725cde491e3a682d684e5e28909fa7a3e3ca
7
+ data.tar.gz: b753d26605bdca1201be84826f4c352b426c4b853c687cc997ba964786827305268c805d6c6e85ee15e284becee4a8deaec9998dda35ff1e3431f919abe903e9
@@ -308,12 +308,12 @@ module Remap
308
308
  #
309
309
  # @return [Rule::Each]]
310
310
  # @raise [ArgumentError] if no block given
311
- def each(&block)
311
+ def each(backtrace: caller, &block)
312
312
  unless block_given?
313
313
  raise ArgumentError, "#each requires a block"
314
314
  end
315
315
 
316
- add rule(all, &block)
316
+ add rule(all, backtrace: backtrace, &block)
317
317
  end
318
318
 
319
319
  # Wraps output in type
@@ -25,8 +25,13 @@ module Remap
25
25
  end
26
26
 
27
27
  def traced(backtrace)
28
- tap { _1.set_backtrace(backtrace) }
28
+ e = Traced.new(notice: notice)
29
+ e.set_backtrace(backtrace)
30
+ e
29
31
  end
30
32
  end
33
+
34
+ class Traced < Error
35
+ end
31
36
  end
32
37
  end
@@ -23,11 +23,15 @@ module Remap
23
23
  return state.except(:value)
24
24
  end
25
25
 
26
- rules.map do |rule|
27
- rule.call(state) do |failure|
26
+ rules.reduce(state.except(:value)) do |s1, rule|
27
+ result = rule.call(state) do |failure|
28
28
  return error[failure]
29
29
  end
30
- end.reduce(&:combine)
30
+
31
+ s1.combine(result)
32
+ rescue Notice::Fatal => e
33
+ raise e.traced(rule.backtrace)
34
+ end
31
35
  end
32
36
  end
33
37
  end
@@ -132,7 +132,7 @@ module Remap
132
132
  list1 + list2
133
133
  in [:value, left, right]
134
134
  fatal!(
135
- "Could not merge [%p] (%s) with [%p] (%s)",
135
+ "Could not merge [%s] (%s) with [%s] (%s)",
136
136
  left.formatted,
137
137
  left.class,
138
138
  right.formatted,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remap
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.34
4
+ version: 2.2.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Linus Oleander
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-11 00:00:00.000000000 Z
11
+ date: 2021-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport