aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorAdam Vandenberg2013-07-07 11:51:33 -0700
committerAdam Vandenberg2013-07-17 06:58:11 -0700
commit6b18aec6c53f5b7bf2f08e8934c50f0c264c7caf (patch)
treeb65b226fb4e8258f20ff6f12d4775956f634bf43 /Library/Formula
parent3e1eab105a97259d8c12c39407decdb415564c38 (diff)
downloadhomebrew-6b18aec6c53f5b7bf2f08e8934c50f0c264c7caf.tar.bz2
auctex: use ARGV.value
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/auctex.rb14
1 files changed, 4 insertions, 10 deletions
diff --git a/Library/Formula/auctex.rb b/Library/Formula/auctex.rb
index 2142bdfff..2e7cf886c 100644
--- a/Library/Formula/auctex.rb
+++ b/Library/Formula/auctex.rb
@@ -11,18 +11,12 @@ class Auctex < Formula
depends_on :tex
depends_on :autoconf if build.head?
- def options
- [['--with-emacs=</full/path/to/emacs>', "Force a different emacs"]]
- end
+ option "with-emacs=", "Path to an emacs binary"
def which_emacs
- # check arguments for a different emacs
- ARGV.each do |a|
- if a.index('--with-emacs')
- return a.sub('--with-emacs=', '')
- end
- end
- which('emacs').to_s
+ emacs = ARGV.value('with-emacs') || which('emacs').to_s
+ raise "#{emacs} not found" if not File.exists? emacs
+ return emacs
end
def install