From 99850fcbda131cf7ec9699fa306feaa2a97e248f Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Wed, 23 Jan 2013 00:26:26 -0600 Subject: [PATCH] Formula::finalize_dsl --- Library/Homebrew/formula.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index e2fde2ef92..1b65efb463 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