lib/cicd/builder/manifest/mixlib/build.rb in manifest-builder-0.5.4 vs lib/cicd/builder/manifest/mixlib/build.rb in manifest-builder-0.5.5
- old
+ new
@@ -117,13 +117,20 @@
build = version.dup
version = ver
build = build.gsub(%r'^#{version}(\.|-)*','')
end
end
- else
+ else # The whacky cases
build = version.dup
- version = ver
- build = build.gsub(%r'^#{version}(\.|-)*','')
+ if ver =~ %r/\d+\.(\d+\.)*/
+ version = ver
+ build = build.gsub(%r'^#{version}(\.|-)*','')
+ else
+ vra = version.gsub!(%r'^((\d+\.?)+)', '\1').split(/\./)
+ version = vra[0..2].join('.')
+ build = vra[-1]
+ #build = @vars[:build_num]
+ end
end
end
else
if ver.match(VER_RGX)
if ver.match(MMP_RGX)