Class: Repositories::Shards

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

Constant Summary collapse

HAS_VERSIONS =
false
HAS_DEPENDENCIES =
false
LIBRARIAN_SUPPORT =
true
URL =
'https://crystal-shards-registry.herokuapp.com/'
COLOR =
'#776791'

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



18
19
20
21
22
23
# File 'app/models/repositories/shards.rb', line 18

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

.project(name) ⇒ Object



14
15
16
# File 'app/models/repositories/shards.rb', line 14

def self.project(name)
  get("https://crystal-shards-registry.herokuapp.com/api/v1/shards/#{name}")
end

.project_namesObject



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

def self.project_names
  html = get_html("https://crystal-shards-registry.herokuapp.com/shards")
  html.css('.lead a').map(&:text)
end