Class: Paperclip::FileCommandContentTypeDetector Deprecated

Inherits:
Object
  • Object
show all
Defined in:
lib/paperclip/file_command_content_type_detector.rb

Overview

Deprecated.

Will be removed in Paperclip 8.0. Use Paperclip::ContentTypeDetector instead.

Constant Summary collapse

SENSIBLE_DEFAULT =
Deprecated.

Will be removed in Paperclip 8.0.

"application/octet-stream"

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ FileCommandContentTypeDetector

Deprecated.

Will be removed in Paperclip 8.0. Use Paperclip::ContentTypeDetector instead.

Returns a new instance of FileCommandContentTypeDetector.



10
11
12
13
# File 'lib/paperclip/file_command_content_type_detector.rb', line 10

def initialize(filename)
  warn_deprecation
  @filename = filename
end

Instance Method Details

#detectObject

Deprecated.

Will be removed in Paperclip 8.0. Use Paperclip::ContentTypeDetector instead.



16
17
18
19
# File 'lib/paperclip/file_command_content_type_detector.rb', line 16

def detect
  warn_deprecation
  Paperclip::Commands::UnixFile.detect_content_type(@filename) || SENSIBLE_DEFAULT
end