<commit_before>require 'facter'

# Author: <NAME> <<EMAIL>>
# Idea and address/version mapping comes from
# http://virtwo.blogspot.ch/2010/10/which-esx-version-am-i-running-on.html

Facter.add(:esx_version) do
  confine :virtual => :vmware
  setcode do
    if File::executable?("/usr/sbin/dmidecode")
      result = Facter::Util::Resolution.exec("/usr/sbin/dmidecode 2>&1")
      if result
        begin
          bios_address = /^BIOS Information$.+?Address: (0x[0-9A-F]{5})$/m.match(result)[1]

          case bios_address
            when '0xE8480'
              '2.5'
            when '0xE7C70'
              '3.0'
            when '0xE66C0'
              '3.5'
            when '0xEA550'
              '4.0'
            when '0xEA2E0'
              '4.1'
            when '0xE72C0'
              '5.0'
            when '0xEA0C0'
              '5.1'
            when '0xE9AB0'
              '5.1 update 3'
            when '0xEA050'
              '5.5'
            when '0xE9A40'
              '6.0'
            else
              "unknown, please report #{bios_address}"
          end
        rescue
          'n/a'
        end
      end
    end
  end
end<commit_msg>Adding BIOS address for VM6 Update 2 (ver 3825889)<commit_after>require 'facter'

# Author: <NAME> <<EMAIL>>
# Idea and address/version mapping comes from
# http://virtwo.blogspot.ch/2010/10/which-esx-version-am-i-running-on.html

Facter.add(:esx_version) do
  confine :virtual => :vmware
  setcode do
    if File::executable?("/usr/sbin/dmidecode")
      result = Facter::Util::Resolution.exec("/usr/sbin/dmidecode 2>&1")
      if result
        begin
          bios_address = /^BIOS Information$.+?Address: (0x[0-9A-F]{5})$/m.match(result)[1]

          case bios_address
            when '0xE8480'
              '2.5'
            when '0xE7C70'
              '3.0'
            when '0xE66C0'
              '3.5'
            when '0xEA550'
              '4.0'
            when '0xEA2E0'
              '4.1'
            when '0xE72C0'
              '5.0'
            when '0xEA0C0'
              '5.1'
            when '0xE9AB0'
              '5.1 update 3'
            when '0xEA050'
              '5.5'
            when '0xE9A40'
              '6.0'
            when '0xE99E0'
              '6.0 update 2'
            else
              "unknown, please report #{bios_address}"
          end
        rescue
          'n/a'
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.1226918342224046, 'fraction_numerical': 0.06565449322938038, 'mean_word_length': 1.3065279091769157, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5737849', 'n_tokens_mistral': 892, 'n_tokens_neox': 844, 'n_words': 168}