-
Notifications
You must be signed in to change notification settings - Fork 205
/
Copy pathmultiple_sources_base.rb
42 lines (35 loc) · 1.17 KB
/
multiple_sources_base.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
41
42
# frozen_string_literal: true
module PackageManager
class MultipleSourcesBase < Base
HAS_MULTIPLE_REPO_SOURCES = true
HAS_VERSIONS = false
HAS_DEPENDENCIES = false
def self.providers(db_project)
self::PROVIDER_MAP.providers_for(project: db_project).map(&:provider_class)
end
def self.package_link(db_project, version = nil)
self::PROVIDER_MAP
.preferred_provider_for_project(project: db_project, version: version)
.provider_class
.package_link(db_project, version)
end
def self.download_url(db_project, version = nil)
self::PROVIDER_MAP
.preferred_provider_for_project(project: db_project, version: version)
.provider_class
.download_url(db_project, version)
end
def self.check_status_url(db_project)
self::PROVIDER_MAP
.preferred_provider_for_project(project: db_project)
.provider_class
.check_status_url(db_project)
end
def self.repository_base
self::PROVIDER_MAP.default_provider.provider_class.repository_base
end
def self.recent_names
self::PROVIDER_MAP.default_provider.provider_class.recent_names
end
end
end