Puppet Function: snapshotbaseversion

Defined in:
lib/puppet/parser/functions/snapshotbaseversion.rb
Function type:
Ruby 3.x API

Overview

snapshotbaseversion()Any

Returns:

  • (Any)


2
3
4
5
6
7
8
9
10
11
12
13
# File 'lib/puppet/parser/functions/snapshotbaseversion.rb', line 2

newfunction(:snapshotbaseversion, :type => :rvalue) do |args|
  version = args[0]
   # If the version is a Maven snapshot, transform the base version to it's
   # SNAPSHOT indicator
   regex = /^(.*)-[0-9]{8}\.[0-9]{6}-[0-9]+$/
   if version =~ regex
     base_version = regex.match(version)[1] + "-SNAPSHOT"     
   else
     base_version = version
   end
   base_version
end