Module: Zypper::Upgraderepo::Traversable

Included in:
Requests::HttpRequest, Requests::LocalRequest
Defined in:
lib/zypper/upgraderepo/traversable.rb

Overview

Mixin module that introduces the generic procedures used to traverse the repository path and query the system to discover wheter or not the upgraded folder exists.

Instance Method Summary collapse

Instance Method Details

#traverse_url(uri, version) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/zypper/upgraderepo/traversable.rb', line 12

def traverse_url(uri, version)
  ping(uri)

  if available? && !repodata?(uri)
    return { url: "", message: "This repository doesn't seem working and should be disabled." }
  elsif forbidden?
    res =  { url: url, message: "Can't navigate through the repository!" }
  elsif available? && uri.to_s =~ /#{version}/
    res = traverse_url_forward(uri, version)
  else
    res = traverse_url_backward(uri, version)
  end

  res || { url: "", message: "Can't find a valid alternative, try manually!" }
end