Sha256: c83af5ed31a97872440f57da45532f3b710dabaf89b884ffe1b757ec7d6e61c1

Contents?: true

Size: 1.23 KB

Versions: 53

Compression:

Stored size: 1.23 KB

Contents

# Fact: macosx
#
# Purpose:
#   Returns a number of Mac specific facts, from system profiler and
#   sw_vers.
#
# Resolution:
#   Uses util/macosx.rb to do the fact reconnaissance, then outputs them
#   preceded by 'sp_'
#
# Caveats:
#

#
# macosx.rb
# Additional Facts coming from Mac OS X system_profiler command
#
# Copyright (C) 2007 Jeff McCune
# Author: Jeff McCune <jeff.mccune@northstarlabs.net>
#
# Jeff McCune
# There's a lot more information coming out of system_profiler -xml
# We could add quite a bit more, but I didn't want to overload facter
# at this point in time.
# In particular, Installed Software might be an interesting addition.

require 'facter/util/macosx'

if Facter.value(:kernel) == "Darwin"
  Facter::Util::Macosx.hardware_overview.each do |fact, value|
    Facter.add("sp_#{fact}") do
      confine :kernel => :darwin
      setcode do
        value.to_s
      end
    end
  end

  Facter::Util::Macosx.os_overview.each do |fact, value|
    Facter.add("sp_#{fact}") do
      confine :kernel => :darwin
      setcode do
        value.to_s
      end
    end
  end

  Facter::Util::Macosx.sw_vers.each do |fact, value|
    Facter.add(fact) do
      confine :kernel => :darwin
      setcode do
        value
      end
    end
  end
end

Version data entries

53 entries across 53 versions & 3 rubygems

Version Path
facter-1.7.6 lib/facter/macosx.rb
facter-1.7.5 lib/facter/macosx.rb
facter-1.7.5.rc2 lib/facter/macosx.rb
facter-1.7.5.rc1 lib/facter/macosx.rb
facter-1.7.4 lib/facter/macosx.rb
facter-1.7.4.rc1 lib/facter/macosx.rb
facter-1.7.3 lib/facter/macosx.rb
facter-1.7.3.rc1 lib/facter/macosx.rb
facter-1.7.2 lib/facter/macosx.rb
facter-1.7.2.rc1 lib/facter/macosx.rb
facter-1.7.1 lib/facter/macosx.rb
facter-1.7.1.rc1 lib/facter/macosx.rb
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/facter-1.6.17/lib/facter/macosx.rb
facter-1.7.0 lib/facter/macosx.rb
facter-1.7.0.rc2 lib/facter/macosx.rb
facter-1.7.0.rc1 lib/facter/macosx.rb
facter-1.6.18 lib/facter/macosx.rb
facter-1.6.18.rc1 lib/facter/macosx.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/facter-1.6.17/lib/facter/macosx.rb
facter-1.6.17 lib/facter/macosx.rb