From 82eb1a4c42f14327471db0e4902192fb4defc87e Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Sat, 19 Dec 2015 18:37:12 +0800 Subject: [PATCH] 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. --- Library/Homebrew/formulary.rb | 2 +- Library/Homebrew/test/test_formulary.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 6b1b7de994..e71656224d 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -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 diff --git a/Library/Homebrew/test/test_formulary.rb b/Library/Homebrew/test/test_formulary.rb index cef6eed64c..86a59faa31 100644 --- a/Library/Homebrew/test/test_formulary.rb +++ b/Library/Homebrew/test/test_formulary.rb @@ -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")