2009-11-22 04:08:42 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Leiningen < Formula
|
2013-03-02 09:18:43 +00:00
|
|
|
homepage 'https://github.com/technomancy/leiningen'
|
2013-11-19 20:36:07 +00:00
|
|
|
url 'https://github.com/technomancy/leiningen/archive/2.3.4.tar.gz'
|
|
|
|
sha1 '0fdccbc441237a1dde5dd16b5d9edb936c4a8c36'
|
2011-09-17 18:56:16 +00:00
|
|
|
|
2012-04-19 02:37:43 +00:00
|
|
|
head 'https://github.com/technomancy/leiningen.git'
|
2009-11-22 04:08:42 +00:00
|
|
|
|
2013-08-07 04:18:22 +00:00
|
|
|
resource 'jar' do
|
2013-11-19 20:36:07 +00:00
|
|
|
url 'https://leiningen.s3.amazonaws.com/downloads/leiningen-2.3.4-standalone.jar'
|
|
|
|
sha1 '59718bb8553f25b8ca853f57dd259cd81eb16f91'
|
2013-08-07 04:18:22 +00:00
|
|
|
end
|
|
|
|
|
2009-11-22 04:08:42 +00:00
|
|
|
def install
|
2013-08-07 04:18:22 +00:00
|
|
|
libexec.install resource('jar')
|
|
|
|
|
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|
|
2013-08-12 06:06:24 +00:00
|
|
|
s.change_make_var! 'LEIN_JAR', libexec/"leiningen-#{version}-standalone.jar"
|
2013-07-28 08:16:16 +00:00
|
|
|
end
|
2013-08-07 04:18:22 +00:00
|
|
|
|
2013-07-28 08:16:16 +00:00
|
|
|
bin.install "bin/lein-pkg" => 'lein'
|
2013-05-03 18:03:31 +00:00
|
|
|
bash_completion.install 'bash_completion.bash' => 'lein-completion.bash'
|
2013-05-30 18:58:41 +00:00
|
|
|
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
|
|
|
|
(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 :refer :all]))
|
|
|
|
(deftest canary-test
|
|
|
|
(testing "adds-two yields 4 for input of 2"
|
|
|
|
(is (= 4 (adds-two 2)))))
|
|
|
|
EOS
|
|
|
|
system "#{bin}/lein", 'test'
|
|
|
|
end
|
|
|
|
|
2009-11-22 04:08:42 +00:00
|
|
|
end
|