This can be written more concisely as `version = versions.join('|') if versions`.