module Selenium::WebDriver::FileReaper
@api private
Attributes
Public Class Methods
Source
# File lib/selenium/webdriver/common/file_reaper.rb, line 39 def <<(file) tmp_files << file end
Source
# File lib/selenium/webdriver/common/file_reaper.rb, line 43 def reap(file) return unless reap? raise Error::WebDriverError, "file not added for reaping: #{file.inspect}" unless tmp_files.include?(file) FileUtils.rm_rf tmp_files.delete(file) end
Source
# File lib/selenium/webdriver/common/file_reaper.rb, line 51 def reap! if reap? tmp_files.each { |file| FileUtils.rm_rf(file) } true else false end end
Source
# File lib/selenium/webdriver/common/file_reaper.rb, line 30 def reap? @reap = defined?(@reap) ? @reap : true end
Source
# File lib/selenium/webdriver/common/file_reaper.rb, line 34 def tmp_files @tmp_files ||= Hash.new { |hash, pid| hash[pid] = [] } @tmp_files[Process.pid] end