Class: Facter::Util::Macosx::SystemProfileExecutor

Inherits:
Object
  • Object
show all
Defined in:
lib/facter/util/macosx/system_profile_executor.rb

Overview

Since:

  • 2.0.0

Class Method Summary collapse

Class Method Details

.execute(category_name) ⇒ Object

Since:

  • 2.0.0



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/facter/util/macosx/system_profile_executor.rb', line 10

def execute(category_name)
  @log.debug "Executing command: system_profiler #{category_name}"
  output = Facter::Core::Execution.execute(
    "system_profiler #{category_name}", logger: @log
  )&.force_encoding('UTF-8')

  return unless output

  system_profiler_hash = output_to_hash(output)

  normalize_keys(system_profiler_hash)
end