2013-12-27 18:11:49 +00:00
|
|
|
class SufficientlyRecentGit < Requirement
|
|
|
|
fatal true
|
2015-01-11 17:42:20 +00:00
|
|
|
default_formula "git"
|
2013-12-27 18:11:49 +00:00
|
|
|
|
|
|
|
satisfy do
|
2015-01-11 17:42:20 +00:00
|
|
|
system "git stripspace --comment-lines </dev/null 2>/dev/null"
|
2013-12-27 18:11:49 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def message
|
|
|
|
"Your Git is too old. Please upgrade to Git 1.8.2 or newer."
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class GitIntegration < Formula
|
2015-01-11 17:42:20 +00:00
|
|
|
homepage "http://johnkeeping.github.io/git-integration/"
|
|
|
|
url "https://github.com/johnkeeping/git-integration/archive/v0.3.tar.gz"
|
|
|
|
sha1 "fc64f987a2a6b73c61c8a5278d06bcaa46ee9312"
|
2013-12-27 18:11:49 +00:00
|
|
|
|
2015-01-11 17:42:20 +00:00
|
|
|
depends_on "asciidoc" => [:build, :optional]
|
2013-12-27 18:11:49 +00:00
|
|
|
depends_on SufficientlyRecentGit
|
|
|
|
|
|
|
|
def install
|
2015-05-11 00:54:34 +00:00
|
|
|
ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog"
|
2013-12-27 18:11:49 +00:00
|
|
|
(buildpath/"config.mak").write "prefix = #{prefix}"
|
|
|
|
system "make", "install"
|
|
|
|
if build.with? "asciidoc"
|
|
|
|
system "make", "install-doc"
|
|
|
|
end
|
|
|
|
system "make", "install-completion"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
system "git", "init"
|
|
|
|
system "git", "commit", "--allow-empty", "-m", "An initial commit"
|
|
|
|
system "git", "checkout", "-b", "branch-a", "master"
|
|
|
|
system "git", "commit", "--allow-empty", "-m", "A commit on branch-a"
|
|
|
|
system "git", "checkout", "-b", "branch-b", "master"
|
|
|
|
system "git", "commit", "--allow-empty", "-m", "A commit on branch-b"
|
|
|
|
system "git", "checkout", "master"
|
|
|
|
system "git", "integration", "--create", "integration"
|
|
|
|
system "git", "integration", "--add", "branch-a"
|
|
|
|
system "git", "integration", "--add", "branch-b"
|
|
|
|
system "git", "integration", "--rebuild"
|
|
|
|
end
|
|
|
|
end
|