Class: Boshify::UbuntuPackages
- Inherits:
-
Object
- Object
- Boshify::UbuntuPackages
- Defined in:
- lib/boshify/ubuntu_packages.rb
Overview
Ubuntu package source
Instance Attribute Summary collapse
-
#mirror_url ⇒ Object
Returns the value of attribute mirror_url.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ UbuntuPackages
constructor
A new instance of UbuntuPackages.
- #parse(input) ⇒ Object
- #refresh ⇒ Object
- #source_tarball_url(package_name) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ UbuntuPackages
Returns a new instance of UbuntuPackages.
10 11 12 13 14 |
# File 'lib/boshify/ubuntu_packages.rb', line 10 def initialize( = {}) @downloader = [:downloader] @cmd_runner = [:cmd_runner] self.mirror_url = [:mirror_url] || 'http://us.archive.ubuntu.com/ubuntu' end |
Instance Attribute Details
#mirror_url ⇒ Object
Returns the value of attribute mirror_url.
8 9 10 |
# File 'lib/boshify/ubuntu_packages.rb', line 8 def mirror_url @mirror_url end |
Instance Method Details
#parse(input) ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/boshify/ubuntu_packages.rb', line 33 def parse(input) group_package_values( as_a_hash( parse_multiline_values( group_by_whether_pairs( split_key_value_pairs(input))))) end |
#refresh ⇒ Object
20 21 22 23 |
# File 'lib/boshify/ubuntu_packages.rb', line 20 def refresh @all_packages = packages_hash( parse(decompress())) end |
#source_tarball_url(package_name) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/boshify/ubuntu_packages.rb', line 25 def source_tarball_url(package_name) unless @all_packages[package_name] fail PackageNotFoundError, "Package #{package_name} was not found" end pkg = @all_packages[package_name] mirror_url + "#{pkg['Directory']}/#{original_tarball(pkg)}" end |