remap 2.2.37 → 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: e0c1f52a49e1b423fdf9e5eb2ffc98da0b4ba1941d6243998e033d30d4aae344
4
- data.tar.gz: f9c476e98e76f6e9fd82a6df8ffdf42ad20e15db775b5108346e94ab44956e01
3
+ metadata.gz: 8fdfe8ed64a781f1239e1738a2e71b99acc864e60508353fc7d22c848b128cbb
4
+ data.tar.gz: 654613c35e8d8294a94f748ca170da5bd19199dc66ba33c8ec055333e1deaf98
5
5
  SHA512:
6
- metadata.gz: 3f8db44f46bc9ec9e5b286213f34dedd05d0d8d39d816eb367d62712591eb901bd09e1534710de153ce4e776e53b2e6bad53aa7cdcc8cf5c7f3fb94b0ed8c25e
7
- data.tar.gz: 1eb289f6d77f57b8d2c5e5396e2d2c727bfdce97fa5a8878a89b69f2d52c5a1e59262a33e6cf8a7ae23dbf1870f4b1c59f28cbe03d2499e88a4051a0b4d1c250
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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remap
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.37
4
+ version: 2.2.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Linus Oleander