Extract method RippleCalc::addPath to remove duplicate code.

* It took me four tries to get this right because of the error handling!