diff options
| author | Xu Cheng | 2015-12-19 18:37:12 +0800 |
|---|---|---|
| committer | Xu Cheng | 2015-12-19 22:05:30 +0800 |
| commit | 82eb1a4c42f14327471db0e4902192fb4defc87e (patch) | |
| tree | 665ea74199ed6f638392d31b604ae294c70e0200 /Library | |
| parent | 203000cee6432ba95c60db1c98c8fd9a2efa5532 (diff) | |
| download | brew-82eb1a4c42f14327471db0e4902192fb4defc87e.tar.bz2 | |
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.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/formulary.rb | 2 | ||||
| -rw-r--r-- | 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 6b1b7de99..e71656224 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 cef6eed64..86a59faa3 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") |
