Fix format of cask JSON output
This commit is contained in:
parent
7e5addfb22
commit
296dd5ecb2
@ -138,22 +138,24 @@ module Hbc
|
|||||||
"appcast" => appcast,
|
"appcast" => appcast,
|
||||||
"version" => version,
|
"version" => version,
|
||||||
"sha256" => sha256,
|
"sha256" => sha256,
|
||||||
"artifacts" => {},
|
"artifacts" => artifacts.map do |a|
|
||||||
|
if a.methods.include? :to_a
|
||||||
|
a.to_a
|
||||||
|
elsif a.methods.include? :to_h
|
||||||
|
a.to_h
|
||||||
|
else
|
||||||
|
a
|
||||||
|
end
|
||||||
|
end,
|
||||||
"caveats" => caveats,
|
"caveats" => caveats,
|
||||||
"depends_on" => depends_on,
|
"depends_on" => depends_on,
|
||||||
"conflicts_with" => conflicts_with,
|
"conflicts_with" => conflicts_with.to_a,
|
||||||
"container" => container,
|
"container" => container,
|
||||||
"gpg" => gpg,
|
"gpg" => gpg,
|
||||||
"accessibility_access" => accessibility_access,
|
"accessibility_access" => accessibility_access,
|
||||||
"auto_updates" => auto_updates,
|
"auto_updates" => auto_updates,
|
||||||
}
|
}
|
||||||
|
|
||||||
artifacts.each do |a|
|
|
||||||
hsh["artifacts"][a.class.english_name] = a.summarize
|
|
||||||
end
|
|
||||||
|
|
||||||
hsh["conflicts_with"] = [] if hsh["conflicts_with"].nil?
|
|
||||||
|
|
||||||
hsh
|
hsh
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user