Class: PopCap::AnalyzeFile
- Inherits:
-
Object
- Object
- PopCap::AnalyzeFile
- Defined in:
- lib/pop_cap/analyze_file.rb
Overview
Public: This class is similar to TagReader, but is useful for debugging. If a file cannot be read, this will return the error message generated by FFprobe
Instance Attribute Summary collapse
-
#filepath ⇒ Object
readonly
Returns the value of attribute filepath.
Class Method Summary collapse
-
.examine(filepath) ⇒ Object
Public: A convenience class method for examining a file.
Instance Method Summary collapse
-
#examine ⇒ Object
Public: This method returns the stderr of FFprobe -show_format as an array.
-
#initialize(filepath) ⇒ AnalyzeFile
constructor
Public: Initialize an instance of AnalyzeFile.
Constructor Details
#initialize(filepath) ⇒ AnalyzeFile
Public: Initialize an instance of AnalyzeFile. filepath = relative path to a file on the filesystem
14 15 16 17 |
# File 'lib/pop_cap/analyze_file.rb', line 14 def initialize(filepath) @filepath = File.(filepath) @datetime = Time.now.strftime("%Y-%m-%d at %H:%M:%S") end |
Instance Attribute Details
#filepath ⇒ Object (readonly)
Returns the value of attribute filepath.
9 10 11 |
# File 'lib/pop_cap/analyze_file.rb', line 9 def filepath @filepath end |
Class Method Details
.examine(filepath) ⇒ Object
Public: A convenience class method for examining a file.
29 30 31 |
# File 'lib/pop_cap/analyze_file.rb', line 29 def self.examine(filepath) new(filepath).examine end |
Instance Method Details
#examine ⇒ Object
Public: This method returns the stderr of FFprobe -show_format as an array. The first element is a datetime stamp, the second element is the error message.
23 24 25 |
# File 'lib/pop_cap/analyze_file.rb', line 23 def examine [, error] end |