aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorAdam Vandenberg2013-07-08 10:06:26 -0700
committerAdam Vandenberg2013-07-17 06:58:11 -0700
commit49a3570c007dbb7545352721da1e9e15bbe6d6ca (patch)
treecdef23d8a772f4107fc31719a806a6342a724ba5 /Library/Formula
parent527594ca48fe9d3701e3305fee5c467b5ca1b50f (diff)
downloadhomebrew-49a3570c007dbb7545352721da1e9e15bbe6d6ca.tar.bz2
proof-general: use ARGV.value
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/proof-general.rb37
1 files changed, 18 insertions, 19 deletions
diff --git a/Library/Formula/proof-general.rb b/Library/Formula/proof-general.rb
index 331ceb745..225c893ca 100644
--- a/Library/Formula/proof-general.rb
+++ b/Library/Formula/proof-general.rb
@@ -7,32 +7,31 @@ class ProofGeneral < Formula
sha1 'c8d2e4457478b9dbf4080d3cf8255325fcffe619'
option 'with-doc', 'Install HTML documentation'
- option 'with-emacs', 'Re-compile lisp files with specified emacs'
+ option 'with-emacs=', 'Re-compile lisp files with specified emacs'
def which_emacs
- ARGV.each do |a|
- if a.index('--with-emacs=')
- emacs_binary = a.sub('--with-emacs=', '')
- raise "#{emacs_binary} not found" if not File.exists? "#{emacs_binary}"
+ emacs_binary = ARGV.value('with-emacs')
+ if emacs_binary.nil?
+ return OpenStruct.new(
+ :binary => "",
+ :major => 0,
+ :empty? => true)
+ end
- version_info = `#{emacs_binary} --version`
- version_info =~ /GNU Emacs (\d+)\./
- major = $1
+ raise "#{emacs_binary} not found" if not File.exists? "#{emacs_binary}"
- if major != '23' && major != '24'
- raise "Emacs 23.x or 24.x is required; #{major}.x provided."
- end
+ version_info = `#{emacs_binary} --version`
+ version_info =~ /GNU Emacs (\d+)\./
+ major = $1
- return OpenStruct.new(
- :binary => emacs_binary,
- :major => major,
- :empty? => false)
- end
+ if major != '23' && major != '24'
+ raise "Emacs 23.x or 24.x is required; #{major}.x provided."
end
+
return OpenStruct.new(
- :binary => "",
- :major => 0,
- :empty? => true)
+ :binary => emacs_binary,
+ :major => major,
+ :empty? => false)
end
def install