Fix rake task pattern regression

Fixes #1691.