Module: Capybara::Playwright::TmpdirOwner
- Included in:
- Browser
- Defined in:
- lib/capybara/playwright/tmpdir_owner.rb
Defined Under Namespace
Classes: TmpdirRemover
Instance Method Summary collapse
Instance Method Details
#remove_tmpdir ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/capybara/playwright/tmpdir_owner.rb', line 14 def remove_tmpdir if @tmpdir FileUtils.remove_entry(@tmpdir, true) ObjectSpace.undefine_finalizer(self) @tmpdir = nil end end |
#tmpdir ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/capybara/playwright/tmpdir_owner.rb', line 6 def tmpdir return @tmpdir if @tmpdir dir = Dir.mktmpdir ObjectSpace.define_finalizer(self, TmpdirRemover.new(dir)) @tmpdir = dir end |