Module: Selenium::WebDriver::FileReaper

Defined in:
lib/selenium/webdriver/file_reaper.rb

Class Method Summary collapse

Class Method Details

.<<(file) ⇒ Object



19
20
21
# File 'lib/selenium/webdriver/file_reaper.rb', line 19

def <<(file)
  tmp_files << file
end

.reap!Object



23
24
25
# File 'lib/selenium/webdriver/file_reaper.rb', line 23

def reap!
  tmp_files.each { |file| FileUtils.rm_rf(file) } if reap?
end

.reap=(bool) ⇒ Object



6
7
8
# File 'lib/selenium/webdriver/file_reaper.rb', line 6

def reap=(bool)
  @reap = bool
end

.reap?Boolean

Returns:

  • (Boolean)


10
11
12
13
# File 'lib/selenium/webdriver/file_reaper.rb', line 10

def reap?
  @reap = true unless defined?(@reap)
  !!@reap
end

.tmp_filesObject



15
16
17
# File 'lib/selenium/webdriver/file_reaper.rb', line 15

def tmp_files
  @tmp_files ||= []
end