From 9516444dfd0092812b6e7a3d592946ddb042e4eb Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Tue, 2 Jun 2015 20:51:16 -0400 Subject: [PATCH] Give namespace modules a name so formula objects can be marshaled Fixes Homebrew/homebrew#40311. --- Library/Homebrew/formulary.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 5e55543d09..b56d190a00 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -1,3 +1,5 @@ +require "digest/md5" + # The Formulary is responsible for creating instances of Formula. # It is not meant to be used directy from formulae. @@ -14,6 +16,7 @@ class Formulary def self.load_formula(name, path) mod = Module.new + const_set("FormulaNamespace#{Digest::MD5.hexdigest(path.to_s)}", mod) mod.module_eval(path.read, path) class_name = class_s(name)