Class: Inspec::Resources::Brew
- Inherits:
-
PkgManagement
- Object
- PkgManagement
- Inspec::Resources::Brew
- Defined in:
- lib/resources/package.rb
Overview
MacOS / Darwin implementation
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
136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/resources/package.rb', line 136 def info(package_name) cmd = inspec.command("brew info --json=v1 #{package_name}") return nil if cmd.exit_status.to_i != 0 # parse data pkg = JSON.parse(cmd.stdout)[0] { name: pkg.name.to_s, installed: true, version: pkg.installed.version.to_s, type: 'brew', } end |