Class: PaperclipOptimizer::StdErrCapture
- Inherits:
-
Object
- Object
- PaperclipOptimizer::StdErrCapture
- Defined in:
- lib/paperclip-optimizer.rb
Overview
Helper class for capturing ImageOptims error output and redirecting it to Paperclips logger instance
Instance Method Summary collapse
- #flush ⇒ Object
-
#initialize(logger, log_level = :error) ⇒ StdErrCapture
constructor
A new instance of StdErrCapture.
- #write(string) ⇒ Object (also: #<<)
Constructor Details
#initialize(logger, log_level = :error) ⇒ StdErrCapture
Returns a new instance of StdErrCapture.
24 25 26 27 |
# File 'lib/paperclip-optimizer.rb', line 24 def initialize(logger, log_level = :error) @logger = logger @log_level = log_level end |
Instance Method Details
#flush ⇒ Object
35 |
# File 'lib/paperclip-optimizer.rb', line 35 def flush; end |
#write(string) ⇒ Object Also known as: <<
29 30 31 |
# File 'lib/paperclip-optimizer.rb', line 29 def write(string) @logger.send(@log_level, string) end |