Class: PopCap::TagWriter
- Defined in:
- lib/pop_cap/ffmpeg/tag_writer.rb
Overview
Public: This class wraps FFmpeg to write tags for a specified file.
Instance Attribute Summary
Attributes inherited from FFmpeg
#commander, #filepath, #options
Class Method Summary collapse
-
.write(filepath, options = {}) ⇒ Object
Public: A convenience class method to wrap #new & #write.
Instance Method Summary collapse
-
#write ⇒ Object
Public: This methods writes the tags to a temporary file, if successful, it moves the temporary file over the original.
Methods inherited from FFmpeg
#error_message, #execute, #initialize
Constructor Details
This class inherits a constructor from PopCap::FFmpeg
Class Method Details
.write(filepath, options = {}) ⇒ Object
Public: A convenience class method to wrap #new & #write.
22 23 24 |
# File 'lib/pop_cap/ffmpeg/tag_writer.rb', line 22 def self.write(filepath, = {}) new(filepath, ).write end |
Instance Method Details
#write ⇒ Object
Public: This methods writes the tags to a temporary file, if successful, it moves the temporary file over the original. This is done to prevent corrupting the original file.
12 13 14 15 16 17 18 |
# File 'lib/pop_cap/ffmpeg/tag_writer.rb', line 12 def write unless execute.success? cleanup_failed_write raise(FFmpegError, ('writing')) end FileUtils.move(tmppath, filepath) end |