Sha256: 9c329851fabdb6732689d5f7f7390249c77f10639e060d49e4f8f98a30507cb4
Contents?: true
Size: 767 Bytes
Versions: 14
Compression:
Stored size: 767 Bytes
Contents
# frozen_string_literal: true module Facter module Resolvers class SwVers < BaseResolver # :productname # :productversion # :buildversion # @semaphore = Mutex.new @fact_list ||= {} class << self private def post_resolve(fact_name) @fact_list.fetch(fact_name) { software_version_system_call(fact_name) } end def software_version_system_call(fact_name) output, _status = Open3.capture2('sw_vers') release_info = output.delete("\t").split("\n").map { |e| e.split(':') } result = Hash[*release_info.flatten] result.each { |k, v| @fact_list[k.downcase.to_sym] = v } @fact_list[fact_name] end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems