Give namespace modules a name so formula objects can be marshaled

Fixes Homebrew/homebrew#40311.
This commit is contained in:
Jack Nagel 2015-06-02 20:51:16 -04:00
parent 919698fdde
commit 9516444dfd

View File

@ -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)