From b6506fb4ea02fbffaa047df46effed1f30b52ff6 Mon Sep 17 00:00:00 2001 From: eregon Date: Sun, 20 Mar 2011 22:37:25 +0100 Subject: use Module#const_get instead of eval * may be a problem if the constant is scoped (like A::B), but this is not the case (const.split('::').inject(Object) { |c, part| c.const_get part } would solve that) * this was noticed in a comment of 9afc85ad but it has disappeared Signed-off-by: Adam Vandenberg --- Library/Homebrew/formula.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library/Homebrew/formula.rb') diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index e394d0f5c..dd4e03261 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -378,7 +378,7 @@ class Formula begin klass_name = self.class_s(name) - klass = eval(klass_name) + klass = Object.const_get klass_name rescue NameError # TODO really this text should be encoded into the exception # and only shown if the UI deems it correct to show it -- cgit v1.2.3