aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/git-hg.rb
diff options
context:
space:
mode:
authorAdam Vandenberg2012-02-29 20:36:21 -0800
committerAdam Vandenberg2012-03-10 09:24:10 -0800
commit939a1bb1cb742361ae8793f81fcfa54f849ee41a (patch)
tree39cc8995bb0f9a74072f87364f969a04153a2848 /Library/Formula/git-hg.rb
parentd5f0cb3c0782d0893ca8397d4f7d8b5781dee9cd (diff)
downloadhomebrew-939a1bb1cb742361ae8793f81fcfa54f849ee41a.tar.bz2
Use new Requirements in formulae
Diffstat (limited to 'Library/Formula/git-hg.rb')
-rw-r--r--Library/Formula/git-hg.rb24
1 files changed, 18 insertions, 6 deletions
diff --git a/Library/Formula/git-hg.rb b/Library/Formula/git-hg.rb
index 153062fee..fac0be430 100644
--- a/Library/Formula/git-hg.rb
+++ b/Library/Formula/git-hg.rb
@@ -1,16 +1,28 @@
require 'formula'
+class HgInstalled < Requirement
+ def message; <<-EOS.undent
+ Mercurial is required to use this software.
+
+ You can install this with Homebrew using:
+ brew install mercurial
+
+ Or you can use an official installer from:
+ http://mercurial.selenic.com/
+ EOS
+ end
+ def satisfied?
+ which 'hg'
+ end
+end
+
class GitHg < Formula
head 'https://github.com/offbytwo/git-hg.git'
homepage 'http://offbytwo.com/git-hg/'
- def install
- unless which 'hg'
- puts "You may need to install Mercurial before using this software:"
- puts " brew install mercurial"
- end
+ depends_on HgInstalled.new
+ def install
prefix.install Dir['*']
end
end
-