Class: Octodown::Support::PersistentTempfile
- Inherits:
-
Tempfile
- Object
- Tempfile
- Octodown::Support::PersistentTempfile
- Defined in:
- lib/octodown/support/persistent_tempfile.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.create(content, ext) ⇒ Object
7 8 9 10 |
# File 'lib/octodown/support/persistent_tempfile.rb', line 7 def self.create(content, ext) document = new ['octodown', ".#{ext}"] document.persistent_write content end |
Instance Method Details
#persist ⇒ Object
12 13 14 15 |
# File 'lib/octodown/support/persistent_tempfile.rb', line 12 def persist ObjectSpace.undefine_finalizer self self end |
#persistent_write(content) ⇒ Object
17 18 19 20 21 |
# File 'lib/octodown/support/persistent_tempfile.rb', line 17 def persistent_write(content) write content close persist end |