diff options
| author | Misty De Meo | 2014-06-02 23:32:42 -0700 |
|---|---|---|
| committer | Misty De Meo | 2014-09-01 19:56:43 -0700 |
| commit | 70cfa78f18a1806e53b44374c0362dc02439425f (patch) | |
| tree | adfe981ae9a8b2aaa6c5b90538af14ce278d4aac /Library/Homebrew/language | |
| parent | 7d1b8643afba1e5d1274f5a2b8c6a7ab6434cd49 (diff) | |
| download | homebrew-70cfa78f18a1806e53b44374c0362dc02439425f.tar.bz2 | |
Add Go language module, resources
This introduces a new GoResource category of resource. GoResources
have a specialized stage method which allows a resource to stage
itself into a gopath.
The new Go language module provides a one-liner to stage all
GoResources present in the formula.
Diffstat (limited to 'Library/Homebrew/language')
| -rw-r--r-- | Library/Homebrew/language/go.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Library/Homebrew/language/go.rb b/Library/Homebrew/language/go.rb new file mode 100644 index 000000000..c0b4fb0a6 --- /dev/null +++ b/Library/Homebrew/language/go.rb @@ -0,0 +1,14 @@ +require "resource" + +module Language + module Go + # Given a set of resources, stages them to a gopath for + # building go software. + # The resource names should be the import name of the package, + # e.g. `resource "github.com/foo/bar"` + def self.stage_deps resources, target + godeps = resources.grep(Resource::Go) + godeps.each {|resource| resource.stage target} + end + end +end |
