ruby-pwsh 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: df8360a152766169ee39b1a3e79909f5e75f1645194f22996eb09246c58d8a79
|
|
4
|
+
data.tar.gz: 9733619df523ed7c6d1af948fe2a75e35d24ac7b723cd610945a3c617c367685
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f7e6afecbbe06c0a78509458e7e178295d57de9d5901b6a448c177a5be4f2ec1361015de97daf8db022a20dcddda3f50ea0dc326234fea71e068809c06c50f02
|
|
7
|
+
data.tar.gz: 964652929914f2aeb579835dec656d56cc8005218b64075daed3bad684a972c45079f00586a0df4f803a9c369431364163c9515542bc0be4ee58cfb07223f269
|
|
@@ -682,16 +682,16 @@ class Puppet::Provider::DscBaseProvider # rubocop:disable Metrics/ClassLength
|
|
|
682
682
|
context.type.attributes.select { |_attribute, properties| properties[:mandatory_for_set] }.keys
|
|
683
683
|
end
|
|
684
684
|
|
|
685
|
-
# Parses the DSC resource type definition to retrieve the names of any attributes which are
|
|
686
|
-
# This is used to ensure that any nil values are converted to empty strings to match puppets
|
|
685
|
+
# Parses the DSC resource type definition to retrieve the names of any attributes which are specified as required strings
|
|
686
|
+
# This is used to ensure that any nil values are converted to empty strings to match puppets expeceted value
|
|
687
687
|
# @param context [Object] the Puppet runtime context to operate in and send feedback to
|
|
688
688
|
# @param data [Hash] the hash of properties returned from the DSC resource
|
|
689
689
|
# @return [Hash] returns a data hash with any nil values converted to empty strings
|
|
690
690
|
def stringify_nil_attributes(context, data)
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
data[
|
|
691
|
+
nil_attributes = data.select { |_name, value| value.nil? }.keys
|
|
692
|
+
nil_attributes.each do |nil_attr|
|
|
693
|
+
attribute_type = context.type.attributes[nil_attr][:type]
|
|
694
|
+
data[nil_attr] = '' if (attribute_type.start_with?('Optional[Enum[', 'Enum[') && enum_values(context, nil_attr).include?('')) || attribute_type == 'String'
|
|
695
695
|
end
|
|
696
696
|
data
|
|
697
697
|
end
|
data/lib/pwsh/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby-pwsh
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Puppet, Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-09-
|
|
11
|
+
date: 2024-09-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: PowerShell code manager for ruby.
|
|
14
14
|
email:
|