forked from librariesio/libraries.io
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathshards.rb
29 lines (25 loc) · 778 Bytes
/
shards.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
module PackageManager
class Shards < Base
HAS_VERSIONS = false
HAS_DEPENDENCIES = false
BIBLIOTHECARY_SUPPORT = true
URL = 'https://crystal-shards-registry.herokuapp.com/'
COLOR = '#776791'
def self.package_link(project, version = nil)
"https://crystal-shards-registry.herokuapp.com/shards/#{project.name}"
end
def self.project_names
html = get_html("https://crystal-shards-registry.herokuapp.com/shards")
html.css('.lead a').map(&:text)
end
def self.project(name)
get("https://crystal-shards-registry.herokuapp.com/api/v1/shards/#{name}")
end
def self.mapping(project)
{
:name => project["name"],
:repository_url => repo_fallback(project["url"], nil)
}
end
end
end