-
Notifications
You must be signed in to change notification settings - Fork 205
/
Copy pathswift_pm.rb
30 lines (26 loc) · 915 Bytes
/
swift_pm.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
# frozen_string_literal: true
module PackageManager
class SwiftPM < Base
HAS_VERSIONS = false
HAS_DEPENDENCIES = false
URL = "https://developer.apple.com/swift/"
COLOR = "#ffac45"
def self.project_names
@project_names ||= `rm -rf swift-package-crawler-data;git clone https://github.com/czechboy0/swift-package-crawler-data.git --depth 1; ls swift-package-crawler-data/PackageJSONFiles`.split("\n")
end
def self.project(name)
name_with_owner = name.gsub("-Package.json", "").split("_").join("/")
{
name: "github.com/#{name_with_owner}",
repository_url: "https://github.com/#{name_with_owner}",
}
end
def self.mapping(raw_project)
MappingBuilder.build_hash(
name: raw_project[:name],
description: nil, # TODO: can we get description?
repository_url: raw_project[:repository_url]
)
end
end
end