-
Notifications
You must be signed in to change notification settings - Fork 205
/
Copy pathalcatraz.rb
40 lines (35 loc) · 1016 Bytes
/
alcatraz.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
39
40
# frozen_string_literal: true
module PackageManager
class Alcatraz < Base
HAS_VERSIONS = false
HAS_DEPENDENCIES = false
URL = "http://alcatraz.io"
COLOR = "#438eff"
def self.project_names
projects.keys.sort
end
def self.projects
@projects ||= begin
prjcts = {}
packages = get("https://raw.githubusercontent.com/alcatraz/alcatraz-packages/master/packages.json")["packages"]
packages.each do |category, pkgs|
pkgs.each do |hash|
prjcts[hash["name"].downcase] = hash.slice("name", "url", "description", "screenshot")
prjcts[hash["name"].downcase]["category"] = category
end
end
prjcts
end
end
def self.project(name)
projects[name.downcase]
end
def self.mapping(raw_project)
MappingBuilder.build_hash(
name: raw_project["name"],
description: raw_project["description"],
repository_url: raw_project["url"]
)
end
end
end