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?
|
||||
command = if f.service?
|
||||
f.service.command
|
||||
.map { |arg| (arg =~ /\s/) ? "'#{arg}'" : arg } # wrap multi-word arguments in quotes
|
||||
.join(" ")
|
||||
f.service
|
||||
.command
|
||||
.map do |arg|
|
||||
next arg unless arg.match?(/\s/)
|
||||
|
||||
# quote multi-word arguments
|
||||
"'#{arg}'"
|
||||
end.join(" ")
|
||||
else
|
||||
f.plist_manual
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user