2011-03-10 05:11:03 +00:00
|
|
|
class Leiningen < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Build tool for Clojure"
|
2014-08-06 04:12:42 +00:00
|
|
|
homepage "https://github.com/technomancy/leiningen"
|
|
|
|
head "https://github.com/technomancy/leiningen.git"
|
2015-08-10 20:12:30 +00:00
|
|
|
url "https://github.com/technomancy/leiningen/archive/2.5.2.tar.gz"
|
|
|
|
sha256 "50cd21d718603bfa4b6da673696c60482271d310f67b98a794d0413a79121a9d"
|
2014-08-06 04:12:42 +00:00
|
|
|
|
2015-08-10 21:32:00 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
|
|
|
sha256 "5c41d3bd528fc99d527d0061d13189d1d4a1b71727ae03e8963d375b007fb49c" => :yosemite
|
|
|
|
sha256 "fbe674b4a26f6f3c9e23ec86707ae2e07489c1a287269650b592727e6ec167ec" => :mavericks
|
|
|
|
sha256 "cb3fdfcf22220913a2222179f4cc220fbb1b6c04a0ba6f37f8750bacbbf7859a" => :mountain_lion
|
|
|
|
end
|
|
|
|
|
2014-08-06 04:12:42 +00:00
|
|
|
resource "jar" do
|
2015-08-10 20:12:30 +00:00
|
|
|
url "https://github.com/technomancy/leiningen/releases/download/2.5.2/leiningen-2.5.2-standalone.zip", :using => :nounzip
|
|
|
|
sha256 "64c70202dc7989de1b9d8b8b9b99e87dbb7698338e24d25722777412e37e1b62"
|
2013-08-07 04:18:22 +00:00
|
|
|
end
|
|
|
|
|
2009-11-22 04:08:42 +00:00
|
|
|
def install
|
2015-01-27 13:46:11 +00:00
|
|
|
jar = "leiningen-#{version}-standalone.jar"
|
|
|
|
resource("jar").stage do
|
|
|
|
libexec.install "leiningen-#{version}-standalone.zip" => jar
|
|
|
|
end
|
2013-08-07 04:18:22 +00:00
|
|
|
|
2013-07-28 08:16:16 +00:00
|
|
|
# bin/lein autoinstalls and autoupdates, which doesn't work too well for us
|
|
|
|
inreplace "bin/lein-pkg" do |s|
|
2015-01-27 13:46:11 +00:00
|
|
|
s.change_make_var! "LEIN_JAR", libexec/jar
|
2013-07-28 08:16:16 +00:00
|
|
|
end
|
2013-08-07 04:18:22 +00:00
|
|
|
|
2014-08-06 04:12:42 +00:00
|
|
|
bin.install "bin/lein-pkg" => "lein"
|
|
|
|
bash_completion.install "bash_completion.bash" => "lein-completion.bash"
|
|
|
|
zsh_completion.install "zsh_completion.zsh" => "_lein"
|
2009-11-22 04:08:42 +00:00
|
|
|
end
|
2010-07-18 22:11:41 +00:00
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
2013-07-28 08:16:16 +00:00
|
|
|
Dependencies will be installed to:
|
2010-07-18 22:11:41 +00:00
|
|
|
$HOME/.m2/repository
|
2013-08-17 11:28:25 +00:00
|
|
|
To play around with Clojure run `lein repl` or `lein help`.
|
2010-07-18 22:11:41 +00:00
|
|
|
EOS
|
|
|
|
end
|
2014-01-01 20:37:53 +00:00
|
|
|
|
|
|
|
test do
|
2014-08-06 04:12:42 +00:00
|
|
|
(testpath/"project.clj").write <<-EOS.undent
|
2014-01-01 20:37:53 +00:00
|
|
|
(defproject brew-test "1.0"
|
|
|
|
:dependencies [[org.clojure/clojure "1.5.1"]])
|
|
|
|
EOS
|
2014-08-06 04:12:42 +00:00
|
|
|
(testpath/"src/brew_test/core.clj").write <<-EOS.undent
|
2014-01-01 20:37:53 +00:00
|
|
|
(ns brew-test.core)
|
2015-01-27 13:46:11 +00:00
|
|
|
(defn adds-two
|
|
|
|
"I add two to a number"
|
|
|
|
[x]
|
|
|
|
(+ x 2))
|
2014-01-01 20:37:53 +00:00
|
|
|
EOS
|
2014-08-06 04:12:42 +00:00
|
|
|
(testpath/"test/brew_test/core_test.clj").write <<-EOS.undent
|
2014-01-01 20:37:53 +00:00
|
|
|
(ns brew-test.core-test
|
|
|
|
(:require [clojure.test :refer :all]
|
2015-01-27 13:46:11 +00:00
|
|
|
[brew-test.core :as t]))
|
2014-01-01 20:37:53 +00:00
|
|
|
(deftest canary-test
|
|
|
|
(testing "adds-two yields 4 for input of 2"
|
2015-01-27 13:46:11 +00:00
|
|
|
(is (= 4 (t/adds-two 2)))))
|
2014-01-01 20:37:53 +00:00
|
|
|
EOS
|
2014-08-06 04:12:42 +00:00
|
|
|
system "#{bin}/lein", "test"
|
2014-01-01 20:37:53 +00:00
|
|
|
end
|
2009-11-22 04:08:42 +00:00
|
|
|
end
|