Skip to content
Snippets Groups Projects
Commit 82eb1a4c authored by Xu Cheng's avatar Xu Cheng
Browse files

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.
parent 203000ce
No related branches found
No related tags found
No related merge requests found
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment