(PUP-3604) Rework handling of :ensure with a version

Ogod.

Well, in that case, let's go with something like `thing.gsub(/-+$/, '')`, I think that conveys the intent better than invoking `#chomp` twice.