Refactor FormulaLoader#get_formula.

This commit is contained in:
Markus Reiter 2020-07-30 03:24:37 +02:00
parent 6b0678e8ed
commit 08e35e9cb4

View File

@ -124,8 +124,8 @@ module Formulary
# `alias_path` can be overridden here in case an alias was used to refer to
# a formula that was loaded in another way.
def get_formula(spec, alias_path: nil, force_bottle: false, flags: [])
klass(flags: flags)
.new(name, path, spec, alias_path: alias_path || self.alias_path, force_bottle: force_bottle)
alias_path ||= self.alias_path
klass(flags: flags).new(name, path, spec, alias_path: alias_path, force_bottle: force_bottle)
end
def klass(flags:)