aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorAdam Vandenberg2013-01-23 00:26:26 -0600
committerJack Nagel2013-01-26 12:14:45 -0600
commit2baff20ea862c75002edb7fd6e81edc5401bf8d4 (patch)
tree0c813ff57978641b54fce4055aae677c94a28cde /Library/Homebrew
parentf82ed2f33dede59e6044a5b42e7c5bec6f7bbe26 (diff)
downloadhomebrew-2baff20ea862c75002edb7fd6e81edc5401bf8d4.tar.bz2
Formula::finalize_dsl
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/formula.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index e2fde2ef9..1b65efb46 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -419,6 +419,8 @@ class Formula
raise NameError if !klass.ancestors.include? Formula
+ klass.finalize_dsl
+
return klass.new(name) if install_type == :from_name
return klass.new(name, path.to_s)
rescue NoMethodError
@@ -823,6 +825,11 @@ private
@test_defined = true
@test = block
end
+
+ # This method is called once by `factory` before creating any instances.
+ # It allows the DSL to finalize itself, reducing complexity in the constructor.
+ def finalize_dsl
+ end
end
end