formulary: use CoreFormulaRepository
Let's hide implementation detail on where to find core formulae alias directory. This will benefit future core code and formulae separation.
This commit is contained in:
parent
203000cee6
commit
82eb1a4c42
@ -276,7 +276,7 @@ class Formulary
|
||||
return FormulaLoader.new(ref, formula_with_that_name)
|
||||
end
|
||||
|
||||
possible_alias = Pathname.new("#{HOMEBREW_LIBRARY}/Aliases/#{ref}")
|
||||
possible_alias = CoreFormulaRepository.instance.alias_dir/ref
|
||||
if possible_alias.file?
|
||||
return AliasLoader.new(possible_alias)
|
||||
end
|
||||
|
||||
@ -69,7 +69,7 @@ class FormularyFactoryTest < Homebrew::TestCase
|
||||
end
|
||||
|
||||
def test_factory_from_alias
|
||||
alias_dir = HOMEBREW_LIBRARY/"Aliases"
|
||||
alias_dir = CoreFormulaRepository.instance.alias_dir
|
||||
alias_dir.mkpath
|
||||
FileUtils.ln_s @path, alias_dir/"foo"
|
||||
assert_kind_of Formula, Formulary.factory("foo")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user