aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorAlyssa Ross2016-09-07 23:04:49 +0100
committerAlyssa Ross2016-09-07 23:04:49 +0100
commitd62029f899afacf86f5bf36669251eb2e3421418 (patch)
treecaba6ea27b601f194f8b0cc783d305a42e57da33 /Library/Homebrew
parent9586390418dbcb8655bf7c62bb315c2a2090722e (diff)
downloadbrew-d62029f899afacf86f5bf36669251eb2e3421418.tar.bz2
Explain Tab.create vs Tab.for_formula
This was really confusing to me, and I had to go looking through the Tab history, where I found a comment explaining it that has since been deleted. This wasn't a great experience. This commit basically adds that explanation back in.
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/tab.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb
index cf398fcbf..2c3484f42 100644
--- a/Library/Homebrew/tab.rb
+++ b/Library/Homebrew/tab.rb
@@ -16,6 +16,7 @@ class Tab < OpenStruct
CACHE.clear
end
+ # Instantiates a Tab for a new installation of a formula.
def self.create(formula, compiler, stdlib)
build = formula.build
attributes = {
@@ -110,6 +111,8 @@ class Tab < OpenStruct
options
end
+ # Returns a Tab for an already installed formula,
+ # or a fake one if the formula is not installed.
def self.for_formula(f)
paths = []
@@ -134,6 +137,7 @@ class Tab < OpenStruct
used_options = remap_deprecated_options(f.deprecated_options, tab.used_options)
tab.used_options = used_options.as_flags
else
+ # Formula is not installed. Return a fake tab.
tab = empty
tab.unused_options = f.options.as_flags
tab.source = {