diff options
| author | Max Howell | 2009-09-04 15:28:18 +0100 |
|---|---|---|
| committer | Max Howell | 2009-09-16 14:49:06 +0100 |
| commit | 2b22c47ee1e4c69a2feda191c5d33ff68e4d34b8 (patch) | |
| tree | 70f2f270db5001e5401bc46bf253cf96fc306153 /Library/Homebrew/utils.rb | |
| parent | 7240098105fd150d0d28dcf06b79cbfea10d993d (diff) | |
| download | homebrew-2b22c47ee1e4c69a2feda191c5d33ff68e4d34b8.tar.bz2 | |
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.
Diffstat (limited to 'Library/Homebrew/utils.rb')
| -rw-r--r-- | Library/Homebrew/utils.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index ff58aabfd..8606b21fe 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -75,8 +75,8 @@ def safe_system cmd, *args end end -def curl url, *args - safe_system 'curl', '-f#LA', HOMEBREW_USER_AGENT, url, *args +def curl *args + safe_system 'curl', '-f#LA', HOMEBREW_USER_AGENT, *args unless args.empty? end def puts_columns items, cols = 4 |
