Class: Zypper::Upgraderepo::Requests::HttpRequest

Inherits:
PageRequest
  • Object
show all
Includes:
Traversable
Defined in:
lib/zypper/upgraderepo/requests/http.rb

Overview

This is where the repository pages are scraped and analyzed to find newer versions.

Direct Known Subclasses

DownloadOpensuseOrgRequest

Constant Summary

Constants inherited from PageRequest

PageRequest::USER_AGENT

Instance Attribute Summary

Attributes inherited from PageRequest

#page

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Traversable

#traverse_url

Methods inherited from PageRequest

#available?, #cache!, #forbidden?, #initialize, #not_found?, #redirected?, #redirected_to, #status, #timeout?

Constructor Details

This class inherits a constructor from Zypper::Upgraderepo::PageRequest

Class Method Details

.domainObject



105
106
107
# File 'lib/zypper/upgraderepo/requests/http.rb', line 105

def self.domain
  "default"
end

.register_protocolObject



101
102
103
# File 'lib/zypper/upgraderepo/requests/http.rb', line 101

def self.register_protocol
  %w[https http]
end

Instance Method Details

#evaluate_alternative(version) ⇒ Object



109
110
111
112
113
114
115
# File 'lib/zypper/upgraderepo/requests/http.rb', line 109

def evaluate_alternative(version)
  if not_found?
    traverse_url(URI(url), version)
  elsif redirected?
    { url: redirected_to, message: "Redirected to:" }
  end
end

#max_drop_backObject



97
98
99
# File 'lib/zypper/upgraderepo/requests/http.rb', line 97

def max_drop_back
  0
end