DEV: Update facter usage

DEV: Update facter usage

Facter.reset (https://github.com/puppetlabs/facter-ng/blob/65d167eac93f47dde42ac0476c4f2f676fb07362/lib/facter.rb#L126-L137) clears Facter::Options[:external_dir] which seems to be the 4.x equivalent of Facter::Util::Config.external_facts_dirs.

This commit also makes sure that version 4.0 or higher is installed.

diff --git a/script/bench.rb b/script/bench.rb
index 6d9394e..ce88f40 100644
--- a/script/bench.rb
+++ b/script/bench.rb
@@ -68,10 +68,9 @@ end
 
 begin
   require 'facter'
+  raise LoadError if Gem::Version.new(Facter.version) < Gem::Version.new("4.0")
 rescue LoadError
   run "gem install facter"
-  # Facter requires CFPropertyList, but doesn't install it.
-  run "gem install CFPropertyList"
   puts "please rerun script"
   exit
 end
@@ -286,7 +285,7 @@ begin
 
   # Prevent using external facts because it breaks when running in the
   # discourse/discourse_bench docker container.
-  Facter::Util::Config.external_facts_dirs = []
+  Facter.reset
   facts = Facter.to_hash
 
   facts.delete_if { |k, v|

GitHub sha: 4babdf51