Class: Download

Inherits:
Object
  • Object
show all
Defined in:
lib/download.rb

Class Method Summary collapse

Class Method Details

.format_name(platform) ⇒ Object


10
11
12
13
# File 'lib/download.rb', line 10

def self.format_name(platform)
  return nil if platform.nil?
  platforms.find{|p| p.to_s.demodulize.downcase == platform.downcase }.to_s.demodulize
end

.new_github_reposObject


15
16
17
# File 'lib/download.rb', line 15

def self.new_github_repos
  Project.undownloaded_repos.order('created_at DESC').find_each(&:update_github_repo_async)
end

.platformsObject


2
3
4
5
6
7
8
# File 'lib/download.rb', line 2

def self.platforms
  @platforms ||= Repositories.constants
    .reject { |platform| platform == :Base }
    .map{|sym| "Repositories::#{sym}".constantize }
    .reject { |platform| platform::HIDDEN }
    .sort_by(&:name)
end

.update_github_reposObject


19
20
21
# File 'lib/download.rb', line 19

def self.update_github_repos
  GithubRepository.order('updated_at ASC').find_each(&:update_all_info_async)
end