Merge pull request #3954 from MikeMcQuaid/cleanup-tab
tab: cleanup various methods.
This commit is contained in:
commit
15f01bdd14
@ -38,12 +38,12 @@ class Tab < OpenStruct
|
||||
end,
|
||||
"source" => {
|
||||
"path" => formula.specified_path.to_s,
|
||||
"tap" => formula.tap ? formula.tap.name : nil,
|
||||
"tap" => formula.tap&.name,
|
||||
"spec" => formula.active_spec_sym.to_s,
|
||||
"versions" => {
|
||||
"stable" => formula.stable ? formula.stable.version.to_s : nil,
|
||||
"devel" => formula.devel ? formula.devel.version.to_s : nil,
|
||||
"head" => formula.head ? formula.head.version.to_s : nil,
|
||||
"stable" => formula.stable&.version.to_s,
|
||||
"devel" => formula.devel&.version.to_s,
|
||||
"head" => formula.head&.version.to_s,
|
||||
"version_scheme" => formula.version_scheme,
|
||||
},
|
||||
},
|
||||
@ -66,7 +66,7 @@ class Tab < OpenStruct
|
||||
attributes["source"] ||= {}
|
||||
|
||||
tapped_from = attributes["tapped_from"]
|
||||
unless tapped_from.nil? || tapped_from == "path or URL"
|
||||
if !tapped_from.nil? && tapped_from != "path or URL"
|
||||
attributes["source"]["tap"] = attributes.delete("tapped_from")
|
||||
end
|
||||
|
||||
@ -156,12 +156,12 @@ class Tab < OpenStruct
|
||||
tab.unused_options = f.options.as_flags
|
||||
tab.source = {
|
||||
"path" => f.specified_path.to_s,
|
||||
"tap" => f.tap ? f.tap.name : f.tap,
|
||||
"tap" => f.tap&.name,
|
||||
"spec" => f.active_spec_sym.to_s,
|
||||
"versions" => {
|
||||
"stable" => f.stable ? f.stable.version.to_s : nil,
|
||||
"devel" => f.devel ? f.devel.version.to_s : nil,
|
||||
"head" => f.head ? f.head.version.to_s : nil,
|
||||
"stable" => f.stable&.version.to_s,
|
||||
"devel" => f.devel&.version.to_s,
|
||||
"head" => f.head&.version.to_s,
|
||||
"version_scheme" => f.version_scheme,
|
||||
},
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user