Formulary.from_rack: better formula resolution strategy
Formulary.from_rack: better formula resolution strategy

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 <9a05244150b861e40c78843b801eed71bca54eac@me.com>

mahori/brew,vitorgalvao/brew,jmsundar/brew,muellermartin/dist,reelsense/brew,palxex/brew,maxim-belkin/brew,maxim-belkin/brew,mgrimes/brew,Homebrew/brew,claui/brew,amar-laksh/brew_sudo,amar-laksh/brew_sudo,aw1621107/brew,nandub/brew,mahori/brew,vitorgalvao/brew,zmwangx/brew,aw1621107/brew,Homebrew/brew,AnastasiaSulyagina/brew,nandub/brew,rwhogg/brew,mahori/brew,Homebrew/brew,bfontaine/brew,konqui/brew,gregory-nisbet/brew,gordonmcshane/homebrew,reitermarkus/brew,sjackman/homebrew,DomT4/brew,muellermartin/dist,palxex/brew,MikeMcQuaid/brew,amar-laksh/brew_sudo,tonyg/homebrew,mistydemeo/homebrew,JCount/brew,tonyg/homebrew,EricFromCanada/brew,pseudocody/brew,EricFromCanada/brew,DomT4/brew,claui/brew,toonetown/homebrew,muellermartin/dist,claui/brew,reitermarkus/brew,DomT4/brew,toonetown/homebrew,JCount/brew,Homebrew/brew,alyssais/brew,Linuxbrew/brew,reitermarkus/brew,vitorgalvao/brew,sjackman/homebrew,sjackman/homebrew,gordonmcshane/homebrew,reitermarkus/brew,ilovezfs/brew,hanxue/linuxbrew,DomT4/brew,staticfloat/brew,EricFromCanada/brew,alyssais/brew,konqui/brew,konqui/brew,MikeMcQuaid/brew,alyssais/brew,Linuxbrew/brew,hanxue/linuxbrew,mistydemeo/homebrew,MikeMcQuaid/brew,mgrimes/brew,bfontaine/brew,staticfloat/brew,jmsundar/brew,rwhogg/brew,mgrimes/brew,rwhogg/brew,gregory-nisbet/brew,nandub/brew,palxex/brew,maxim-belkin/brew,Linuxbrew/brew,sjackman/homebrew,mistydemeo/homebrew,Linuxbrew/brew,mahori/brew,konqui/brew,vitorgalvao/brew,gordonmcshane/homebrew,AnastasiaSulyagina/brew,pseudocody/brew,aw1621107/brew,toonetown/homebrew,gregory-nisbet/brew,EricFromCanada/brew,nandub/brew,hanxue/linuxbrew,tonyg/homebrew,staticfloat/brew,MikeMcQuaid/brew,zmwangx/brew,AnastasiaSulyagina/brew,claui/brew,JCount/brew,zmwangx/brew,reelsense/brew,ilovezfs/brew,JCount/brew,bfontaine/brew,jmsundar/brew,ilovezfs/brew,reelsense/brew,pseudocody/brew