Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default values in REFERENCE.md #14

Merged
merged 1 commit into from
Sep 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]`

##### <a name="command"></a>`command`

Expand All @@ -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]`

##### <a name="creates"></a>`creates`

Expand Down Expand Up @@ -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]`

##### <a name="toolchain"></a>`toolchain`

Expand All @@ -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]`

### <a name="rustupglobaltoolchain"></a>`rustup::global::toolchain`

Expand Down Expand Up @@ -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]`

##### <a name="target"></a>`target`

Expand All @@ -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]`

##### <a name="toolchain"></a>`toolchain`

Expand All @@ -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]`

### <a name="rustuptoolchain"></a>`rustup::toolchain`

Expand Down Expand Up @@ -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]`

##### <a name="toolchain"></a>`toolchain`

Expand All @@ -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]`

##### <a name="profile"></a>`profile`

Expand Down
4 changes: 2 additions & 2 deletions manifests/exec.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions manifests/global/target.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions manifests/target.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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 +> [{
Expand Down
4 changes: 2 additions & 2 deletions manifests/toolchain.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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 |> {
Expand Down