Class: Gem::Src::Srv::Fetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/gem/src/srv/fetcher.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(spec) ⇒ Fetcher

Returns a new instance of Fetcher.



11
12
13
# File 'lib/gem/src/srv/fetcher.rb', line 11

def initialize(spec)
  @spec = spec
end

Class Method Details

.tested_repositoriesObject



3
4
5
# File 'lib/gem/src/srv/fetcher.rb', line 3

def self.tested_repositories
  @tested_repositories ||= []
end

Instance Method Details

#fetchObject



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/gem/src/srv/fetcher.rb', line 15

def fetch
  if IRREGULAR_REPOSITORIES.key? spec.name
    return git_clone IRREGULAR_REPOSITORIES[spec.name]
  end

  git_clone(spec.homepage) ||
    git_clone(github_url(spec.homepage)) ||
    git_clone(source_code_uri) ||
    git_clone(homepage_uri) ||
    git_clone(github_url(homepage_uri)) ||
    git_clone(github_organization_uri(spec.name))
end

#tested_repositoriesObject



7
8
9
# File 'lib/gem/src/srv/fetcher.rb', line 7

def tested_repositories
  self.class.tested_repositories
end