class Suppository::DpkgDeb

Attributes

attibutes[R]

Public Class Methods

new(deb_path) click to toggle source
# File lib/suppository/dpkg_deb.rb, line 11
def initialize(deb_path)
  command = CommandRunner.new('dpkg-deb', "-f #{deb_path}")
  @attibutes = parser(command.run)
end

Private Instance Methods

parser(output) click to toggle source
# File lib/suppository/dpkg_deb.rb, line 18
def parser(output)
  attibutes = {}
  output.each_line do |line|
    attibute = parser_line(line)
    attibutes = attibutes.merge(attibute) { |_, first, second| first + second }
  end
  attibutes
end
parser_line(output_line) click to toggle source
# File lib/suppository/dpkg_deb.rb, line 27
def parser_line(output_line)
  DpkgDebLine.new(output_line).attributes
end