Skip to content

Commit

Permalink
adding epub, ibooks, mobi and dmg mime types
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricio committed Jan 24, 2013
1 parent a7f6ce1 commit a502a44
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mime/types/application
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ application/news-transmission 'IANA,RFC5537,[Spencer]
application/nss 'IANA,[Hammer]
application/ocsp-request 'IANA,RFC2560
application/ocsp-response 'IANA,RFC2560
application/octet-stream @bin,dms,lha,lzh,exe,class,ani,pgp,so,dll,dmg,dylib :base64 'IANA,RFC2045,RFC2046
application/octet-stream @bin,dms,lha,lzh,exe,class,ani,pgp,so,dll,dylib :base64 'IANA,RFC2045,RFC2046
application/oda @oda 'IANA,RFC2045,RFC2046
application/oebps-package+xml 'IANA,RFC4839
application/ogg @ogx 'IANA,RFC5334
Expand Down
1 change: 1 addition & 0 deletions lib/mime/types/application.mac
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
mac:application/x-mac @bin :base64
mac:application/x-macbase64 @bin :base64
mac:application/x-apple-diskimage @dmg
3 changes: 3 additions & 0 deletions lib/mime/types/application.nonstandard
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
*application/vnd.sun.xml.writer.global @sxg
*application/vnd.sun.xml.writer.template @stw
*application/word @doc,dot 'LTSW
application/epub+zip @epub
application/x-SLA
application/x-STEP
application/x-VMSBACKUP @bck :base64
Expand Down Expand Up @@ -65,6 +66,7 @@ application/x-hdf @hdf 'LTSW
application/x-hep @hep
application/x-html+ruby @rhtml :8bit
application/x-httpd-php @phtml,pht,php :8bit
application/x-ibooks+zip @ibooks
application/x-ica @ica
application/x-ideas
application/x-imagemap @imagemap,imap :8bit
Expand All @@ -82,6 +84,7 @@ application/x-macbinary
application/x-maker @frm,maker,frame,fm,fb,book,fbdoc =use-instead:application/vnd.framemaker
application/x-mathematica-old
application/x-mif @mif 'LTSW
application/x-mobipocket-ebook @mobi
application/x-ms-wmd @wmd
application/x-ms-wmz @wmz
application/x-msaccess @mda,mdb,mde,mdf
Expand Down
10 changes: 10 additions & 0 deletions test/test_mime_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ def test_class_of
assert(MIME::Types.of('zzz').empty?)
end

def test_ebook_formats
assert_equal( MIME::Types['application/x-mobipocket-ebook'], MIME::Types.type_for("book.mobi"))
assert_equal( MIME::Types['application/epub+zip'], MIME::Types.type_for("book.epub"))
assert_equal( MIME::Types['application/x-ibooks+zip'], MIME::Types.type_for("book.ibooks") )
end

def test_apple_formats
assert_equal( MIME::Types['application/x-apple-diskimage'], MIME::Types.type_for("disk.dmg") )
end

def _test_add
raise NotImplementedError, 'Need to write test_add'
end
Expand Down

0 comments on commit a502a44

Please sign in to comment.