diff --git a/REFERENCE.md b/REFERENCE.md index 810a23a..afd1f55 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -336,7 +336,7 @@ Data type: `String[1]` The user to run as. Automatically set if the `$name` of the resource follows the rules above. -Default value: `(': ')[0]` +Default value: `split($name, ': ')[0]` ##### `command` @@ -345,7 +345,7 @@ Data type: `String[1]` The command to run, e.g. 'rustup default stable'. Automatically set if the `$name` of the resource follows the rules above. -Default value: `(': ')[1]` +Default value: `split($name, ': ')[1]` ##### `creates` @@ -464,7 +464,7 @@ Data type: `String[1]` The name of the target to install, e.g. "sparcv9-sun-solaris". Automatically set if the `$name` of the resource follows the rules above. -Default value: `(' ')[0]` +Default value: `split($name, ' ')[0]` ##### `toolchain` @@ -474,7 +474,7 @@ The name of the toolchain in which to install the target, e.g. "stable". `undef` means the default toolchain. Automatically set if the `$name` of the resource follows the rules above. -Default value: `(' ')[1]` +Default value: `split($name, ' ')[1]` ### `rustup::global::toolchain` @@ -560,7 +560,7 @@ Data type: `String[1]` The name of the `rustup` installation (normally the username). Automatically set if the `$name` of the resource follows the rules above. -Default value: `(': ')[0]` +Default value: `split($name, ': ')[0]` ##### `target` @@ -569,7 +569,7 @@ Data type: `String[1]` The name of the target to install, e.g. "sparcv9-sun-solaris". Automatically set if the `$name` of the resource follows the rules above. -Default value: `(' ')[0]` +Default value: `split(split($name, ': ')[1], ' ')[0]` ##### `toolchain` @@ -579,7 +579,7 @@ The name of the toolchain in which to install the target, e.g. "stable". `undef` means the default toolchain. Automatically set if the `$name` of the resource follows the rules above. -Default value: `(' ')[1]` +Default value: `split(split($name, ': ')[1], ' ')[1]` ### `rustup::toolchain` @@ -617,7 +617,7 @@ Data type: `String[1]` The name of the `rustup` installation (normally the username). Automatically set if the `$name` of the resource follows the rules above. -Default value: `(': ')[0]` +Default value: `split($name, ': ')[0]` ##### `toolchain` @@ -626,7 +626,7 @@ Data type: `String[1]` The name of the toolchain to install, e.g. "stable". Automatically set if the `$name` of the resource follows the rules above. -Default value: `(': ')[1]` +Default value: `split($name, ': ')[1]` ##### `profile` diff --git a/manifests/exec.pp b/manifests/exec.pp index 046e9f4..6bc2aec 100644 --- a/manifests/exec.pp +++ b/manifests/exec.pp @@ -41,8 +41,8 @@ # # [`exec`]: https://puppet.com/docs/puppet/latest/types/exec.html define rustup::exec ( - String[1] $user = $name.split(': ')[0], - String[1] $command = $name.split(': ')[1], + String[1] $user = split($name, ': ')[0], + String[1] $command = split($name, ': ')[1], Optional[String[1]] $creates = undef, Array[String[1]] $environment = [], Rustup::OptionalStringOrArray $onlyif = undef, diff --git a/manifests/global/target.pp b/manifests/global/target.pp index be4746a..b9426e8 100644 --- a/manifests/global/target.pp +++ b/manifests/global/target.pp @@ -18,8 +18,8 @@ # resource follows the rules above. define rustup::global::target ( Enum[present, absent] $ensure = present, - String[1] $target = $name.split(' ')[0], - Optional[String[1]] $toolchain = $name.split(' ')[1], + String[1] $target = split($name, ' ')[0], + Optional[String[1]] $toolchain = split($name, ' ')[1], ) { include rustup::global diff --git a/manifests/target.pp b/manifests/target.pp index 5f2d9f4..ed573c5 100644 --- a/manifests/target.pp +++ b/manifests/target.pp @@ -26,9 +26,9 @@ # resource follows the rules above. define rustup::target ( Enum[present, absent] $ensure = present, - String[1] $rustup = $name.split(': ')[0], - String[1] $target = $name.split(': ')[1].split(' ')[0], - Optional[String[1]] $toolchain = $name.split(': ')[1].split(' ')[1], + String[1] $rustup = split($name, ': ')[0], + String[1] $target = split(split($name, ': ')[1], ' ')[0], + Optional[String[1]] $toolchain = split(split($name, ': ')[1], ' ')[1], ) { Rustup_internal <| title == $rustup |> { targets +> [{ diff --git a/manifests/toolchain.pp b/manifests/toolchain.pp index 63d9153..58d4e4f 100644 --- a/manifests/toolchain.pp +++ b/manifests/toolchain.pp @@ -26,8 +26,8 @@ # it causes an update, i.e. when `ensure => latest` is set. define rustup::toolchain ( Enum[present, latest, absent] $ensure = present, - String[1] $rustup = $name.split(': ')[0], - String[1] $toolchain = $name.split(': ')[1], + String[1] $rustup = split($name, ': ')[0], + String[1] $toolchain = split($name, ': ')[1], Rustup::Profile $profile = 'default', ) { Rustup_internal <| title == $rustup |> {