Class: Repositories::Julia

Inherits:
Base
  • Object
show all
Defined in:
app/models/repositories/julia.rb

Constant Summary collapse

HAS_VERSIONS =
false
HAS_DEPENDENCIES =
false
LIBRARIAN_SUPPORT =
true
URL =
'http://pkg.julialang.org/'
COLOR =
'#a270ba'

Constants inherited from Base

Base::HIDDEN, Base::LIBRARIAN_PLANNED, Base::SECURITY_PLANNED

Class Method Summary collapse

Methods inherited from Base

color, dependencies, download_dependencies, formatted_name, get, get_html, get_json, get_raw, import, import_async, import_new, import_new_async, import_recent, import_recent_async, new_names, package_link, repo_fallback, save, save_dependencies, update

Class Method Details

.mapping(project) ⇒ Object


24
25
26
27
28
29
# File 'app/models/repositories/julia.rb', line 24

def self.mapping(project)
  {
    :name => project[:name],
    :repository_url => repo_fallback(project[:repository_url], '')
  }
end

.project(name) ⇒ Object


13
14
15
16
17
18
19
20
21
22
# File 'app/models/repositories/julia.rb', line 13

def self.project(name)
  versions = `ls METADATA.jl/#{name}/versions`.split("\n").sort
  version = versions.last
  repository_url = `cat METADATA.jl/#{name}/url`
  {
    name: name,
    versions: versions,
    repository_url: repository_url
  }
end

.project_namesObject


9
10
11
# File 'app/models/repositories/julia.rb', line 9

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

.versions(project) ⇒ Object


31
32
33
34
35
36
37
# File 'app/models/repositories/julia.rb', line 31

def self.versions(project)
  project['versions'].map do |v|
    {
      :number => v
    }
  end
end