mixlib-shellout 3.3.3-x64-mingw-ucrt → 3.3.6-x64-mingw-ucrt
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 +4 -4
- data/lib/mixlib/shellout/helper.rb +12 -5
- data/lib/mixlib/shellout/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 710d00705678cc8dcb2d9b3d5ae03bc634ec804c5485335d8f2f5f578b88e0c2
|
4
|
+
data.tar.gz: a10e9845000ceac048c84b0fe7001a4feb595a0170be08ecaba980e9a1dd9457
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f43f70a7a51239804ca8cd9cd369b09e756573c69d4baaadabe6eaf5be7406f5601d38b3cecb6b1bf407a05ea2e82016dd86bc88c5f396271b52130f5fa6aba
|
7
|
+
data.tar.gz: 04544a4060ed97f9129f34d17d68c2bf798d9f929be6dd9d32213decf9fd0b37006d65b5f63ec032eb565bb6541b01f6b3ea9bf125f7390ce19fddef07199572
|
@@ -143,14 +143,21 @@ module Mixlib
|
|
143
143
|
|
144
144
|
# Join arguments into a string.
|
145
145
|
#
|
146
|
-
#
|
147
|
-
# a space
|
146
|
+
# Strips leading/trailing spaces from each argument. If an argument contains
|
147
|
+
# a space, it is quoted. Join into a single string with spaces between each argument.
|
148
148
|
#
|
149
149
|
# @param args [String] variable number of string arguments
|
150
150
|
# @return [String] merged string
|
151
151
|
#
|
152
|
-
def __join_whitespace(*args)
|
153
|
-
args.
|
152
|
+
def __join_whitespace(*args, quote: false)
|
153
|
+
args.map do |arg|
|
154
|
+
if arg.is_a?(Array)
|
155
|
+
__join_whitespace(*arg, quote: arg.count > 1)
|
156
|
+
else
|
157
|
+
arg = arg.include?(" ") ? sprintf('"%s"', arg) : arg if quote
|
158
|
+
arg.strip
|
159
|
+
end
|
160
|
+
end.join(" ")
|
154
161
|
end
|
155
162
|
|
156
163
|
def __shell_out_command(*args, **options)
|
@@ -165,7 +172,7 @@ module Mixlib
|
|
165
172
|
if options[:input]
|
166
173
|
command.concat "<<'COMMANDINPUT'\n"
|
167
174
|
command.concat __join_whitespace(options[:input])
|
168
|
-
command.concat "
|
175
|
+
command.concat "\nCOMMANDINPUT\n"
|
169
176
|
end
|
170
177
|
end
|
171
178
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mixlib-shellout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.
|
4
|
+
version: 3.3.6
|
5
5
|
platform: x64-mingw-ucrt
|
6
6
|
authors:
|
7
7
|
- Chef Software Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef-utils
|