Class: Katello::Resources::Discovery::Yum

Inherits:
Katello::RepoDiscovery show all
Defined in:
app/lib/katello/resources/discovery/yum.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Katello::RepoDiscovery

class_for, #uri

Methods included from Util::HttpProxy

#proxy, #proxy_host, #proxy_port, #proxy_scheme, #proxy_uri

Constructor Details

#initialize(url, crawled = [], found = [], to_follow = [], upstream_credentials_and_search = { upstream_username: nil, upstream_password: nil, }) ⇒ Yum

rubocop:disable Metrics/ParameterLists



10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/lib/katello/resources/discovery/yum.rb', line 10

def initialize(url, crawled = [], found = [], to_follow = [],
               upstream_credentials_and_search = {
                 upstream_username: nil,
                 upstream_password: nil,
               })
  @uri = uri(url)
  @upstream_username = upstream_credentials_and_search[:upstream_username].presence
  @upstream_password = upstream_credentials_and_search[:upstream_password].presence
  @found = found
  @crawled = crawled
  @to_follow = to_follow
end

Instance Attribute Details

#crawledObject (readonly)

Returns the value of attribute crawled.



7
8
9
# File 'app/lib/katello/resources/discovery/yum.rb', line 7

def crawled
  @crawled
end

#foundObject (readonly)

Returns the value of attribute found.



7
8
9
# File 'app/lib/katello/resources/discovery/yum.rb', line 7

def found
  @found
end

#to_followObject (readonly)

Returns the value of attribute to_follow.



7
8
9
# File 'app/lib/katello/resources/discovery/yum.rb', line 7

def to_follow
  @to_follow
end

Instance Method Details

#run(resume_point) ⇒ Object



23
24
25
26
27
28
29
# File 'app/lib/katello/resources/discovery/yum.rb', line 23

def run(resume_point)
  if @uri.scheme == 'file'
    crawl_file_path(uri(resume_point))
  elsif %w(http https).include?(@uri.scheme)
    spidr_crawl_pages(uri(resume_point))
  end
end