Facter.add(:archive_windir) do
  confine osfamily: :windows
  setcode do
    program_data = `echo %SYSTEMDRIVE%\\ProgramData`.chomp
    if File.directory? program_data
      "#{program_data}\\staging"
    else
      'C:\\staging'
    end
  end
end

Facter.add(:archive_windir) do
  confine :osfamily => :windows # rubocop:disable Style/HashSyntax
  setcode do
    program_data = `echo %SYSTEMDRIVE%\\ProgramData`.chomp
    if File.directory? program_data
      "#{program_data}\\staging"
    else
      'C:\\staging'
    end
  end
end

Make fact confinement ruby 1.8 compatible
Make fact confinement ruby 1.8 compatible

This is useful for people who have both older systems (using ruby 1.8)
and newer in the same puppet environment. They want to use
puppet-archive on their newer OSes, but don't want their old systems to
throw errors when trying to run facter code they don't even care about.

The module is still not useable on ruby 1.8 and ruby 1.8 fixes to the
type/providers will not be accepted on the master branch.
