lib/cicd/builder/manifest/mixlib/build.rb in manifest-builder-0.5.2 vs lib/cicd/builder/manifest/mixlib/build.rb in manifest-builder-0.5.4
- old
+ new
@@ -68,13 +68,14 @@
@vars[:return_code] = ret
end
VER_RGX = %r'^\d+\.\d+(\.?\d)*$'
MMP_RGX = %r'^(\d+\.?){2,3}$'
+ EXT_RGX = %r'\.*(tar\.gz|tgz|tar.bzip2|bzip2|bz2|jar|war|[a-z]+)$'
# ---------------------------------------------------------------------------------------------------------------
def getVersionBuildFromName(artifact)
version = artifact.dup
- version.gsub!(%r'\.*(tar\.gz|tgz|bzip2|bz2|jar|war|[a-z]+)$', '')
+ version.gsub!(EXT_RGX, '')
version.gsub!(%r'^[a-zA-Z\-._]+', '')
build = ''
if version.match(VER_RGX)
if version.match(%r'\-')
version,build = version.split(/-/)