class RuboCop::ResultCache

def rubocop_checksum

The checksum of the rubocop program running the inspection.
def rubocop_checksum
  ResultCache.source_checksum ||=
    begin
      lib_root = File.join(File.dirname(__FILE__), '..')
      exe_root = File.join(lib_root, '..', 'exe')
      # These are all the files we have `require`d plus everything in the
      # exe directory. A change to any of them could affect the cop output
      # so we include them in the cache hash.
      source_files = $LOADED_FEATURES + Find.find(exe_root).to_a
      sources = source_files
                .select { |path| File.file?(path) }
                .sort
                .map { |path| IO.read(path, encoding: Encoding::UTF_8) }
      Digest::MD5.hexdigest(sources.join)
    end
end