homebrew-core/Formula/leiningen.rb
Baptiste Fontaine ce6c4abf69 leiningen 2.5.1
Closes Homebrew/homebrew#36275.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-01-27 15:17:11 +00:00

57 lines
1.8 KiB
Ruby

class Leiningen < Formula
homepage "https://github.com/technomancy/leiningen"
head "https://github.com/technomancy/leiningen.git"
url "https://github.com/technomancy/leiningen/archive/2.5.1.tar.gz"
sha1 "4f6e2e189be0a163f400c3a8060896285fe731f7"
resource "jar" do
url "https://github.com/technomancy/leiningen/releases/download/2.5.1/leiningen-2.5.1-standalone.zip", :using => :nounzip
sha1 "1c526e6573713b0635a1f2d52502ffa04ae45383"
end
def install
jar = "leiningen-#{version}-standalone.jar"
resource("jar").stage do
libexec.install "leiningen-#{version}-standalone.zip" => jar
end
# bin/lein autoinstalls and autoupdates, which doesn't work too well for us
inreplace "bin/lein-pkg" do |s|
s.change_make_var! "LEIN_JAR", libexec/jar
end
bin.install "bin/lein-pkg" => "lein"
bash_completion.install "bash_completion.bash" => "lein-completion.bash"
zsh_completion.install "zsh_completion.zsh" => "_lein"
end
def caveats; <<-EOS.undent
Dependencies will be installed to:
$HOME/.m2/repository
To play around with Clojure run `lein repl` or `lein help`.
EOS
end
test do
(testpath/"project.clj").write <<-EOS.undent
(defproject brew-test "1.0"
:dependencies [[org.clojure/clojure "1.5.1"]])
EOS
(testpath/"src/brew_test/core.clj").write <<-EOS.undent
(ns brew-test.core)
(defn adds-two
"I add two to a number"
[x]
(+ x 2))
EOS
(testpath/"test/brew_test/core_test.clj").write <<-EOS.undent
(ns brew-test.core-test
(:require [clojure.test :refer :all]
[brew-test.core :as t]))
(deftest canary-test
(testing "adds-two yields 4 for input of 2"
(is (= 4 (t/adds-two 2)))))
EOS
system "#{bin}/lein", "test"
end
end