lib/lou/transformer.rb in lou-0.2.1 vs lib/lou/transformer.rb in lou-0.2.2

- old
+ new

@@ -31,11 +31,12 @@ steps.last(total_steps).each do |t| input = t.apply(input) applied_steps += 1 end rescue error_class => e - total_steps == steps.count ? reverse(input, applied_steps) : raise(e) + reverse(input, applied_steps) if total_steps == steps.count + raise e end input end def reverse(output, total_steps = steps.count) @@ -44,10 +45,11 @@ steps.first(total_steps).reverse_each do |t| output = t.reverse(output) reversed_steps += 1 end rescue error_class => e - total_steps == steps.count ? apply(output, reversed_steps) : raise(e) + apply(output, reversed_steps) if total_steps == steps.count + raise e end output end end end