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

Are the two chomps stripping out extra fields in case `use_version` or `@resource[:flavor]` are nil? If that's the case you could call `[...].compact.join('-')`