Module: Mhtml

Defined in:
lib/mhtml.rb,
lib/mhtml/version.rb,
lib/mhtml/document.rb,
lib/mhtml/http_header.rb,
lib/mhtml/root_document.rb

Defined Under Namespace

Classes: Document, HttpHeader, RootDocument

Constant Summary collapse

LINE_BREAK =
"\r\n".freeze
DOUBLE_LINE_BREAK =
"#{LINE_BREAK}#{LINE_BREAK}".freeze
STATUS_LINE =
"HTTP/1.1 200 OK#{LINE_BREAK}".freeze
FILE_EXTENSIONS =
[ '.mht', '.mhtml' ].freeze
VERSION =
'0.1.4'

Class Method Summary collapse

Class Method Details

.is_mhtml(filename) ⇒ Object



11
12
13
14
15
16
# File 'lib/mhtml.rb', line 11

def self.is_mhtml(filename)
  ext = File.extname(filename)
  return false if ext.empty?
  ext.downcase!
  FILE_EXTENSIONS.include?(ext)
end