Class: Repositories::Inqlude

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

Constant Summary collapse

HAS_VERSIONS =
false
HAS_DEPENDENCIES =
false
LIBRARIAN_SUPPORT =
false
URL =
'https://inqlude.org/'
COLOR =
'#f34b7d'

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


19
20
21
22
23
24
25
26
27
# File 'app/models/repositories/inqlude.rb', line 19

def self.mapping(project)
  {
    :name => project['name'],
    :description => project["summary"],
    :homepage => project["urls"]["homepage"],
    :licenses => project['licenses'].join(','),
    :repository_url => repo_fallback(project["urls"]["vcs"], '')
  }
end

.project(name) ⇒ Object


13
14
15
16
17
# File 'app/models/repositories/inqlude.rb', line 13

def self.project(name)
  versions = `ls inqlude-data/#{name}`.split("\n").sort
  version = versions.last
  json = Oj.load `cat inqlude-data/#{name}/#{version}`
end

.project_namesObject


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

def self.project_names
  @project_names ||= `rm -rf inqlude-data;git clone https://github.com/cornelius/inqlude-data.git --depth 1; ls -l inqlude-data/ | grep "^d" | awk -F" " '{print $9}'`.split("\n")
end