Skip to content

Release prep v8.0.0 #1203

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

Merged
merged 1 commit into from
Aug 24, 2021
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
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,25 @@

All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).

## [v7.1.0](https://github.com/puppetlabs/puppetlabs-stdlib/tree/v7.1.0) (2021-05-15)
## [v8.0.0](https://github.com/puppetlabs/puppetlabs-stdlib/tree/v8.0.0) (2021-08-24)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-stdlib/compare/v7.1.0...v8.0.0)

### Changed

- Flip installed and present in Function ensure\_packages [\#1196](https://github.com/puppetlabs/puppetlabs-stdlib/pull/1196) ([cocker-cc](https://github.com/cocker-cc))

### Added

- New function to\_python\(\) / to\_ruby\(\) [\#1200](https://github.com/puppetlabs/puppetlabs-stdlib/pull/1200) ([smortex](https://github.com/smortex))
- pdksync - \(IAC-1709\) - Add Support for Debian 11 [\#1199](https://github.com/puppetlabs/puppetlabs-stdlib/pull/1199) ([david22swan](https://github.com/david22swan))
- Stdlib::Http::Method: Add new type for http methods [\#1192](https://github.com/puppetlabs/puppetlabs-stdlib/pull/1192) ([b4ldr](https://github.com/b4ldr))

### Fixed

- \(MODULES-11099\) Make merge parameter data types actually backwards compatible [\#1191](https://github.com/puppetlabs/puppetlabs-stdlib/pull/1191) ([SimonPe](https://github.com/SimonPe))

## [v7.1.0](https://github.com/puppetlabs/puppetlabs-stdlib/tree/v7.1.0) (2021-05-17)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-stdlib/compare/v7.0.1...v7.1.0)

Expand Down
108 changes: 105 additions & 3 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ in a hash.
* [`to_bytes`](#to_bytes): Converts the argument into bytes, for example 4 kB becomes 4096.
* [`to_json`](#to_json): }
* [`to_json_pretty`](#to_json_pretty): Convert data structure and output to pretty JSON
* [`to_python`](#to_python): Convert an object into a String containing its Python representation
* [`to_ruby`](#to_ruby): Convert an object into a String containing its Ruby representation
* [`to_yaml`](#to_yaml): }
* [`try_get_value`](#try_get_value)
* [`type`](#type): **DEPRECATED:** This function will cease to function on Puppet 4;
Expand Down Expand Up @@ -3294,15 +3296,15 @@ $merged_hash = merge($hash1, $hash2) # $merged_hash = {'one' => 1, 'two' => 'do
['a', 'b', 'c', 'c', 'd', 'b', 'blah', 'blah'].merge | $hsh, $v | { if $v =~ String[1,1] { { $v => $hsh[$v].lest || { 0 } + 1 } } } # results in { a => 1, b => 2, c => 2, d => 1 }
```

#### `merge(Variant[Hash, Undef, String[0,0]] *$args)`
#### `merge(Variant[Hash[Scalar,Any], Undef, String[0,0]] *$args)`

The merge function.

Returns: `Hash` The merged hash
Returns: `Hash[Scalar,Any]` The merged hash

##### `*args`

Data type: `Variant[Hash, Undef, String[0,0]]`
Data type: `Variant[Hash[Scalar,Any], Undef, String[0,0]]`

Repeated Param - The hashes that are to be merged

Expand Down Expand Up @@ -4692,6 +4694,106 @@ hash-map of settings passed to JSON.pretty_generate, see
https://ruby-doc.org/stdlib-2.0.0/libdoc/json/rdoc/JSON.html#method-i-generate.
Note that `max_nesting` doesn't take the value `false`; use `-1` instead.

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

Type: Ruby 4.x API

Convert an object into a String containing its Python representation

#### Examples

##### how to output Python

```puppet
# output Python to a file
$listen = '0.0.0.0'
$port = 8000
file { '/opt/acme/etc/settings.py':
content => inline_epp(@("SETTINGS")),
LISTEN = <%= $listen.to_python %>
PORT = <%= $mailserver.to_python %>
| SETTINGS
}
```

#### `to_python(Any $object)`

The to_python function.

Returns: `Any`

##### Examples

###### how to output Python

```puppet
# output Python to a file
$listen = '0.0.0.0'
$port = 8000
file { '/opt/acme/etc/settings.py':
content => inline_epp(@("SETTINGS")),
LISTEN = <%= $listen.to_python %>
PORT = <%= $mailserver.to_python %>
| SETTINGS
}
```

##### `object`

Data type: `Any`



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

Type: Ruby 4.x API

Convert an object into a String containing its Ruby representation

#### Examples

##### how to output Ruby

```puppet
# output Ruby to a file
$listen = '0.0.0.0'
$port = 8000
file { '/opt/acme/etc/settings.rb':
content => inline_epp(@("SETTINGS")),
LISTEN = <%= $listen.to_ruby %>
PORT = <%= $mailserver.to_ruby %>
| SETTINGS
}
```

#### `to_ruby(Any $object)`

The to_ruby function.

Returns: `Any`

##### Examples

###### how to output Ruby

```puppet
# output Ruby to a file
$listen = '0.0.0.0'
$port = 8000
file { '/opt/acme/etc/settings.rb':
content => inline_epp(@("SETTINGS")),
LISTEN = <%= $listen.to_ruby %>
PORT = <%= $mailserver.to_ruby %>
| SETTINGS
}
```

##### `object`

Data type: `Any`



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

Type: Ruby 4.x API
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-stdlib",
"version": "7.1.0",
"version": "8.0.0",
"author": "puppetlabs",
"summary": "Standard library of resources for Puppet modules.",
"license": "Apache-2.0",
Expand Down