class RuboCop::ResultCache
def self.cache_root(config_store)
def self.cache_root(config_store) root = config_store.for('.').for_all_cops['CacheRootDirectory'] root ||= if ENV.key?('XDG_CACHE_HOME') # Include user ID in the path to make sure the user has write # access. File.join(ENV['XDG_CACHE_HOME'], Process.uid.to_s) else File.join(ENV['HOME'], '.cache') end File.join(root, 'rubocop_cache') end