Class: Repositories::CocoaPods

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

Constant Summary collapse

HAS_VERSIONS =
true
HAS_DEPENDENCIES =
false
LIBRARIAN_SUPPORT =
true
URL =
'http://cocoapods.org/'
COLOR =
'#438eff'

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



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

def self.mapping(project)
  {
    :name => project['name'],
    :description => project["summary"],
    :homepage => project["homepage"],
    :licenses => project['license']['type'],
    :repository_url => repo_fallback(project['source']['git'], '')
  }
end

.project(name) ⇒ Object



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

def self.project(name)
  versions = `ls Specs/Specs/#{name}`.split("\n").sort
  version = versions.last
  json = Oj.load `cat Specs/Specs/#{name}/#{version}/#{name}.podspec.json`
  json.merge('versions' => versions)
end

.project_namesObject



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

def self.project_names
  @project_names ||= `rm -rf Specs;git clone https://github.com/CocoaPods/Specs.git --depth 1; ls Specs/Specs`.split("\n")
end

.versions(project) ⇒ Object



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

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