Class: Repositories::Emacs

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

Constant Summary collapse

HAS_VERSIONS =
false
HAS_DEPENDENCIES =
false
URL =
'http://melpa.org'
COLOR =
'#c065db'

Constants inherited from Base

Base::HIDDEN, Base::LIBRARIAN_PLANNED, Base::LIBRARIAN_SUPPORT, 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



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

def self.mapping(project)
  {
    :name => project["name"],
    :description => project["desc"],
    :repository_url => project.fetch("props", {}).try(:fetch, 'url', ''),
    :keywords_array => Array.wrap(project.fetch("props", {}).try(:fetch, 'keywords', []))
  }
end

.project(name) ⇒ Object



16
17
18
# File 'app/models/repositories/emacs.rb', line 16

def self.project(name)
  projects[name].merge({"name" => name})
end

.project_namesObject



8
9
10
# File 'app/models/repositories/emacs.rb', line 8

def self.project_names
  projects.keys.sort
end

.projectsObject



12
13
14
# File 'app/models/repositories/emacs.rb', line 12

def self.projects
  @projects ||= get("http://melpa.org/archive.json")
end