Sha256: 852d20c1bfd7aeebc14dc19c037e56397e9d46f7bbf7e74a90e4f51b3cf181ec

Contents?: true

Size: 582 Bytes

Versions: 8

Compression:

Stored size: 582 Bytes

Contents

# frozen_string_literal: true

module Facter
  module Resolvers
    module Macosx
      class DmiBios < BaseResolver
        @fact_list ||= {}

        class << self
          #:model

          private

          def post_resolve(fact_name)
            @fact_list.fetch(fact_name) { read_facts }
          end

          def read_facts
            # OSX only supports the product name
            output = Facter::Core::Execution.execute('sysctl -n hw.model', logger: log)
            @fact_list[:macosx_model] = output&.strip
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
facter-4.0.44 lib/facter/resolvers/macosx/dmi_resolver.rb
facter-4.0.43 lib/facter/resolvers/macosx/dmi_resolver.rb
facter-4.0.42 lib/facter/resolvers/macosx/dmi_resolver.rb
facter-4.0.41 lib/facter/resolvers/macosx/dmi_resolver.rb
facter-4.0.40 lib/facter/resolvers/macosx/dmi_resolver.rb
facter-4.0.39 lib/facter/resolvers/macosx/dmi_resolver.rb
facter-4.0.38 lib/facter/resolvers/macosx/dmi_resolver.rb
facter-4.0.37 lib/facter/resolvers/macosx/dmi_resolver.rb