gpm 1.4.0
- use depends_on "go" instead of a custom requirement - clean up the test Closes #2596. Signed-off-by: ilovezfs <ilovezfs@icloud.com>
This commit is contained in:
parent
8d63dca66d
commit
7800fd4115
1 changed files with 8 additions and 30 deletions
|
@ -1,18 +1,8 @@
|
|||
class GoRequirement < Requirement
|
||||
fatal true
|
||||
default_formula "go"
|
||||
satisfy { which "go" }
|
||||
|
||||
def message
|
||||
"Go is required to use gpm."
|
||||
end
|
||||
end
|
||||
|
||||
class Gpm < Formula
|
||||
desc "Barebones dependency manager for Go"
|
||||
homepage "https://github.com/pote/gpm"
|
||||
url "https://github.com/pote/gpm/archive/v1.3.2.tar.gz"
|
||||
sha256 "c79b10c9f13d9cc79f2dcf08323daac86b9bb50cf7b84924ebeb28e98334c0ae"
|
||||
url "https://github.com/pote/gpm/archive/v1.4.0.tar.gz"
|
||||
sha256 "2e213abbb1a12ecb895c3f02b74077d3440b7ae3221b4b524659c2ea9065b02a"
|
||||
|
||||
bottle do
|
||||
cellar :any_skip_relocation
|
||||
|
@ -22,7 +12,7 @@ class Gpm < Formula
|
|||
sha256 "0efe4d9fbd5207cff83169a571c7ddb815b434e99b206fc9989e9a309436451f" => :mountain_lion
|
||||
end
|
||||
|
||||
depends_on GoRequirement
|
||||
depends_on "go"
|
||||
|
||||
def install
|
||||
system "./configure", "--prefix=#{prefix}"
|
||||
|
@ -30,26 +20,14 @@ class Gpm < Formula
|
|||
end
|
||||
|
||||
test do
|
||||
Pathname("Godeps").write "github.com/pote/gpm-testing-package v6.1"
|
||||
|
||||
ENV["GOPATH"] = testpath
|
||||
(testpath/"Godeps").write("github.com/pote/gpm-testing-package v6.1")
|
||||
system bin/"gpm", "install"
|
||||
|
||||
Pathname("go_code.go").write <<-EOS.undent
|
||||
(testpath/"go_code.go").write <<-EOS.undent
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/pote/gpm-testing-package"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Print(gpm_testing_package.Version())
|
||||
}
|
||||
import ("fmt"; "github.com/pote/gpm-testing-package")
|
||||
func main() { fmt.Print(gpm_testing_package.Version()) }
|
||||
EOS
|
||||
|
||||
out = `go run go_code.go`
|
||||
assert_equal "v6.1", out
|
||||
assert_equal 0, $?.exitstatus
|
||||
assert_equal "v6.1", shell_output("go run go_code.go")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue