Allow formulae to use __END__
For this to work the "running script" must be the formulae file. Making this so wasn't so hard, there is now an install.rb script which is included with the -r flag to the ruby executable. An at_exit handler calls the install function. Having the install logic in its own file made it feel like there was so much space that I added extra error handling. So there is something to be said for separating functionality out into its own files. Still the error handling sucks, we'll need to marshall the exception back to the bin/brew command. Which is another PITA. Still overall I think this will prove worthwhile. But if it doesn't we'll revert. As a first usage, you can put a diff after __END__ and return DATA from Formula::patches to make Homebrew aware of it.
Showing
- Library/Homebrew/brew.h.rb 0 additions, 25 deletionsLibrary/Homebrew/brew.h.rb
- Library/Homebrew/formula.rb 22 additions, 7 deletionsLibrary/Homebrew/formula.rb
- Library/Homebrew/global.rb 41 additions, 0 deletionsLibrary/Homebrew/global.rb
- Library/Homebrew/install.rb 78 additions, 0 deletionsLibrary/Homebrew/install.rb
- Library/Homebrew/unittest.rb 1 addition, 1 deletionLibrary/Homebrew/unittest.rb
- Library/Homebrew/utils.rb 2 additions, 2 deletionsLibrary/Homebrew/utils.rb
- bin/brew 9 additions, 55 deletionsbin/brew
Loading
Please register or sign in to comment