Inject A Version Number Before A File Extension In Ruby (2 One Liners)
Join the DZone community and get the full member experience.Join For Free
path = path.split('.').insert(-2,@the_version).join('.') # or path.insert(-(File.extname(path).length+1),@the_version)
Opinions expressed by DZone contributors are their own.