-
Notifications
You must be signed in to change notification settings - Fork 202
/
julia.rb
45 lines (39 loc) · 1.18 KB
/
julia.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
43
44
45
# frozen_string_literal: true
module PackageManager
class Julia < Base
HAS_VERSIONS = false
HAS_DEPENDENCIES = false
BIBLIOTHECARY_SUPPORT = true
URL = "http://pkg.julialang.org/"
COLOR = "#a270ba"
def self.package_link(db_project, _version = nil)
"http://pkg.julialang.org/?pkg=#{db_project.name}&ver=release"
end
def self.project_names
@project_names ||= `rm -rf Specs;git clone https://github.com/JuliaLang/METADATA.jl --depth 1; ls METADATA.jl`.split("\n")
end
def self.project(name)
versions = `ls METADATA.jl/#{name}/versions`.split("\n").sort
repository_url = `cat METADATA.jl/#{name}/url`
{
name: name,
versions: versions,
repository_url: repository_url,
}
end
def self.mapping(raw_project)
MappingBuilder.build_hash(
name: raw_project[:name],
description: nil, # TODO: can we get description?
repository_url: repo_fallback(raw_project[:repository_url], "")
)
end
def self.versions(raw_project, _name)
raw_project["versions"].map do |v|
VersionBuilder.build_hash(
number: v
)
end
end
end
end