Method: FetchAndProcess::Base#cache_location

Defined in:
lib/fetch_and_process/base.rb

#cache_locationObject



38
39
40
41
42
43
44
45
# File 'lib/fetch_and_process/base.rb', line 38

def cache_location
  @cache_location ||= begin
    hash = Digest::MD5.hexdigest uri.to_s
    path = "#{Dir.tmpdir}/fetch_and_process"
    Dir.mkdir(path, 0o700) unless File.exist?(path)
    "#{path}/#{hash}"
  end
end