Class: Proxy::Omaha::ReleaseProvider
- Inherits:
-
Object
- Object
- Proxy::Omaha::ReleaseProvider
- Includes:
- Log, HttpShared
- Defined in:
- lib/smart_proxy_omaha/release_provider.rb
Instance Attribute Summary collapse
-
#architecture ⇒ Object
readonly
Returns the value of attribute architecture.
-
#distribution ⇒ Object
readonly
Returns the value of attribute distribution.
-
#track ⇒ Object
readonly
Returns the value of attribute track.
Instance Method Summary collapse
- #fetch_releases ⇒ Object
-
#initialize(options) ⇒ ReleaseProvider
constructor
A new instance of ReleaseProvider.
- #releases ⇒ Object
Methods included from HttpShared
Constructor Details
#initialize(options) ⇒ ReleaseProvider
Returns a new instance of ReleaseProvider.
12 13 14 15 16 |
# File 'lib/smart_proxy_omaha/release_provider.rb', line 12 def initialize() @track = .fetch(:track) @architecture = .fetch(:architecture, 'amd64-usr') @distribution = .fetch(:distribution) end |
Instance Attribute Details
#architecture ⇒ Object (readonly)
Returns the value of attribute architecture.
10 11 12 |
# File 'lib/smart_proxy_omaha/release_provider.rb', line 10 def architecture @architecture end |
#distribution ⇒ Object (readonly)
Returns the value of attribute distribution.
10 11 12 |
# File 'lib/smart_proxy_omaha/release_provider.rb', line 10 def distribution @distribution end |
#track ⇒ Object (readonly)
Returns the value of attribute track.
10 11 12 |
# File 'lib/smart_proxy_omaha/release_provider.rb', line 10 def track @track end |
Instance Method Details
#fetch_releases ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/smart_proxy_omaha/release_provider.rb', line 22 def fetch_releases releases = distribution.releases(track, architecture) release_objects = releases.map do |version| Proxy::Omaha::Release.new(:distribution => distribution, :version => version, :track => track, :architecture => architecture) end.sort logger.debug "Fetched releases for #{architecture}/#{track}: #{release_objects.map(&:to_s).join(', ')}" release_objects end |
#releases ⇒ Object
18 19 20 |
# File 'lib/smart_proxy_omaha/release_provider.rb', line 18 def releases @releases ||= fetch_releases end |