Modify syntax for readability / consistency
leverage map block and guard clause for readability thx @MikeMcQuaid
This commit is contained in:
parent
a83877660b
commit
dce6b77ad0
@ -37,9 +37,14 @@ class Caveats
|
|||||||
|
|
||||||
if f.plist_manual || f.service?
|
if f.plist_manual || f.service?
|
||||||
command = if f.service?
|
command = if f.service?
|
||||||
f.service.command
|
f.service
|
||||||
.map { |arg| (arg =~ /\s/) ? "'#{arg}'" : arg } # wrap multi-word arguments in quotes
|
.command
|
||||||
.join(" ")
|
.map do |arg|
|
||||||
|
next arg unless arg.match?(/\s/)
|
||||||
|
|
||||||
|
# quote multi-word arguments
|
||||||
|
"'#{arg}'"
|
||||||
|
end.join(" ")
|
||||||
else
|
else
|
||||||
f.plist_manual
|
f.plist_manual
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user