formula: add keg_only_reason to formula hash
This commit is contained in:
parent
3373a82d22
commit
00b588068f
@ -1942,6 +1942,7 @@ class Formula
|
||||
"version_scheme" => version_scheme,
|
||||
"bottle" => {},
|
||||
"keg_only" => keg_only?,
|
||||
"keg_only_reason" => keg_only_reason&.to_hash,
|
||||
"bottle_disabled" => bottle_disabled?,
|
||||
"options" => [],
|
||||
"build_dependencies" => dependencies.select(&:build?)
|
||||
|
@ -60,6 +60,19 @@ class KegOnlyReason
|
||||
@reason
|
||||
end.strip
|
||||
end
|
||||
|
||||
def to_hash
|
||||
reason_string = if @reason.is_a?(Symbol)
|
||||
@reason.inspect
|
||||
else
|
||||
@reason.to_s
|
||||
end
|
||||
|
||||
{
|
||||
"reason" => reason_string,
|
||||
"explanation" => @explanation,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
# Used to annotate formulae that don't require compiling or cannot build a bottle.
|
||||
|
Loading…
x
Reference in New Issue
Block a user