Improve format of git cask info --json output
This commit is contained in:
parent
2d5ae645d9
commit
0bfc6bd490
@ -26,6 +26,10 @@ module Hbc
|
||||
abstract_phase(self.class.uninstall_dsl_key)
|
||||
end
|
||||
|
||||
def summarize
|
||||
directives.keys.map(&:to_s).join(", ")
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def class_for_dsl_key(dsl_key)
|
||||
@ -37,10 +41,6 @@ module Hbc
|
||||
return if (block = directives[dsl_key]).nil?
|
||||
class_for_dsl_key(dsl_key).new(cask).instance_eval(&block)
|
||||
end
|
||||
|
||||
def summarize
|
||||
directives.keys.map(&:to_s).join(", ")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -138,7 +138,7 @@ module Hbc
|
||||
"appcast" => appcast,
|
||||
"version" => version,
|
||||
"sha256" => sha256,
|
||||
"artifacts" => artifacts,
|
||||
"artifacts" => {},
|
||||
"caveats" => caveats,
|
||||
"depends_on" => depends_on,
|
||||
"conflicts_with" => conflicts_with,
|
||||
@ -148,6 +148,12 @@ module Hbc
|
||||
"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
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user