Class: Inspec::Resources::Deb
- Inherits:
-
PkgManagement
- Object
- PkgManagement
- Inspec::Resources::Deb
- Defined in:
- lib/resources/package.rb
Overview
Debian / Ubuntu
Instance Attribute Summary
Attributes inherited from PkgManagement
Instance Method Summary collapse
Methods inherited from PkgManagement
Constructor Details
This class inherits a constructor from Inspec::Resources::PkgManagement
Instance Method Details
#info(package_name) ⇒ Object
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/resources/package.rb', line 83 def info(package_name) cmd = inspec.command("dpkg -s #{package_name}") return nil if cmd.exit_status.to_i != 0 params = SimpleConfig.new( cmd.stdout.chomp, assignment_re: /^\s*([^:]*?)\s*:\s*(.*?)\s*$/, multiple_values: false, ).params { name: params['Package'], installed: true, version: params['Version'], type: 'deb', } end |