Class: Proxy::Omaha::ReleaseRepository
- Inherits:
-
Object
- Object
- Proxy::Omaha::ReleaseRepository
- Defined in:
- lib/smart_proxy_omaha/release_repository.rb
Instance Attribute Summary collapse
-
#contentpath ⇒ Object
readonly
Returns the value of attribute contentpath.
-
#distribution ⇒ Object
readonly
Returns the value of attribute distribution.
Instance Method Summary collapse
- #architectures(track) ⇒ Object
-
#initialize(options) ⇒ ReleaseRepository
constructor
A new instance of ReleaseRepository.
- #latest_os(track, architecture) ⇒ Object
- #releases(track, architecture) ⇒ Object
- #tracks ⇒ Object
Constructor Details
#initialize(options) ⇒ ReleaseRepository
Returns a new instance of ReleaseRepository.
8 9 10 11 |
# File 'lib/smart_proxy_omaha/release_repository.rb', line 8 def initialize() @contentpath = .fetch(:contentpath) @distribution = .fetch(:distribution) end |
Instance Attribute Details
#contentpath ⇒ Object (readonly)
Returns the value of attribute contentpath.
6 7 8 |
# File 'lib/smart_proxy_omaha/release_repository.rb', line 6 def contentpath @contentpath end |
#distribution ⇒ Object (readonly)
Returns the value of attribute distribution.
6 7 8 |
# File 'lib/smart_proxy_omaha/release_repository.rb', line 6 def distribution @distribution end |
Instance Method Details
#architectures(track) ⇒ Object
30 31 32 |
# File 'lib/smart_proxy_omaha/release_repository.rb', line 30 def architectures(track) Dir.glob(File.join(contentpath, track, '*')).select {|f| File.directory? f }.map { |f| File.basename(f) } end |
#latest_os(track, architecture) ⇒ Object
34 35 36 |
# File 'lib/smart_proxy_omaha/release_repository.rb', line 34 def latest_os(track, architecture) releases(track, architecture).max end |
#releases(track, architecture) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/smart_proxy_omaha/release_repository.rb', line 13 def releases(track, architecture) Dir.glob(File.join(contentpath, track, architecture, '*')).select do |f| File.directory?(f) && ! File.symlink?(f) end.map do |f| Proxy::Omaha::Release.new( :distribution => distribution, :track => track, :architecture => architecture, :version => File.basename(f) ) end end |
#tracks ⇒ Object
26 27 28 |
# File 'lib/smart_proxy_omaha/release_repository.rb', line 26 def tracks Dir.glob(File.join(contentpath, '*')).select {|f| File.directory? f }.map { |f| File.basename(f) } end |