If that's a requirement to get the patch accepted then I can, but I disagree that it's a good idea.

1) valid_substitutions? *is* the simplifying method and nested begin / rescue blocks are not really that complicated. I think the code as it currently stands is perfectly clear, so no further simplification is necessary.

2) Your suggestion as it currently stands will always log an error if the first condition is not met, even if the path url is perfectly valid through the other condition. This is obviously undesired behavior. The only way to fix it is to either a) have both conditions be in the same method (as they are currently) or b) pass another argument in to valid_path, a boolean "log_this_error" argument, and have it be false for the first condition and true for the second. But if you do that then you don't actually get much by extracting shared code out into the valid_path? method because the code is not in fact actually shared, you have to take a different path through it in the only two cases the method could possibly be called.

So, I don't see much value in that suggestion, but I can certainly do that if you think it necessary.