forked from librariesio/libraries.io
-
Notifications
You must be signed in to change notification settings - Fork 2
/
go.rb
38 lines (32 loc) · 915 Bytes
/
go.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
module PackageManager
class Go < Base
HAS_VERSIONS = false
HAS_DEPENDENCIES = false
BIBLIOTHECARY_SUPPORT = true
URL = 'http://go-search.org/'
COLOR = '#375eab'
def self.package_link(project, version = nil)
"http://go-search.org/view?id=#{project.name}"
end
def self.documentation_url(name, version = nil)
"http://godoc.org/#{name}"
end
def self.install_instructions(project, version = nil)
"go get #{project.name}"
end
def self.project_names
get("http://go-search.org/api?action=packages")
end
def self.project(name)
get("http://go-search.org/api?action=package&id=#{name}")
end
def self.mapping(project)
{
name: project['Package'],
description: project['Synopsis'],
homepage: project['ProjectURL'],
repository_url: "https://#{project['Package']}"
}
end
end
end