Sha256: 7e919563dc9d1697305e7ab3ba3f4327a640274425d7e1034bd3d34fa79433bc

Contents?: true

Size: 863 Bytes

Versions: 42

Compression:

Stored size: 863 Bytes

Contents

# frozen_string_literal: true

module Facts
  module Macosx
    module Os
      module Macosx
        class Version
          FACT_NAME = 'os.macosx.version'
          ALIASES = %w[macosx_productversion macosx_productversion_major macosx_productversion_minor].freeze

          def call_the_resolver
            fact_value = Facter::Resolvers::SwVers.resolve(:productversion)
            versions = fact_value.split('.')
            ver = { 'full' => fact_value, 'major' => "#{versions[0]}.#{versions[1]}", 'minor' => versions[-1] }

            [Facter::ResolvedFact.new(FACT_NAME, ver),
             Facter::ResolvedFact.new(ALIASES[0], fact_value, :legacy),
             Facter::ResolvedFact.new(ALIASES[1], ver['major'], :legacy),
             Facter::ResolvedFact.new(ALIASES[2], ver['minor'], :legacy)]
          end
        end
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
facter-4.1.0 lib/facter/facts/macosx/os/macosx/version.rb
facter-4.0.52 lib/facter/facts/macosx/os/macosx/version.rb
facter-4.0.51 lib/facter/facts/macosx/os/macosx/version.rb
facter-4.0.50 lib/facter/facts/macosx/os/macosx/version.rb
facter-4.0.49 lib/facter/facts/macosx/os/macosx/version.rb
facter-4.0.48 lib/facter/facts/macosx/os/macosx/version.rb
facter-4.0.47 lib/facter/facts/macosx/os/macosx/version.rb
facter-4.0.46 lib/facter/facts/macosx/os/macosx/version.rb
facter-4.0.44 lib/facter/facts/macosx/os/macosx/version.rb
facter-4.0.43 lib/facter/facts/macosx/os/macosx/version.rb
facter-4.0.42 lib/facter/facts/macosx/os/macosx/version.rb
facter-4.0.41 lib/facter/facts/macosx/os/macosx/version.rb
facter-4.0.40 lib/facter/facts/macosx/os/macosx/version.rb
facter-4.0.39 lib/facter/facts/macosx/os/macosx/version.rb
facter-4.0.38 lib/facter/facts/macosx/os/macosx/version.rb
facter-4.0.37 lib/facter/facts/macosx/os/macosx/version.rb
facter-4.0.36 lib/facter/facts/macosx/os/macosx/version.rb
facter-4.0.35 lib/facter/facts/macosx/os/macosx/version.rb
facter-4.0.34 lib/facter/facts/macosx/os/macosx/version.rb
facter-4.0.33 lib/facter/facts/macosx/os/macosx/version.rb