forked from librariesio/libraries.io
-
Notifications
You must be signed in to change notification settings - Fork 2
/
julia.rb
42 lines (37 loc) · 1.01 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
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(project, version = nil)
"http://pkg.julialang.org/?pkg=#{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(project)
{
:name => project[:name],
:repository_url => repo_fallback(project[:repository_url], '')
}
end
def self.versions(project)
project['versions'].map do |v|
{
:number => v
}
end
end
end
end