aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/formulary.rb
AgeCommit message (Collapse)Author
2016-05-22formulary: fix comment typo.Mike McQuaid
2016-05-08Make bottle code cross-platform.Mike McQuaid
2016-04-17formulary: use FormulaClassUnavailableErrorMartin Afanasjew
Present a more helpful error message if a formula file was loaded, but the class(es) therein didn't match the expected formula class name.
2016-04-02various: Homebrew/core is the core tapXu Cheng
Also make `Homebrew/homebrew` as an alias of this tap to keep backward compatibility.
2016-03-07rename CoreFormulaRepository to CoreTapXu Cheng
Core tap will be separated from core code in the near future. It makes sense to rename it to CoreTap.
2016-02-26various: use Tap abstractionXu Cheng
formula_rename and tap_migrations are now handled inside Tap. Closes Homebrew/homebrew#49549. Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-24TapLoader: improve load logicXu Cheng
* Use `Tap#formula_dir` instead of `Tap#formula_files` to find formula file to have better performance and avoid caching issue. * Change the loader logic to search name -> search alias -> search old name. This is more consistence with what we do when loading core formula file. Closes Homebrew/homebrew#49484. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-12-19move CoreFormulaRepository into separate fileXu Cheng
For users whose local brew is at around 2015-06-11 to 2015-08-06, running `brew update` will emit following error: Error: uninitialized constant Formulary::CoreFormulaRepository This is caused by the same bug described in Homebrew/homebrew#42553. This commit workarounds this issue and restores `brew update` compatibility for users mentioned above. Also cleanup legacy `require "cmd/tap"`.
2015-12-19formulary: use CoreFormulaRepositoryXu Cheng
Let's hide implementation detail on where to find core formulae alias directory. This will benefit future core code and formulae separation.
2015-12-13Formulary: explicitly require tapAlex Dunn
Fixes Homebrew/homebrew#46984.
2015-12-09avoid using FORMULA_RENAMES directlyXu Cheng
2015-12-09Formulary: use same logic to handle core fully-qualified nameXu Cheng
2015-12-09Formulary.core_path: use CoreFormulaRepository#formula_dirXu Cheng
2015-12-09Formulary: use Tap#alias_dirXu Cheng
2015-12-03centralize the logic of handling `homebrew-` in Tap.fetchXu Cheng
Closes Homebrew/homebrew#46537. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-10-10Formulary.from_rack: better formula resolution strategyXu Cheng
The flow is as follow: * If tap is nil(DIY install), search using name. * If tap is found, search using full name. * If tap is found and full name searching failed, search using name. This usually means the formula may be migrated to different tap. Closes Homebrew/homebrew#44771. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-30cache tapsXu Cheng
There are plenty of IO operations inside Tap object, and it will be more when implementing formula alias reverse look up(e.g. list all of alias names for a formula). So let's cache them. Some benchmark: $ time brew info $(brew ruby -e 'puts Formula.tap_names') > /dev/null Before: 6.40s user 2.42s system 96% cpu 9.134 total After: 4.75s user 0.77s system 97% cpu 5.637 total Closes Homebrew/homebrew#44377. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-13support alias for tapXu Cheng
2015-09-06FromUrlLoader: allow file:// schemeXu Cheng
2015-09-06add Formulary.from_contentsXu Cheng
2015-09-06Formulary: allow loading formula from contentsXu Cheng
2015-08-22core file style updateXu Cheng
2015-08-15Formulary.to_rack: follow the symlinkXu Cheng
2015-08-10to_rack: simplify the logicXu Cheng
Closes Homebrew/homebrew#42743. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-10don't use new name rack if old name rack is a dirVlad Shablinsky
Everything that used HOMEBREW_CELLAR/canonical_name could point to something that doesn't exist because loader_for tries to load new name formula if no old name found. However there can be software installed from path with the same name that renamed formulae had and we still need to link/unlink/uninstall etc that software. The solution is Formulary#to_rack method that returns rack for given name. - Add Formulary#to_rack - Update ARGV.kegs - Update cmd/switch
2015-08-10formulary: change logic for renamed formulaeVlad Shablinsky
2015-08-10implement formulary#find_with_priorityCNA-Bld
2015-08-06add fully qualified name for core formulaeCNA-Bld
2015-08-06more core file style updated by rubocopXu Cheng
2015-08-03Core files style updates.BrewTestBot
Closes Homebrew/homebrew#42354. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-02handle mxcl/master synonym inside Tab#from_file_contentXu Cheng
2015-07-31Formulary#from_rack: auto resolve specXu Cheng
2015-07-24BottleLoader: check version mismatchXu Cheng
Closes Homebrew/homebrew#42049. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-07-19improve TapLoader and TapFormulaUnavailableErrorXu Cheng
* Restore the ability to load formula by `user/homebrew-repo/foo`. * Only suggest to install tap when tap isn't installed. Closes Homebrew/homebrew#41705. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-06-12tap_paths: prevent conflicted formulae happen in the same tapXu Cheng
Closes Homebrew/homebrew#40606. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-06-11remove Pathname#find_formulaXu Cheng
Closes Homebrew/homebrew#40486. Signed-off-by: Xu Cheng <xucheng@me.com>
2015-06-08Always treat formula files as UTF-8Jack Nagel
2015-06-02Give namespace modules a name so formula objects can be marshaledJack Nagel
Fixes Homebrew/homebrew#40311.
2015-06-02BottleLoader: use bottle_resolve_formula_namesXu Cheng
2015-06-01Isolate formula class namespacesJack Nagel
Closes Homebrew/homebrew#40151. Closes Homebrew/homebrew#40203.
2015-05-28Formulary: accept mxcl/master as synonym for Homebrew/homebrewMisty De Meo
Fixes Homebrew/homebrew#40171.
2015-05-27Formulary: add from_rackXu Cheng
2015-05-27Formulary#canonical_name: handle TapFormulaAmbiguityErrorXu Cheng
If there are multiple tap formulae with the name of ref, then ref is the canonical name
2015-05-27load tap formula through direct searchXu Cheng
2015-05-27add Formulary.core_path method, deprecate Formula.pathXu Cheng
2015-05-27BottleLoader: using Formulary.path to search formula fileXu Cheng
2015-05-08add Formulary::path methodXu Cheng
This is a little code refactoring splited from Homebrew/homebrew#36753 The idea is to eliminate `Formula#path` outside of `formulary.rb`. And I indent to deprecate `Formula#path` method when I reimplement symlink free tap function. Closes Homebrew/homebrew#39313.
2015-01-03Load formulae into private namespaceJack Nagel
2015-01-01Avoid formula lookup when we know it will failJack Nagel
Formulary.loader_for cannot raise exceptions, as canonical_name must work for nonexistent formulae. However, we can skip the constant lookup and a redundant file existence check by returning a loader that raises immediately in #get_formula.
2015-01-01Get rid of StandardLoader classJack Nagel