mimemagic-0.3.2/0000755000004100000410000000000013272055171013477 5ustar www-datawww-datamimemagic-0.3.2/.travis.yml0000644000004100000410000000042613272055171015612 0ustar www-datawww-datalanguage: ruby rvm: - 1.9.3 - 2.0.0 - 2.1.0 - 2.2.0 - 2.3.0 - ruby-head - jruby-19mode - rbx before_install: - gem install bundler # the default bundler version on travis is very old and causes 1.9.3 build issues matrix: allow_failures: - rvm: ruby-head mimemagic-0.3.2/test/0000755000004100000410000000000013272055171014456 5ustar www-datawww-datamimemagic-0.3.2/test/mimemagic_test.rb0000644000004100000410000001402213272055171017771 0ustar www-datawww-datarequire 'bacon' require 'mimemagic' require 'stringio' require 'forwardable' describe 'MimeMagic' do it 'should have type, mediatype and subtype' do MimeMagic.new('text/html').type.should.equal 'text/html' MimeMagic.new('text/html').mediatype.should.equal 'text' MimeMagic.new('text/html').subtype.should.equal 'html' end it 'should have mediatype helpers' do MimeMagic.new('text/plain').should.be.text MimeMagic.new('text/html').should.be.text MimeMagic.new('application/xhtml+xml').should.be.text MimeMagic.new('application/octet-stream').should.not.be.text MimeMagic.new('image/png').should.not.be.text MimeMagic.new('image/png').should.be.image MimeMagic.new('video/ogg').should.be.video MimeMagic.new('audio/mpeg').should.be.audio end it 'should have hierarchy' do MimeMagic.new('text/html').should.be.child_of 'text/plain' MimeMagic.new('text/x-java').should.be.child_of 'text/plain' end it 'should have extensions' do MimeMagic.new('text/html').extensions.should.equal %w(htm html) end it 'should have comment' do MimeMagic.new('text/html').comment.should.equal 'HTML document' end it 'should recognize extensions' do MimeMagic.by_extension('.html').should.equal 'text/html' MimeMagic.by_extension('html').should.equal 'text/html' MimeMagic.by_extension(:html).should.equal 'text/html' MimeMagic.by_extension('rb').should.equal 'application/x-ruby' MimeMagic.by_extension('crazy').should.equal nil MimeMagic.by_extension('').should.equal nil end it 'should recognize by a path' do MimeMagic.by_path('/adsjkfa/kajsdfkadsf/kajsdfjasdf.html').should.equal 'text/html' MimeMagic.by_path('something.html').should.equal 'text/html' MimeMagic.by_path('wtf.rb').should.equal 'application/x-ruby' MimeMagic.by_path('where/am.html/crazy').should.equal nil MimeMagic.by_path('').should.equal nil end it 'should recognize xlsx as zip without magic' do file = "test/files/application.vnd.openxmlformats-officedocument.spreadsheetml.sheet" MimeMagic.by_magic(File.read(file)).should.equal "application/zip" MimeMagic.by_magic(File.open(file, 'rb')).should.equal "application/zip" end it 'should recognize by magic' do require "mimemagic/overlay" Dir['test/files/*'].each do |file| mime = file[11..-1].sub('.', '/') MimeMagic.by_magic(File.read(file)).should.equal mime MimeMagic.by_magic(File.open(file, 'rb')).should.equal mime end end it 'should recognize all by magic' do require 'mimemagic/overlay' file = 'test/files/application.vnd.openxmlformats-officedocument.spreadsheetml.sheet' mimes = %w[application/vnd.openxmlformats-officedocument.spreadsheetml.sheet application/zip] MimeMagic.all_by_magic(File.read(file)).map(&:type).should.equal mimes end it 'should have add' do MimeMagic.add('application/mimemagic-test', extensions: %w(ext1 ext2), parents: 'application/xml', comment: 'Comment') MimeMagic.by_extension('ext1').should.equal 'application/mimemagic-test' MimeMagic.by_extension('ext2').should.equal 'application/mimemagic-test' MimeMagic.by_extension('ext2').comment.should.equal 'Comment' MimeMagic.new('application/mimemagic-test').extensions.should.equal %w(ext1 ext2) MimeMagic.new('application/mimemagic-test').should.be.child_of 'text/plain' end it 'should process magic' do MimeMagic.add('application/mimemagic-test', magic: [[0, 'MAGICTEST'], # MAGICTEST at position 0 [1, 'MAGICTEST'], # MAGICTEST at position 1 [9..12, 'MAGICTEST'], # MAGICTEST starting at position 9 to 12 [2, 'MAGICTEST', [[0, 'X'], [0, 'Y']]]]) # MAGICTEST at position 2 and (X at 0 or Y at 0) MimeMagic.by_magic('MAGICTEST').should.equal 'application/mimemagic-test' MimeMagic.by_magic('XMAGICTEST').should.equal 'application/mimemagic-test' MimeMagic.by_magic(' MAGICTEST').should.equal 'application/mimemagic-test' MimeMagic.by_magic('123456789MAGICTEST').should.equal 'application/mimemagic-test' MimeMagic.by_magic('123456789ABMAGICTEST').should.equal 'application/mimemagic-test' MimeMagic.by_magic('123456789ABCMAGICTEST').should.equal 'application/mimemagic-test' MimeMagic.by_magic('123456789ABCDMAGICTEST').should.equal nil MimeMagic.by_magic('X MAGICTEST').should.equal 'application/mimemagic-test' MimeMagic.by_magic('Y MAGICTEST').should.equal 'application/mimemagic-test' MimeMagic.by_magic('Z MAGICTEST').should.equal nil MimeMagic.by_magic(StringIO.new 'MAGICTEST').should.equal 'application/mimemagic-test' MimeMagic.by_magic(StringIO.new 'XMAGICTEST').should.equal 'application/mimemagic-test' MimeMagic.by_magic(StringIO.new ' MAGICTEST').should.equal 'application/mimemagic-test' MimeMagic.by_magic(StringIO.new '123456789MAGICTEST').should.equal 'application/mimemagic-test' MimeMagic.by_magic(StringIO.new '123456789ABMAGICTEST').should.equal 'application/mimemagic-test' MimeMagic.by_magic(StringIO.new '123456789ABCMAGICTEST').should.equal 'application/mimemagic-test' MimeMagic.by_magic(StringIO.new '123456789ABCDMAGICTEST').should.equal nil MimeMagic.by_magic(StringIO.new 'X MAGICTEST').should.equal 'application/mimemagic-test' MimeMagic.by_magic(StringIO.new 'Y MAGICTEST').should.equal 'application/mimemagic-test' MimeMagic.by_magic(StringIO.new 'Z MAGICTEST').should.equal nil end it 'should handle different file objects' do MimeMagic.add('application/mimemagic-test', magic: [[0, 'MAGICTEST']]) class IOObject def initialize @io = StringIO.new('MAGICTEST') end extend Forwardable delegate [:read, :size, :rewind, :eof?, :close] => :@io end MimeMagic.by_magic(IOObject.new).should.equal 'application/mimemagic-test' class StringableObject def to_s 'MAGICTEST' end end MimeMagic.by_magic(StringableObject.new).should.equal 'application/mimemagic-test' end end mimemagic-0.3.2/test/files/0000755000004100000410000000000013272055171015560 5ustar www-datawww-datamimemagic-0.3.2/test/files/application.gzip0000644000004100000410000000003713272055171020756 0ustar www-datawww-data.Kcompressedmimemagic-0.3.2/test/files/application.x-tar0000644000004100000410000002400013272055171021034 0ustar www-datawww-dataempty-file0000644000175000001440000000000011313520635012050 0ustar minadusersmimemagic-0.3.2/test/files/application.x-bzip0000644000004100000410000000001613272055171021213 0ustar www-datawww-dataBZh9rE8Pmimemagic-0.3.2/test/files/application.vnd.openxmlformats-officedocument.spreadsheetml.sheet0000644000004100000410000007222513272055171032617 0ustar www-datawww-dataPK!;H@l[Content_Types].xml (N0EHC-Jܲ@5*Q>ē/y="TTĊskƓl %#T))eFaBɶl6,0l%kcwcՂX8" FD Zht+g#ؘNM'Pㆶw$βݹΪd{* wQޛ@@$xÇA Π$ds07|wnY CZU ]2tkBb .Zy?FAH=<}dbj3W=܊5⠾瑦.鷰.;$!*fq=ۡ{$oޠPK!}T  _rels/.rels (MN0H} PnRwLibv!=ECU=͛f0={E tJFkZ$H6zLQl,(M?peKc<\ٻ`0chGaC|Uw<ԀjɶJ@ت` %TKhC& Ig/P|^{-Ƀ!x4$<z?GO)8.t;9,WjfgQ#)Sx|'KY}PK!nxl/_rels/workbook.xml.rels (j0 }qҍ1F^Ơ-{c+qhbKɠMt\ 'g&WP%&w >׻'[= &$շ774OH"xR㳔dNҨ9ɨAw(7e(3O ރhm| sD"$4DSOUNh9.)k0՚0!!iɹS]٬ `2K9Gyvq/PK!pxl/workbook.xmlRMo0 tw(VZ,Xa(= ч!ɳa}tv.H`4.}PxH1VJs=[BYY]];yv71BhaZi!S;ox?zɫH&4MpeZ w3K#\qfx~4FxTU\]/ ) YR0)_Y{ןekSXn P ^؁3&Σ}3^lO t)ϱRa#2v, T"oJMB";:jA?U Mp-hY #wMPSeu^ ۯʎdi\hΎe;J3F^n&n.:.3d6, rrڙyg iAs:^@kg亥/PK!h34xl/sharedStrings.xml\AN1 EH!$L@Ӊ4qI+!D~Ҫ63M0|N|v/Xf ` ~K<"RZ_09rA9z\* U?N.(Os_m GkhF_uvy|鹌uCKnkPn֕F7]1d P+_PK!0kxl/theme/theme1.xmlYOoE#F{oc'vGuر[hF[x=N3' G$$DA\q@@VR>MԯNDJ++2a,/$nECA6٥D-ʵ? dXiJF8,nx (MKoP(\HbWϿ})zg'8yV#x'˯?oOz3?^?O?~B,z_=yǿ~xPiL$M>7Ck9I#L nꎊ)f>\<|HL|3.ŅzI2O.&e>Ƈ8qBۙ5toG1sD1IB? }J^wi(#SKID ݠ1eBp{8yC]$f94^c>Y[XE>#{Sq c8 >;-&~ ..R(zy s^Fvԇ$*cߓqrB3' }'g7t4Kf"߇ފAV_] 2H7Hk;hIf;ZX_Fڲe}NM;SIvưõ[H5Dt(?]oQ|fNL{d׀O&kNa4%d8?L_H-Ak1h fx-jWBxlB -6j>},khxd׺rXg([x?eޓϲكkS1'|^=aѱnRvPK!uG xl/styles.xmlVM0#,߷nK* "j-W'qRl;i(]v%8pig;Q t`rb1b*WUlӫwYGUAV,-&y*aǘClwBlcڙRI MElm-O,DRps@$5ʵܵ #on+ z\h~3xs. .K*dM)JEn+lJ?O}To@x$Q63P{H ΒJ.}К"$jZ,4hC.S $}w̨m *hGPMtehX^OHX02m 8ڹHW;t vDVTINLl5`KJw[ޓ f Rh]3i8a\q^JIU兄{]5.ճT6'^v,}|@#8BGVOpjke +hNj|ՋpLʀg2xA?0>i8^(a0\5Q6mgVF}=?h b<]*hHPK!7d>7xl/worksheets/sheet1.xmlSn0 ?'4n EӠX+֭=+2 LCRt}dCER=ʯe`Ʈ4 :6vrəd *?~h:W>©tS졣JHO[UV$Q4Fꎏ }ֵVB3B+=wݑͨi~D֭o3MV[}gRCpFoSs T&CۙqL(Пg {Ϟy~kpRgG / 5WP]3M){AYJzYn$^g QCqQ.^I0'`_ eO ԕTIGǣ^nAڍkOSdGwc=mh(GS:\#c@8zVS?œGԞ? %b& Mku^ Z8{ß,~gQ|M.%$MxDy:Ο9oT c[CxA# '8q bɗPK !X`μSSdocProps/thumbnail.jpegJFIFHHtExifMM*>F(iNHH8Photoshop 3.08BIM8BIM%ُ B~ICC_PROFILEappl mntrRGB XYZ   acspAPPLappl-appl descodscmxlcprt8wtptrXYZ0gXYZDbXYZXrTRClchad|,bTRClgTRCldescGeneric RGB ProfileGeneric RGB Profilemluc skSK(xhrHR(caES$ptBR&ukUA*frFU(Vaeobecn RGB profilGeneri ki RGB profilPerfil RGB genricPerfil RGB Genrico030;L=89 ?@>D09; RGBProfil gnrique RVBu( RGB r_icϏProfilo RGB genericoGenerisk RGB-profil| RGB \ |Obecn RGB profil RGB Allgemeines RGB-Profilltalnos RGB profilfn RGB cϏeNN, RGB 000000Profil RGB generic  RGBPerfil RGB genricoAlgemeen RGB-profielB#D%L RGB 1H'DGenel RGB ProfiliYleinen RGB-profiiliUniwersalny profil RGB1I89 ?@>D8;L RGBEDA *91JA RGB 'D9'EGeneric RGB ProfileGenerel RGB-beskrivelsetextCopyright 2007 Apple Inc., all rights reserved.XYZ RXYZ tM=XYZ Zus4XYZ (6curvsf32 B&l }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzCC ?`UY:}6]O{[4b[洁1rC gTPžUDNb!E+{ iˉWxIϕ8|ƃjyonvO?>?a;|h֓o=g>5k^ֵP'¿ G;^(PVwd? =KEs7k',$ =׃?:g_)GޫMK.M>7:c KlcP‹jPžUDNb>~<1? ^] _W#z еaiOxCWt[X]Zj"BCcsmq&XdFd`cw_~xOu |a_/,S/_g[/|= >ۤQj^ {W;d#׃2LJtS@@o_Ýc[U7uOSyFCnon=uwuq,-,43<;;I4:g_n?F/&|f |s=FuY<}M,%o˖OGaxLweg&/¯ 5/X>ϊYuSj ɶ=LiĿ Q|S+V~? ~,> By(蚏CB4toK<1$=(׿x?[SPCƹ 8j#BjVebo5][F >S+Gp:$+vaȎYy(M ^\o?M@# |1j|5*xXY%ȺWhb`P9񾩮x> K|=~!;G_`d׈lt^ΓI̯,IoDiW%{\Kx῎?Fi>*jѾ-qot+_x^[&LfG4hR=H>Ǟ+71xK>0wJ//>z߇44C>>"_i)nI_k:Sw}? WM$d (ao9<7/*?Km =jOC-]ʑ0{}#Tm]O%ѵI#]5%uM3Pkl S{?$j6.hֵM? D!A6iA,lʦ5uY u?!#W?su>ajm갭ƙj-M۾hi=Lj#cJVH"tmKS(BuINuo ONzP֡ccᛛ"[hu[K_xF{6kHo"-u崒'Tig0:;Exo hzωKwJ5]-[Mlym\E$0t98 :5|6|EqhM?bmVM:m/R#m ݬH0Hm\5xc?{?$j6.hW];6h7< k{{ko.+t]'֗v:֠XZp\5$XOkҥΩڞ=/Pu ]izܚqms\E5RдJC,;u?!#W?so$jʗ A_휕[$Б,~Zkዯx2đR~E4k 7U8ko\4kH5 (;-SN!y@=Ee#W!o f9O x#@kxSÞ:iO^XZ݈奆qk \[—ͦ_bCBFo Б{?$j6.hdV ̬F჆SSgR0r9>*?|S/jkKsmm[xfVE^@\NAڌF~|Mu6xVW~-.|AAsmqn<2],MFꮎXP?mi/~+jlu? |Oi_ ,]'W|D)&qq:뾯M C*KSx+Iguˉ=Q$Ӣ-G47Vlw62\M-V_[Zİ$`Oߎoj~௄8񞿦xx{߉M֫kī#'ρ5Q<)6oi+xco'#n3_ۭs⯂ tmSJ]j{:_~Kh׼e 'ZӾ7<:?g/i^ m<+ĺt |r)sxZmLJ>tW'O F\}cV?񶲋[tg]k?úe7:48=WZX<]xoZW'·^!_3ũ> >"FxFOKo}J o#lVmy:௉[>5?hψz-~Ֆ?x  0>6O(KY _x_ ƿ Vf⿌1⯆T:|ahP3\/__@ԚLo{x*HtY^gSlOZŏ^o[{&Re4+Z߅em.JojvĚwgm;~ > $??/Eѿi,>$h> |0hs48/On<5en~ hcğ#*>"xKc['to|3L]¾$m+z'gK_ ~ڧ<h&IycXxv=u1)ً[xqo/|J~#<{o'mt7 wko ^ZF-#}~_CGnt^u~ O3Ú/ҼCU҇~g\We}gN S, @dCS_k9ukw{xC3ZΏmÞҿhuwT=2Tѿ]w@z6~=F>࿈ߴ& :&_{_?5v5-3WLnj> |!gд?D5Bbu+=e/ڃZu6H_ &8?M|ZQsռ{M/IM?4zχm1 ΫU4-_P?dڻ7Eu [KYeHjzߋjkZ=M o玿f iV-ᮡxMtگu4wMV[kVw{]k>$i~$s|C/|6YĉXЬuMJ9~xl߾2||k^>zg]ľ? #SUKoENJ>%|XψP\ך5Ef;xs⧆cLjjv_]V=;? 2gPOaxMmShfioi:f6//Qѭ ]v{ƫSķ+_-vþ燼+ ΰX\Hg<:M+VEaٺt4,t9U/9nkN7žO#i_r=LJt|%WF?ǥ_mZVUW5_❯?׿u[|;{2_~Ӈ<)G|վ$61|v7.5kI@WLj_ON^ ΟC״?ɗdwޑkhri%f|Mim<6_x/?lOoڻkgK<_?>_}YizQ_?a/ ri+o{3V\o<5'дY^]i l*Yʃ@6@7m?tch +Mo7@6@7mrwN Αf }iqx]Cf dY+Mo7@6@7m?tch +Mo7@iGž0CiR Semgx['u?tch +Mo7@6@7m?tx7IҞ\/iW+AS[ }``:mZo?im GV6n&s=d~tHd_971,tbY䓒I$im GV6nmZoߋZNGiȞ#0npVF0(>xT|>+:v/I4 φwgf|?%Ŷ9.Rfp\@P"{~Bmx=Exd 74W^"h$_+4)gycNpR :?I@wiJ?eCNP/t%&撀ӣ)74i,IS](|+1(baws,jTe܀WwiJ?eCNP/t%&撀ӣ)74gx IOIZ|U%ҖUþlI;/d)l s0Eu2GRoi( :?I@wiJ?eCNP/t%&撀9?i,k]k.,B˺en)!bHu1̓ :?I@wiJ?eCNP/t%&撀wv>|Sckg88(VwZQBьq?%C[Fx1!Qgx I;_4JM%2GRoi( :?I@['O׈ehp^4Y*%0˳;V>|Vt bW3S%j:~X_,}bo8ym |l@(>'Ï*m#߄ C{CMEmsYD/ZVGK=[om[Eqss-ҳ|M5s3|A=عմT׈4r7&2pFJWwB9@%w)aWwB9@%w)aWwB9@ljte"^cռ2E ~x2GQ ] ~%XЧ_P ] ~%XЧ_P ] ~%XrW>-x_Leƶo˴iǙ(?,?rJS/(?,?rJS/(?,?r9O]d x]+Dmdn߼HAuЧ_P ] ~%XЧ_P ] ~%X5SvU"~%HHOQh#3<kL_ ~.E,~I[GF2AV@,Y;9xHvk!<x\xjח<;9נo><ӡxɍhn"?j\Jf_;F <-pXPYA$` PeOhm[D4}~">i?V mo9+ONMF Nbs2py~">i?V moշC@m?!CG.760kϋwnumoշC@m?!mOhe娴ssn3n2NA0J>i?V moշC@m?!I{gm^!?ʀ9ZxHpGPA Au 9mOhm[D4}~"󿋗v ͻ3x?*$6I<?^~|S|96|>xWC-eyY I,3;Nh;_?(|)lwYxOоgׇl|C$Z|Z嶻\i'u ۛoiiocn-{ᗇhΙs?%{M&)$>#r捤 uPT? 7 WnC+Bo7@!{Fu н)q? i0H7x-^iQxcEMS[aCi]22\]NBIc<^)>7x퇎-5OjZ:fh^,t $~c%϶72\=ͼ;_tVrx[OFs",RCG H# \{P?C^nG b<9]_ c\xxEYYFn6:)upC^nG^O.8v??p?f{P?C^nG_x_/ú2yYۧ[ U7Bʤ:oK$[_ʀK$[_ʀK$[_ʀK$[_ʀ8&{jZt ~G%r'|m?0i?r?9@mJxgLgc¼}^qӌ[o(Mc}~`>m?0i?r9 C|ŕq#8'6Po(Mc}~`>m?0q n!̨8:ao(Mc}~`>m?02Kb>(?CM-ŸWA GKm?@Wm6Po(Mc.-w%Yf>Jt˜I~S|:> ×ڎmOIt%yK#3O|-+XOu?S g&B|)sx G?2hNO][TҭഌNcgUbC|7ExW~.kgs/~&[~GO~k?rAoy$uufAķztVƫvY}P; s`m3C ~4Ɔ7K> dg O5*+Mtc=77@?p?#+Mt\i^'I2 xo]8jݛHq ;WC_zo8nG?WCtxWedH;I45U# 9:G?WC_zo8nG!xu+f ,B0[| %$#|ފр1@g?p?#+Mtc=77@ }#AX9xǡ@МszWx|Xb;4qbiC[m1Vf0ؖ|not+Mtc=77@?p?#p?4ǒ\xZkm>/>!\D_1 ɬ$h[_EuOU5>AVasy.qwn,v:(J`{]Cӟ.DӖOٗk>,]i~ACWĘgٷ?߳Ļ/_ ෑ+i.JŭZvZM೺?kӬ|pA)Gώ(5(bS3NZt+m*cV@RJ/+?T >^$W-+|IS@&ZWx _L'#Mr._DTgRϫeX<@#!T(QYu_i_O%|Gʚ?2ҿğJ4eϗ?*hJ/+?T >^$WOIv*teáBg_i˳ Fa<2"(_ J/+?T >^$W-+|IS@&ZWx _L'#Mr~n  _Ş(y~enUzc#mFI\0-+|IS@&ZWx _L'#Mi_O%|GʚkK(^$V*Ps^ v+ ^ё~u%%LxC] PO >^$W-+|IS@&ZWx _L'#Mp|W|4v?葧޽o ϦG 1rK""YPo2].G{GXxPEaxm^eV)>Dh?o~ ;|!ēXx/:O. '+=g]k >Z^~x}{m&+,*>%uma4S" ?\j_ tܾٗËo xO c> xO c> xO c> xO cn &H:E|@QƃCWϘ$eFsIʨ"u_g'Eg'Eg'Eg'Eg'ErzL45O ^U`l<*15hʍ.APa:ϳ{X梀{X梀{X梀{X梀{X梀9?A3ky:xI:לSđɎ6 +I!?-?'j(?-?'j(?-?'j(?-?'j([xO7ǧ&xTx]!>ьI.I*t}$H.r#@BO[OkP[OkP[OkP[OkPVOO2Z ;}Uwib4"9J#ȭѸhVCwoWé/6o? cAjJDMe{IX,#>\o?]߃e꿵6wc׈?g}kM| /9A'X']"(!D/yn/zbrQ J<^} 1@%V69& X(DBgp&y/c8 ѾuH^g PC} Mh>|kuwR?9#Ɔ'c]mpsneGG]*9Ok<#a}2jӪK1~E `Mv&)c+J`*\;ݍ^.Kĝ#٘L ^ΉGw|9d:vɄ#7ޣo.s{CpZeQm[8ț~0Y&>in g2ݺ^,O%묦oPK-!;H@l[Content_Types].xmlPK-!}T  _rels/.relsPK-!nxl/_rels/workbook.xml.relsPK-!p xl/workbook.xmlPK-!h34 xl/sharedStrings.xmlPK-!0k xl/theme/theme1.xmlPK-!uG [xl/styles.xmlPK-!7d>7xl/worksheets/sheet1.xmlPK- !X`μSSdocProps/thumbnail.jpegPK-!eG|CizldocProps/core.xmlPK-!S0ndocProps/app.xmlPK qmimemagic-0.3.2/test/files/application.zip0000644000004100000410000000025213272055171020606 0ustar www-datawww-dataPK ; empty-fileUT .K.Kux dPK ; empty-fileUT.Kux dPKPDmimemagic-0.3.2/test/files/application.x-ruby0000644000004100000410000000004413272055171021231 0ustar www-datawww-data#!/usr/bin/ruby print "Hello World" mimemagic-0.3.2/README.md0000644000004100000410000000332013272055171014754 0ustar www-datawww-dataMimeMagic is a library to detect the mime type of a file by extension or by content. It uses the mime database provided by freedesktop.org (see http://freedesktop.org/wiki/Software/shared-mime-info/). [![Build Status](https://secure.travis-ci.org/minad/mimemagic.png?branch=master)](http://travis-ci.org/minad/mimemagic) [![Code Climate](https://codeclimate.com/github/minad/mimemagic.png)](https://codeclimate.com/github/minad/mimemagic) [![Gittip donate button](http://img.shields.io/gittip/bevry.png)](https://www.gittip.com/min4d/ "Donate weekly to this project using Gittip") [![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=min4d&url=https://github.com/minad/mimemagic&title=MimeMagic&language=&tags=github&category=software) Usage ===== require 'mimemagic' MimeMagic.by_extension('html').text? MimeMagic.by_extension('.html').child_of? 'text/plain' MimeMagic.by_path('filename.txt') MimeMagic.by_magic(File.open('test.html')) # etc... Extra magic overlay ===== Microsoft Office 2007+ formats (xlsx, docx, and pptx) are not supported by the mime database at freedesktop.org. These files are all zipped collections of xml files and will be detected as "application/zip". Mimemagic comes with extra magic you can overlay on top of the defaults to correctly detect these file types. Enable it like this: require 'mimemagic' require 'mimemagic/overlay' MimeMagic.by_magic(File.open('test.xlsx')) You can add your own magic with `MimeMagic.add`. See `lib/mimemagic/overlay.rb`. API === http://rdoc.info/github/minad/mimemagic/frames/file/README.md Tests ===== ``` bundle install rake test ``` Authors ======= Daniel Mendler mimemagic-0.3.2/.gitignore0000644000004100000410000000005113272055171015463 0ustar www-datawww-data*.swp *.gem Gemfile.lock .bundle .yardoc mimemagic-0.3.2/script/0000755000004100000410000000000013272055171015003 5ustar www-datawww-datamimemagic-0.3.2/script/generate-mime.rb0000755000004100000410000001377413272055171020066 0ustar www-datawww-data#!/usr/bin/env ruby require 'nokogiri' class String alias inspect_old inspect def inspect x = b.inspect_old.gsub(/\\x([0-9a-f]{2})/i) do '\\%03o' % $1.to_i(16) end x =~ /[\\']/ ? x : x.gsub('"', '\'') end end def str2int(s) return s.to_i(16) if s[0..1].downcase == '0x' return s.to_i(8) if s[0..0].downcase == '0' s.to_i(10) end def get_matches(parent) parent.elements.map {|match| if match['mask'] nil else type = match['type'] value = match['value'] offset = match['offset'].split(':').map {|x| x.to_i } offset = offset.size == 2 ? offset[0]..offset[1] : offset[0] case type when 'string' value.gsub!(/\\(x[\dA-Fa-f]{1,2}|0\d{1,3}|\d{1,3}|.)/) { eval("\"\\#{$1}\"") } when 'big16' value = str2int(value) value = ((value >> 8).chr + (value & 0xFF).chr) when 'big32' value = str2int(value) value = (((value >> 24) & 0xFF).chr + ((value >> 16) & 0xFF).chr + ((value >> 8) & 0xFF).chr + (value & 0xFF).chr) when 'little16' value = str2int(value) value = ((value & 0xFF).chr + (value >> 8).chr) when 'little32' value = str2int(value) value = ((value & 0xFF).chr + ((value >> 8) & 0xFF).chr + ((value >> 16) & 0xFF).chr + ((value >> 24) & 0xFF).chr) when 'host16' # use little endian value = str2int(value) value = ((value & 0xFF).chr + (value >> 8).chr) when 'host32' # use little endian value = str2int(value) value = ((value & 0xFF).chr + ((value >> 8) & 0xFF).chr + ((value >> 16) & 0xFF).chr + ((value >> 24) & 0xFF).chr) when 'byte' value = str2int(value) value = value.chr end children = get_matches(match) children.empty? ? [offset, value] : [offset, value, children] end }.compact end if ARGV.size != 1 puts "Usage: #{$0} " exit 1 end FILE = ARGV[0] file = File.new(FILE) doc = Nokogiri::XML(file) extensions = {} types = {} magics = [] (doc/'mime-info/mime-type').each do |mime| comments = Hash[*(mime/'comment').map {|comment| [comment['xml:lang'], comment.inner_text] }.flatten] type = mime['type'] subclass = (mime/'sub-class-of').map{|x| x['type']} exts = (mime/'glob').map{|x| x['pattern'] =~ /^\*\.([^\[\]]+)$/ ? $1.downcase : nil }.compact (mime/'magic').each do |magic| priority = magic['priority'].to_i matches = get_matches(magic) magics << [priority, type, matches] end if !exts.empty? exts.each{|x| extensions[x] = type if !extensions.include?(x) } types[type] = [exts,subclass,comments[nil]] end end magics = magics.sort {|a,b| [-a[0],a[1]] <=> [-b[0],b[1]] } common_types = [ "image/jpeg", # .jpg "image/png", # .png "image/gif", # .gif "image/tiff", # .tiff "image/bmp", # .bmp "image/vnd.adobe.photoshop", # .psd "image/webp", # .webp "image/svg+xml", # .svg "video/x-msvideo", # .avi "video/x-ms-wmv", # .wmv "video/mp4", # .mp4, .m4v "video/quicktime", # .mov "video/mpeg", # .mpeg "video/ogg", # .ogv "video/webm", # .webm "video/x-matroska", # .mkv "video/x-flv", # .flv "audio/mpeg", # .mp3 "audio/x-wav", # .wav "audio/aac", # .aac "audio/flac", # .flac "audio/mp4", # .m4a "audio/ogg", # .ogg "application/pdf", # .pdf "application/msword", # .doc "application/vnd.openxmlformats-officedocument.wordprocessingml.document", # .docx "application/vnd.ms-powerpoint", # .pps "application/vnd.openxmlformats-officedocument.presentationml.slideshow", # .ppsx "application/vnd.ms-excel", # .pps "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", # .ppsx ] common_magics = common_types.map do |common_type| magics.find { |_, type, _| type == common_type } end magics = (common_magics.compact + magics).uniq puts "# -*- coding: binary -*-" puts "# Generated from #{FILE}" puts "class MimeMagic" puts " # @private" puts " # :nodoc:" puts " EXTENSIONS = {" extensions.keys.sort.each do |key| puts " '#{key}' => '#{extensions[key]}'," end puts " }" puts " # @private" puts " # :nodoc:" puts " TYPES = {" types.keys.sort.each do |key| exts = types[key][0].sort.join(' ') parents = types[key][1].sort.join(' ') comment = types[key][2].inspect puts " '#{key}' => [%w(#{exts}), %w(#{parents}), #{comment}]," end puts " }" puts " # @private" puts " # :nodoc:" puts " MAGIC = [" magics.each do |priority, type, matches| puts " ['#{type}', #{matches.inspect}]," end puts " ]" puts "end" mimemagic-0.3.2/LICENSE0000644000004100000410000000206313272055171014505 0ustar www-datawww-dataThe MIT License Copyright (c) 2011 Daniel Mendler Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. mimemagic-0.3.2/Rakefile0000644000004100000410000000060713272055171015147 0ustar www-datawww-datatask :default => %w(test) desc 'Run tests with bacon' task :test => FileList['test/*_test.rb'] do |t| sh "bacon -q -Ilib:test #{t.prerequisites.join(' ')}" end desc 'Generate mime tables' task :tables => 'lib/mimemagic/tables.rb' file 'lib/mimemagic/tables.rb' => FileList['script/freedesktop.org.xml'] do |f| sh "script/generate-mime.rb #{f.prerequisites.join(' ')} > #{f.name}" end mimemagic-0.3.2/lib/0000755000004100000410000000000013272055171014245 5ustar www-datawww-datamimemagic-0.3.2/lib/mimemagic/0000755000004100000410000000000013272055171016175 5ustar www-datawww-datamimemagic-0.3.2/lib/mimemagic/version.rb0000644000004100000410000000012513272055171020205 0ustar www-datawww-dataclass MimeMagic # MimeMagic version string # @api public VERSION = '0.3.2' end mimemagic-0.3.2/lib/mimemagic/overlay.rb0000644000004100000410000000101713272055171020202 0ustar www-datawww-data# Extra magic [['application/vnd.openxmlformats-officedocument.presentationml.presentation', [[0, "PK\003\004", [[30, '[Content_Types].xml', [[0..5000, 'ppt/']]]]]]], ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', [[0, "PK\003\004", [[30, '[Content_Types].xml', [[0..5000, 'xl/']]]]]]], ['application/vnd.openxmlformats-officedocument.wordprocessingml.document', [[0, "PK\003\004", [[30, '[Content_Types].xml', [[0..5000, 'word/']]]]]]]].each do |magic| MimeMagic.add(magic[0], magic: magic[1]) end mimemagic-0.3.2/lib/mimemagic/tables.rb0000644000004100000410000033722013272055171020003 0ustar www-datawww-data# -*- coding: binary -*- # Generated from script/freedesktop.org.xml class MimeMagic # @private # :nodoc: EXTENSIONS = { '123' => 'application/vnd.lotus-1-2-3', '32x' => 'application/x-genesis-rom', '3ds' => 'image/x-3ds', '3g2' => 'video/3gpp2', '3ga' => 'video/3gpp', '3gp' => 'video/3gpp', '3gp2' => 'video/3gpp2', '3gpp' => 'video/3gpp', '3gpp2' => 'video/3gpp2', '602' => 'application/x-t602', '669' => 'audio/x-mod', '7z' => 'application/x-7z-compressed', 'a' => 'application/x-archive', 'aac' => 'audio/aac', 'abw' => 'application/x-abiword', 'abw.crashed' => 'application/x-abiword', 'abw.gz' => 'application/x-abiword', 'ac3' => 'audio/ac3', 'ace' => 'application/x-ace', 'adb' => 'text/x-adasrc', 'adf' => 'application/x-amiga-disk-format', 'ads' => 'text/x-adasrc', 'afm' => 'application/x-font-afm', 'ag' => 'image/x-applix-graphics', 'agb' => 'application/x-gba-rom', 'ai' => 'application/illustrator', 'aif' => 'audio/x-aiff', 'aifc' => 'audio/x-aifc', 'aiff' => 'audio/x-aiff', 'aiffc' => 'audio/x-aifc', 'al' => 'application/x-perl', 'alz' => 'application/x-alz', 'amr' => 'audio/AMR', 'amz' => 'audio/x-amzxml', 'ani' => 'application/x-navi-animation', 'anx' => 'application/annodex', 'ape' => 'audio/x-ape', 'apk' => 'application/vnd.android.package-archive', 'ar' => 'application/x-archive', 'arj' => 'application/x-arj', 'arw' => 'image/x-sony-arw', 'as' => 'application/x-applix-spreadsheet', 'asc' => 'application/pgp-encrypted', 'asf' => 'application/vnd.ms-asf', 'asp' => 'application/x-asp', 'ass' => 'text/x-ssa', 'asx' => 'audio/x-ms-asx', 'atom' => 'application/atom+xml', 'au' => 'audio/basic', 'avf' => 'video/x-msvideo', 'avi' => 'video/x-msvideo', 'aw' => 'application/x-applix-word', 'awb' => 'audio/AMR-WB', 'awk' => 'application/x-awk', 'axa' => 'audio/annodex', 'axv' => 'video/annodex', 'bak' => 'application/x-trash', 'bcpio' => 'application/x-bcpio', 'bdf' => 'application/x-font-bdf', 'bdm' => 'video/mp2t', 'bdmv' => 'video/mp2t', 'bib' => 'text/x-bibtex', 'bin' => 'application/octet-stream', 'blend' => 'application/x-blender', 'blender' => 'application/x-blender', 'bmp' => 'image/bmp', 'bz' => 'application/x-bzip', 'bz2' => 'application/x-bzip', 'c' => 'text/x-c++src', 'c++' => 'text/x-c++src', 'cab' => 'application/vnd.ms-cab-compressed', 'cap' => 'application/vnd.tcpdump.pcap', 'cb7' => 'application/x-cb7', 'cbl' => 'text/x-cobol', 'cbr' => 'application/x-cbr', 'cbt' => 'application/x-cbt', 'cbz' => 'application/x-cbz', 'cc' => 'text/x-c++src', 'ccmx' => 'application/x-ccmx', 'cdf' => 'application/x-netcdf', 'cdr' => 'application/vnd.corel-draw', 'cer' => 'application/pkix-cert', 'cert' => 'application/x-x509-ca-cert', 'cgb' => 'application/x-gameboy-rom', 'cgm' => 'image/cgm', 'chm' => 'application/vnd.ms-htmlhelp', 'chrt' => 'application/x-kchart', 'class' => 'application/x-java', 'clpi' => 'video/mp2t', 'cls' => 'text/x-tex', 'cmake' => 'text/x-cmake', 'cob' => 'text/x-cobol', 'coffee' => 'application/vnd.coffeescript', 'cpi' => 'video/mp2t', 'cpio' => 'application/x-cpio', 'cpio.gz' => 'application/x-cpio-compressed', 'cpp' => 'text/x-c++src', 'cr2' => 'image/x-canon-cr2', 'crdownload' => 'application/x-partial-download', 'crl' => 'application/pkix-crl', 'crt' => 'application/x-x509-ca-cert', 'crw' => 'image/x-canon-crw', 'cs' => 'text/x-csharp', 'csh' => 'application/x-csh', 'css' => 'text/css', 'csv' => 'text/csv', 'csvs' => 'text/csv-schema', 'cue' => 'application/x-cue', 'cur' => 'image/x-win-bitmap', 'cxx' => 'text/x-c++src', 'd' => 'text/x-dsrc', 'dar' => 'application/x-dar', 'dbf' => 'application/x-dbf', 'dbk' => 'application/x-docbook+xml', 'dc' => 'application/x-dc-rom', 'dcl' => 'text/x-dcl', 'dcm' => 'application/dicom', 'dcr' => 'image/x-kodak-dcr', 'dds' => 'image/x-dds', 'deb' => 'application/vnd.debian.binary-package', 'der' => 'application/x-x509-ca-cert', 'desktop' => 'application/x-desktop', 'di' => 'text/x-dsrc', 'dia' => 'application/x-dia-diagram', 'diff' => 'text/x-patch', 'divx' => 'video/x-msvideo', 'djv' => 'image/vnd.djvu', 'djvu' => 'image/vnd.djvu', 'dmg' => 'application/x-apple-diskimage', 'dmp' => 'application/vnd.tcpdump.pcap', 'dng' => 'image/x-adobe-dng', 'doc' => 'application/msword', 'docbook' => 'application/x-docbook+xml', 'docm' => 'application/vnd.ms-word.document.macroEnabled.12', 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'dot' => 'application/msword-template', 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12', 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', 'dsl' => 'text/x-dsl', 'dtd' => 'application/xml-dtd', 'dts' => 'audio/vnd.dts', 'dtshd' => 'audio/vnd.dts.hd', 'dtx' => 'text/x-tex', 'dv' => 'video/dv', 'dvi' => 'application/x-dvi', 'dvi.bz2' => 'application/x-bzdvi', 'dvi.gz' => 'application/x-gzdvi', 'dwg' => 'image/vnd.dwg', 'dxf' => 'image/vnd.dxf', 'e' => 'text/x-eiffel', 'egon' => 'application/x-egon', 'eif' => 'text/x-eiffel', 'el' => 'text/x-emacs-lisp', 'emf' => 'image/x-emf', 'eml' => 'message/rfc822', 'emp' => 'application/vnd.emusic-emusic_package', 'ent' => 'application/xml-external-parsed-entity', 'eps' => 'image/x-eps', 'eps.bz2' => 'image/x-bzeps', 'eps.gz' => 'image/x-gzeps', 'epsf' => 'image/x-eps', 'epsf.bz2' => 'image/x-bzeps', 'epsf.gz' => 'image/x-gzeps', 'epsi' => 'image/x-eps', 'epsi.bz2' => 'image/x-bzeps', 'epsi.gz' => 'image/x-gzeps', 'epub' => 'application/epub+zip', 'erl' => 'text/x-erlang', 'es' => 'application/ecmascript', 'etheme' => 'application/x-e-theme', 'etx' => 'text/x-setext', 'exe' => 'application/x-ms-dos-executable', 'exr' => 'image/x-exr', 'ez' => 'application/andrew-inset', 'f' => 'text/x-fortran', 'f4a' => 'audio/mp4', 'f4b' => 'audio/x-m4b', 'f4v' => 'video/mp4', 'f90' => 'text/x-fortran', 'f95' => 'text/x-fortran', 'fb2' => 'application/x-fictionbook+xml', 'fb2.zip' => 'application/x-zip-compressed-fb2', 'fig' => 'image/x-xfig', 'fits' => 'image/fits', 'fl' => 'application/x-fluid', 'flac' => 'audio/flac', 'flc' => 'video/x-flic', 'fli' => 'video/x-flic', 'flv' => 'video/x-flv', 'flw' => 'application/x-kivio', 'fo' => 'text/x-xslfo', 'fodg' => 'application/vnd.oasis.opendocument.graphics-flat-xml', 'fodp' => 'application/vnd.oasis.opendocument.presentation-flat-xml', 'fods' => 'application/vnd.oasis.opendocument.spreadsheet-flat-xml', 'fodt' => 'application/vnd.oasis.opendocument.text-flat-xml', 'for' => 'text/x-fortran', 'fxm' => 'video/x-javafx', 'g3' => 'image/fax-g3', 'gb' => 'application/x-gameboy-rom', 'gba' => 'application/x-gba-rom', 'gbc' => 'application/x-gameboy-rom', 'gcrd' => 'text/vcard', 'ged' => 'application/x-gedcom', 'gedcom' => 'application/x-gedcom', 'gem' => 'application/x-tar', 'gen' => 'application/x-genesis-rom', 'geo.json' => 'application/vnd.geo+json', 'geojson' => 'application/vnd.geo+json', 'gf' => 'application/x-tex-gf', 'gg' => 'application/x-sms-rom', 'gif' => 'image/gif', 'glade' => 'application/x-glade', 'gml' => 'application/gml+xml', 'gmo' => 'application/x-gettext-translation', 'gnc' => 'application/x-gnucash', 'gnd' => 'application/gnunet-directory', 'gnucash' => 'application/x-gnucash', 'gnumeric' => 'application/x-gnumeric', 'gnuplot' => 'application/x-gnuplot', 'go' => 'text/x-go', 'gp' => 'application/x-gnuplot', 'gpg' => 'application/pgp-encrypted', 'gplt' => 'application/x-gnuplot', 'gpx' => 'application/gpx+xml', 'gra' => 'application/x-graphite', 'gs' => 'text/x-genie', 'gsf' => 'application/x-font-type1', 'gsm' => 'audio/x-gsm', 'gtar' => 'application/x-tar', 'gv' => 'text/vnd.graphviz', 'gvp' => 'text/x-google-video-pointer', 'gz' => 'application/gzip', 'h' => 'text/x-chdr', 'h++' => 'text/x-c++hdr', 'h4' => 'application/x-hdf', 'h5' => 'application/x-hdf', 'hdf' => 'application/x-hdf', 'hdf4' => 'application/x-hdf', 'hdf5' => 'application/x-hdf', 'hh' => 'text/x-c++hdr', 'hlp' => 'application/winhlp', 'hp' => 'text/x-c++hdr', 'hpgl' => 'application/vnd.hp-hpgl', 'hpp' => 'text/x-c++hdr', 'hs' => 'text/x-haskell', 'htm' => 'text/html', 'html' => 'text/html', 'hwp' => 'application/x-hwp', 'hwt' => 'application/x-hwt', 'hxx' => 'text/x-c++hdr', 'ica' => 'application/x-ica', 'icb' => 'image/x-tga', 'icc' => 'application/vnd.iccprofile', 'icm' => 'application/vnd.iccprofile', 'icns' => 'image/x-icns', 'ico' => 'image/vnd.microsoft.icon', 'ics' => 'text/calendar', 'idl' => 'text/x-idl', 'ief' => 'image/ief', 'iff' => 'image/x-ilbm', 'ilbm' => 'image/x-ilbm', 'ime' => 'text/x-iMelody', 'img' => 'application/x-raw-disk-image', 'img.xz' => 'application/x-raw-disk-image-xz-compressed', 'imy' => 'text/x-iMelody', 'ins' => 'text/x-tex', 'iptables' => 'text/x-iptables', 'iso' => 'application/x-cd-image', 'iso9660' => 'application/x-cd-image', 'it' => 'audio/x-it', 'it87' => 'application/x-it87', 'jad' => 'text/vnd.sun.j2me.app-descriptor', 'jar' => 'application/x-java-archive', 'java' => 'text/x-java', 'jceks' => 'application/x-java-jce-keystore', 'jks' => 'application/x-java-keystore', 'jng' => 'image/x-jng', 'jnlp' => 'application/x-java-jnlp-file', 'jp2' => 'image/jp2', 'jpe' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpf' => 'image/jp2', 'jpg' => 'image/jpeg', 'jpr' => 'application/x-jbuilder-project', 'jpx' => 'application/x-jbuilder-project', 'jrd' => 'application/jrd+json', 'js' => 'application/javascript', 'jsm' => 'application/javascript', 'json' => 'application/json', 'json-patch' => 'application/json-patch+json', 'jsonld' => 'application/ld+json', 'k25' => 'image/x-kodak-k25', 'kar' => 'audio/midi', 'karbon' => 'application/x-karbon', 'kdc' => 'image/x-kodak-kdc', 'kdelnk' => 'application/x-desktop', 'kexi' => 'application/x-kexiproject-sqlite2', 'kexic' => 'application/x-kexi-connectiondata', 'kexis' => 'application/x-kexiproject-shortcut', 'key' => 'application/x-iwork-keynote-sffkey', 'kfo' => 'application/x-kformula', 'kil' => 'application/x-killustrator', 'kino' => 'application/smil+xml', 'kml' => 'application/vnd.google-earth.kml+xml', 'kmz' => 'application/vnd.google-earth.kmz', 'kon' => 'application/x-kontour', 'kpm' => 'application/x-kpovmodeler', 'kpr' => 'application/x-kpresenter', 'kpt' => 'application/x-kpresenter', 'kra' => 'application/x-krita', 'ks' => 'application/x-java-keystore', 'ksp' => 'application/x-kspread', 'kud' => 'application/x-kugar', 'kwd' => 'application/x-kword', 'kwt' => 'application/x-kword', 'la' => 'application/x-shared-library-la', 'latex' => 'text/x-tex', 'lbm' => 'image/x-ilbm', 'ldif' => 'text/x-ldif', 'lha' => 'application/x-lha', 'lhs' => 'text/x-literate-haskell', 'lhz' => 'application/x-lhz', 'log' => 'text/x-log', 'lrv' => 'video/mp4', 'lrz' => 'application/x-lrzip', 'ltx' => 'text/x-tex', 'lua' => 'text/x-lua', 'lwo' => 'image/x-lwo', 'lwob' => 'image/x-lwo', 'lwp' => 'application/vnd.lotus-wordpro', 'lws' => 'image/x-lws', 'ly' => 'text/x-lilypond', 'lyx' => 'application/x-lyx', 'lz' => 'application/x-lzip', 'lz4' => 'application/x-lz4', 'lzh' => 'application/x-lha', 'lzma' => 'application/x-lzma', 'lzo' => 'application/x-lzop', 'm' => 'text/x-objcsrc', 'm15' => 'audio/x-mod', 'm1u' => 'video/vnd.mpegurl', 'm2t' => 'video/mp2t', 'm2ts' => 'video/mp2t', 'm3u' => 'audio/x-mpegurl', 'm3u8' => 'audio/x-mpegurl', 'm4' => 'application/x-m4', 'm4a' => 'audio/mp4', 'm4b' => 'audio/x-m4b', 'm4u' => 'video/vnd.mpegurl', 'm4v' => 'video/mp4', 'mab' => 'application/x-markaby', 'mak' => 'text/x-makefile', 'man' => 'application/x-troff-man', 'manifest' => 'text/cache-manifest', 'markdown' => 'text/markdown', 'mbox' => 'application/mbox', 'md' => 'text/markdown', 'mdb' => 'application/vnd.ms-access', 'mdi' => 'image/vnd.ms-modi', 'mdx' => 'application/x-genesis-rom', 'me' => 'text/x-troff-me', 'med' => 'audio/x-mod', 'meta4' => 'application/metalink4+xml', 'metalink' => 'application/metalink+xml', 'mgp' => 'application/x-magicpoint', 'mht' => 'application/x-mimearchive', 'mhtml' => 'application/x-mimearchive', 'mid' => 'audio/midi', 'midi' => 'audio/midi', 'mif' => 'application/x-mif', 'minipsf' => 'audio/x-minipsf', 'mk' => 'text/x-makefile', 'mk3d' => 'video/x-matroska-3d', 'mka' => 'audio/x-matroska', 'mkd' => 'text/markdown', 'mkv' => 'video/x-matroska', 'ml' => 'text/x-ocaml', 'mli' => 'text/x-ocaml', 'mm' => 'text/x-troff-mm', 'mmf' => 'application/x-smaf', 'mml' => 'application/mathml+xml', 'mng' => 'video/x-mng', 'mo' => 'application/x-gettext-translation', 'mo3' => 'audio/x-mo3', 'mobi' => 'application/x-mobipocket-ebook', 'moc' => 'text/x-moc', 'mod' => 'audio/x-mod', 'mof' => 'text/x-mof', 'moov' => 'video/quicktime', 'mov' => 'video/quicktime', 'movie' => 'video/x-sgi-movie', 'mp+' => 'audio/x-musepack', 'mp2' => 'audio/mp2', 'mp3' => 'audio/mpeg', 'mp4' => 'video/mp4', 'mpc' => 'audio/x-musepack', 'mpe' => 'video/mpeg', 'mpeg' => 'video/mpeg', 'mpg' => 'video/mpeg', 'mpga' => 'audio/mpeg', 'mpl' => 'video/mp2t', 'mpls' => 'video/mp2t', 'mpp' => 'audio/x-musepack', 'mrl' => 'text/x-mrml', 'mrml' => 'text/x-mrml', 'mrw' => 'image/x-minolta-mrw', 'ms' => 'text/x-troff-ms', 'msi' => 'application/x-msi', 'msod' => 'image/x-msod', 'msx' => 'application/x-msx-rom', 'mtm' => 'audio/x-mod', 'mts' => 'video/mp2t', 'mup' => 'text/x-mup', 'mxf' => 'application/mxf', 'mxu' => 'video/vnd.mpegurl', 'n64' => 'application/x-n64-rom', 'nb' => 'application/mathematica', 'nc' => 'application/x-netcdf', 'nds' => 'application/x-nintendo-ds-rom', 'nef' => 'image/x-nikon-nef', 'nes' => 'application/x-nes-rom', 'nez' => 'application/x-nes-rom', 'nfo' => 'text/x-nfo', 'not' => 'text/x-mup', 'nsc' => 'application/x-netshow-channel', 'nsv' => 'video/x-nsv', 'nzb' => 'application/x-nzb', 'o' => 'application/x-object', 'obj' => 'application/x-tgif', 'ocl' => 'text/x-ocl', 'oda' => 'application/oda', 'odb' => 'application/vnd.oasis.opendocument.database', 'odc' => 'application/vnd.oasis.opendocument.chart', 'odf' => 'application/vnd.oasis.opendocument.formula', 'odg' => 'application/vnd.oasis.opendocument.graphics', 'odi' => 'application/vnd.oasis.opendocument.image', 'odm' => 'application/vnd.oasis.opendocument.text-master', 'odp' => 'application/vnd.oasis.opendocument.presentation', 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', 'odt' => 'application/vnd.oasis.opendocument.text', 'oga' => 'audio/ogg', 'ogg' => 'audio/ogg', 'ogm' => 'video/x-ogm+ogg', 'ogv' => 'video/ogg', 'ogx' => 'application/ogg', 'old' => 'application/x-trash', 'oleo' => 'application/x-oleo', 'ooc' => 'text/x-ooc', 'opml' => 'text/x-opml+xml', 'oprc' => 'application/vnd.palm', 'opus' => 'audio/ogg', 'ora' => 'image/openraster', 'orf' => 'image/x-olympus-orf', 'otc' => 'application/vnd.oasis.opendocument.chart-template', 'otf' => 'application/vnd.oasis.opendocument.formula-template', 'otg' => 'application/vnd.oasis.opendocument.graphics-template', 'oth' => 'application/vnd.oasis.opendocument.text-web', 'otp' => 'application/vnd.oasis.opendocument.presentation-template', 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', 'ott' => 'application/vnd.oasis.opendocument.text-template', 'owl' => 'application/rdf+xml', 'owx' => 'application/owl+xml', 'oxps' => 'application/oxps', 'oxt' => 'application/vnd.openofficeorg.extension', 'p' => 'text/x-pascal', 'p10' => 'application/pkcs10', 'p12' => 'application/pkcs12', 'p65' => 'application/x-pagemaker', 'p7b' => 'application/x-pkcs7-certificates', 'p7c' => 'application/pkcs7-mime', 'p7m' => 'application/pkcs7-mime', 'p7s' => 'application/pkcs7-signature', 'p8' => 'application/pkcs8', 'pack' => 'application/x-java-pack200', 'pak' => 'application/x-pak', 'par2' => 'application/x-par2', 'part' => 'application/x-partial-download', 'pas' => 'text/x-pascal', 'patch' => 'text/x-patch', 'pbm' => 'image/x-portable-bitmap', 'pcap' => 'application/vnd.tcpdump.pcap', 'pcd' => 'image/x-photo-cd', 'pce' => 'application/x-pc-engine-rom', 'pcf' => 'application/x-font-pcf', 'pcf.gz' => 'application/x-font-pcf', 'pcf.z' => 'application/x-font-pcf', 'pcl' => 'application/vnd.hp-pcl', 'pct' => 'image/x-pict', 'pcx' => 'image/vnd.zbrush.pcx', 'pdb' => 'application/x-aportisdoc', 'pdc' => 'application/x-aportisdoc', 'pdf' => 'application/pdf', 'pdf.bz2' => 'application/x-bzpdf', 'pdf.gz' => 'application/x-gzpdf', 'pdf.xz' => 'application/x-xzpdf', 'pef' => 'image/x-pentax-pef', 'pem' => 'application/x-x509-ca-cert', 'perl' => 'application/x-perl', 'pfa' => 'application/x-font-type1', 'pfb' => 'application/x-font-type1', 'pfx' => 'application/pkcs12', 'pgm' => 'image/x-portable-graymap', 'pgn' => 'application/x-chess-pgn', 'pgp' => 'application/pgp-encrypted', 'php' => 'application/x-php', 'php3' => 'application/x-php', 'php4' => 'application/x-php', 'php5' => 'application/x-php', 'phps' => 'application/x-php', 'pict' => 'image/x-pict', 'pict1' => 'image/x-pict', 'pict2' => 'image/x-pict', 'pk' => 'application/x-tex-pk', 'pkg' => 'application/x-xar', 'pkipath' => 'application/pkix-pkipath', 'pkr' => 'application/pgp-keys', 'pl' => 'application/x-perl', 'pla' => 'audio/x-iriver-pla', 'pln' => 'application/x-planperfect', 'pls' => 'audio/x-scpls', 'pm' => 'application/x-perl', 'pm6' => 'application/x-pagemaker', 'pmd' => 'application/x-pagemaker', 'png' => 'image/png', 'pnm' => 'image/x-portable-anymap', 'pntg' => 'image/x-macpaint', 'po' => 'text/x-gettext-translation', 'pod' => 'application/x-perl', 'por' => 'application/x-spss-por', 'pot' => 'application/vnd.ms-powerpoint', 'potm' => 'application/vnd.ms-powerpoint.template.macroEnabled.12', 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12', 'ppm' => 'image/x-portable-pixmap', 'pps' => 'application/vnd.ms-powerpoint', 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', 'ppt' => 'application/vnd.ms-powerpoint', 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'ppz' => 'application/vnd.ms-powerpoint', 'pqa' => 'application/vnd.palm', 'prc' => 'application/x-mobipocket-ebook', 'ps' => 'application/postscript', 'ps.bz2' => 'application/x-bzpostscript', 'ps.gz' => 'application/x-gzpostscript', 'psd' => 'image/vnd.adobe.photoshop', 'psf' => 'application/x-font-linux-psf', 'psf.gz' => 'application/x-gz-font-linux-psf', 'psflib' => 'audio/x-psflib', 'psid' => 'audio/prs.sid', 'psw' => 'application/x-pocket-word', 'pub' => 'application/vnd.ms-publisher', 'pw' => 'application/x-pw', 'py' => 'text/x-python', 'pyc' => 'application/x-python-bytecode', 'pyo' => 'application/x-python-bytecode', 'pyx' => 'text/x-python', 'qif' => 'application/x-qw', 'qml' => 'text/x-qml', 'qmlproject' => 'text/x-qml', 'qmltypes' => 'text/x-qml', 'qp' => 'application/x-qpress', 'qt' => 'video/quicktime', 'qti' => 'application/x-qtiplot', 'qti.gz' => 'application/x-qtiplot', 'qtif' => 'image/x-quicktime', 'qtl' => 'application/x-quicktime-media-link', 'qtvr' => 'video/quicktime', 'ra' => 'audio/vnd.rn-realaudio', 'raf' => 'image/x-fuji-raf', 'ram' => 'application/ram', 'rar' => 'application/x-rar', 'ras' => 'image/x-cmu-raster', 'raw' => 'image/x-panasonic-raw', 'raw-disk-image' => 'application/x-raw-disk-image', 'raw-disk-image.xz' => 'application/x-raw-disk-image-xz-compressed', 'rax' => 'audio/vnd.rn-realaudio', 'rb' => 'application/x-ruby', 'rdf' => 'application/rdf+xml', 'rdfs' => 'application/rdf+xml', 'reg' => 'text/x-ms-regedit', 'rej' => 'text/x-reject', 'rgb' => 'image/x-rgb', 'rle' => 'image/rle', 'rm' => 'application/vnd.rn-realmedia', 'rmj' => 'application/vnd.rn-realmedia', 'rmm' => 'application/vnd.rn-realmedia', 'rms' => 'application/vnd.rn-realmedia', 'rmvb' => 'application/vnd.rn-realmedia', 'rmx' => 'application/vnd.rn-realmedia', 'rnc' => 'application/relax-ng-compact-syntax', 'rng' => 'application/xml', 'roff' => 'text/troff', 'rp' => 'image/vnd.rn-realpix', 'rpm' => 'application/x-rpm', 'rs' => 'text/rust', 'rss' => 'application/rss+xml', 'rt' => 'text/vnd.rn-realtext', 'rtf' => 'application/rtf', 'rtx' => 'text/richtext', 'rv' => 'video/vnd.rn-realvideo', 'rvx' => 'video/vnd.rn-realvideo', 'rw2' => 'image/x-panasonic-raw2', 's3m' => 'audio/x-s3m', 'sam' => 'application/x-amipro', 'sami' => 'application/x-sami', 'sav' => 'application/x-spss-sav', 'scala' => 'text/x-scala', 'scm' => 'text/x-scheme', 'sda' => 'application/vnd.stardivision.draw', 'sdc' => 'application/vnd.stardivision.calc', 'sdd' => 'application/vnd.stardivision.impress', 'sdp' => 'application/vnd.stardivision.impress', 'sds' => 'application/vnd.stardivision.chart', 'sdw' => 'application/vnd.stardivision.writer', 'sfc' => 'application/vnd.nintendo.snes.rom', 'sg' => 'application/x-sms-rom', 'sgb' => 'application/x-gameboy-rom', 'sgf' => 'application/x-go-sgf', 'sgi' => 'image/x-sgi', 'sgl' => 'application/vnd.stardivision.writer', 'sgm' => 'text/sgml', 'sgml' => 'text/sgml', 'sh' => 'application/x-shellscript', 'shape' => 'application/x-dia-shape', 'shar' => 'application/x-shar', 'shn' => 'application/x-shorten', 'siag' => 'application/x-siag', 'sid' => 'audio/prs.sid', 'sig' => 'application/pgp-signature', 'sik' => 'application/x-trash', 'sis' => 'application/vnd.symbian.install', 'sisx' => 'x-epoc/x-sisx-app', 'sit' => 'application/x-stuffit', 'siv' => 'application/sieve', 'sk' => 'image/x-skencil', 'sk1' => 'image/x-skencil', 'skr' => 'application/pgp-keys', 'sldm' => 'application/vnd.ms-powerpoint.slide.macroEnabled.12', 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', 'slk' => 'text/spreadsheet', 'smaf' => 'application/x-smaf', 'smc' => 'application/vnd.nintendo.snes.rom', 'smd' => 'application/vnd.stardivision.mail', 'smf' => 'application/vnd.stardivision.math', 'smi' => 'application/smil+xml', 'smil' => 'application/smil+xml', 'sml' => 'application/smil+xml', 'sms' => 'application/x-sms-rom', 'snd' => 'audio/basic', 'so' => 'application/x-sharedlib', 'spc' => 'application/x-pkcs7-certificates', 'spd' => 'application/x-font-speedo', 'spec' => 'text/x-rpm-spec', 'spl' => 'application/vnd.adobe.flash.movie', 'spm' => 'application/x-source-rpm', 'spx' => 'audio/x-speex', 'sql' => 'application/sql', 'sr2' => 'image/x-sony-sr2', 'src' => 'application/x-wais-source', 'src.rpm' => 'application/x-source-rpm', 'srf' => 'image/x-sony-srf', 'srt' => 'application/x-subrip', 'ss' => 'text/x-scheme', 'ssa' => 'text/x-ssa', 'stc' => 'application/vnd.sun.xml.calc.template', 'std' => 'application/vnd.sun.xml.draw.template', 'sti' => 'application/vnd.sun.xml.impress.template', 'stm' => 'audio/x-stm', 'stw' => 'application/vnd.sun.xml.writer.template', 'sty' => 'text/x-tex', 'sub' => 'text/x-microdvd', 'sun' => 'image/x-sun-raster', 'sv' => 'text/x-svsrc', 'sv4cpio' => 'application/x-sv4cpio', 'sv4crc' => 'application/x-sv4crc', 'svg' => 'image/svg+xml', 'svgz' => 'image/svg+xml-compressed', 'svh' => 'text/x-svhdr', 'swf' => 'application/vnd.adobe.flash.movie', 'swm' => 'application/x-ms-wim', 'sxc' => 'application/vnd.sun.xml.calc', 'sxd' => 'application/vnd.sun.xml.draw', 'sxg' => 'application/vnd.sun.xml.writer.global', 'sxi' => 'application/vnd.sun.xml.impress', 'sxm' => 'application/vnd.sun.xml.math', 'sxw' => 'application/vnd.sun.xml.writer', 'sylk' => 'text/spreadsheet', 't' => 'application/x-perl', 't2t' => 'text/x-txt2tags', 'tar' => 'application/x-tar', 'tar.bz' => 'application/x-bzip-compressed-tar', 'tar.bz2' => 'application/x-bzip-compressed-tar', 'tar.gz' => 'application/x-compressed-tar', 'tar.lrz' => 'application/x-lrzip-compressed-tar', 'tar.lzma' => 'application/x-lzma-compressed-tar', 'tar.lzo' => 'application/x-tzo', 'tar.xz' => 'application/x-xz-compressed-tar', 'tar.z' => 'application/x-tarz', 'taz' => 'application/x-tarz', 'tb2' => 'application/x-bzip-compressed-tar', 'tbz' => 'application/x-bzip-compressed-tar', 'tbz2' => 'application/x-bzip-compressed-tar', 'tcl' => 'text/x-tcl', 'tex' => 'text/x-tex', 'texi' => 'text/x-texinfo', 'texinfo' => 'text/x-texinfo', 'tga' => 'image/x-tga', 'tgz' => 'application/x-compressed-tar', 'theme' => 'application/x-theme', 'themepack' => 'application/x-windows-themepack', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'tk' => 'text/x-tcl', 'tlrz' => 'application/x-lrzip-compressed-tar', 'tlz' => 'application/x-lzma-compressed-tar', 'tnef' => 'application/vnd.ms-tnef', 'tnf' => 'application/vnd.ms-tnef', 'toc' => 'application/x-cdrdao-toc', 'torrent' => 'application/x-bittorrent', 'tpic' => 'image/x-tga', 'tr' => 'text/troff', 'trig' => 'application/x-trig', 'ts' => 'text/vnd.trolltech.linguist', 'tsv' => 'text/tab-separated-values', 'tta' => 'audio/x-tta', 'ttc' => 'application/x-font-ttf', 'ttf' => 'application/x-font-ttf', 'ttl' => 'text/turtle', 'ttx' => 'application/x-font-ttx', 'txt' => 'text/plain', 'txz' => 'application/x-xz-compressed-tar', 'tzo' => 'application/x-tzo', 'udeb' => 'application/vnd.debian.binary-package', 'ufraw' => 'application/x-ufraw', 'ui' => 'application/x-designer', 'uil' => 'text/x-uil', 'ult' => 'audio/x-mod', 'unf' => 'application/x-nes-rom', 'uni' => 'audio/x-mod', 'unif' => 'application/x-nes-rom', 'url' => 'application/x-mswinurl', 'ustar' => 'application/x-ustar', 'uue' => 'text/x-uuencode', 'v' => 'text/x-verilog', 'v64' => 'application/x-n64-rom', 'vala' => 'text/x-vala', 'vapi' => 'text/x-vala', 'vcard' => 'text/vcard', 'vcf' => 'text/vcard', 'vcs' => 'text/calendar', 'vct' => 'text/vcard', 'vda' => 'image/x-tga', 'vhd' => 'text/x-vhdl', 'vhdl' => 'text/x-vhdl', 'viv' => 'video/vnd.vivo', 'vivo' => 'video/vnd.vivo', 'vlc' => 'audio/x-mpegurl', 'vob' => 'video/mpeg', 'voc' => 'audio/x-voc', 'vor' => 'application/vnd.stardivision.writer', 'vrm' => 'model/vrml', 'vrml' => 'model/vrml', 'vsd' => 'application/vnd.visio', 'vsdm' => 'application/vnd.ms-visio.drawing.macroEnabled.main+xml', 'vsdx' => 'application/vnd.ms-visio.drawing.main+xml', 'vss' => 'application/vnd.visio', 'vssm' => 'application/vnd.ms-visio.stencil.macroEnabled.main+xml', 'vssx' => 'application/vnd.ms-visio.stencil.main+xml', 'vst' => 'application/vnd.visio', 'vstm' => 'application/vnd.ms-visio.template.macroEnabled.main+xml', 'vstx' => 'application/vnd.ms-visio.template.main+xml', 'vsw' => 'application/vnd.visio', 'vtt' => 'text/vtt', 'wad' => 'application/x-wii-wad', 'wav' => 'audio/x-wav', 'wax' => 'audio/x-ms-asx', 'wb1' => 'application/x-quattropro', 'wb2' => 'application/x-quattropro', 'wb3' => 'application/x-quattropro', 'wbmp' => 'image/vnd.wap.wbmp', 'wcm' => 'application/vnd.ms-works', 'wdb' => 'application/vnd.ms-works', 'webm' => 'video/webm', 'webp' => 'image/webp', 'wim' => 'application/x-ms-wim', 'wk1' => 'application/vnd.lotus-1-2-3', 'wk3' => 'application/vnd.lotus-1-2-3', 'wk4' => 'application/vnd.lotus-1-2-3', 'wkdownload' => 'application/x-partial-download', 'wks' => 'application/vnd.lotus-1-2-3', 'wma' => 'audio/x-ms-wma', 'wmf' => 'image/x-wmf', 'wml' => 'text/vnd.wap.wml', 'wmls' => 'text/vnd.wap.wmlscript', 'wmv' => 'video/x-ms-wmv', 'wmx' => 'audio/x-ms-asx', 'woff' => 'application/font-woff', 'wp' => 'application/vnd.wordperfect', 'wp4' => 'application/vnd.wordperfect', 'wp5' => 'application/vnd.wordperfect', 'wp6' => 'application/vnd.wordperfect', 'wpd' => 'application/vnd.wordperfect', 'wpg' => 'application/x-wpg', 'wpl' => 'application/vnd.ms-wpl', 'wpp' => 'application/vnd.wordperfect', 'wps' => 'application/vnd.ms-works', 'wri' => 'application/x-mswrite', 'wrl' => 'model/vrml', 'wsgi' => 'text/x-python', 'wv' => 'audio/x-wavpack', 'wvc' => 'audio/x-wavpack-correction', 'wvp' => 'audio/x-wavpack', 'wvx' => 'audio/x-ms-asx', 'wwf' => 'application/x-wwf', 'x3f' => 'image/x-sigma-x3f', 'xac' => 'application/x-gnucash', 'xar' => 'application/x-xar', 'xbel' => 'application/x-xbel', 'xbl' => 'application/xml', 'xbm' => 'image/x-xbitmap', 'xcf' => 'image/x-xcf', 'xcf.bz2' => 'image/x-compressed-xcf', 'xcf.gz' => 'image/x-compressed-xcf', 'xdgapp' => 'application/vnd.xdgapp', 'xht' => 'application/xhtml+xml', 'xhtml' => 'application/xhtml+xml', 'xi' => 'audio/x-xi', 'xla' => 'application/vnd.ms-excel', 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', 'xlc' => 'application/vnd.ms-excel', 'xld' => 'application/vnd.ms-excel', 'xlf' => 'application/x-xliff', 'xliff' => 'application/x-xliff', 'xll' => 'application/vnd.ms-excel', 'xlm' => 'application/vnd.ms-excel', 'xlr' => 'application/vnd.ms-works', 'xls' => 'application/vnd.ms-excel', 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'xlt' => 'application/vnd.ms-excel', 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12', 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', 'xlw' => 'application/vnd.ms-excel', 'xm' => 'audio/x-xm', 'xmf' => 'audio/x-xmf', 'xmi' => 'text/x-xmi', 'xml' => 'application/xml', 'xpi' => 'application/x-xpinstall', 'xpm' => 'image/x-xpixmap', 'xps' => 'application/oxps', 'xsd' => 'application/xml', 'xsl' => 'application/xslt+xml', 'xslfo' => 'text/x-xslfo', 'xslt' => 'application/xslt+xml', 'xspf' => 'application/xspf+xml', 'xul' => 'application/vnd.mozilla.xul+xml', 'xwd' => 'image/x-xwindowdump', 'xz' => 'application/x-xz', 'yaml' => 'application/x-yaml', 'yml' => 'application/x-yaml', 'z' => 'application/x-compress', 'z64' => 'application/x-n64-rom', 'zabw' => 'application/x-abiword', 'zip' => 'application/zip', 'zoo' => 'application/x-zoo', 'zsav' => 'application/x-spss-sav', 'zz' => 'application/zlib', } # @private # :nodoc: TYPES = { 'application/andrew-inset' => [%w(ez), %w(), 'ATK inset'], 'application/annodex' => [%w(anx), %w(), 'Annodex exchange format'], 'application/atom+xml' => [%w(atom), %w(application/xml), 'Atom syndication feed'], 'application/dicom' => [%w(dcm), %w(), 'DICOM image'], 'application/ecmascript' => [%w(es), %w(text/plain), 'ECMAScript program'], 'application/epub+zip' => [%w(epub), %w(application/zip), 'electronic book document'], 'application/font-woff' => [%w(woff), %w(), 'WOFF font'], 'application/gml+xml' => [%w(gml), %w(application/xml), 'GML document'], 'application/gnunet-directory' => [%w(gnd), %w(), 'GNUnet search file'], 'application/gpx+xml' => [%w(gpx), %w(application/xml), 'GPX geographic data'], 'application/gzip' => [%w(gz), %w(), 'Gzip archive'], 'application/illustrator' => [%w(ai), %w(), 'Adobe Illustrator document'], 'application/javascript' => [%w(js jsm), %w(application/ecmascript), 'JavaScript program'], 'application/jrd+json' => [%w(jrd), %w(application/json), 'JRD document'], 'application/json' => [%w(json), %w(application/javascript), 'JSON document'], 'application/json-patch+json' => [%w(json-patch), %w(application/json), 'JSON patch'], 'application/ld+json' => [%w(jsonld), %w(application/json), 'JSON-LD document'], 'application/mathematica' => [%w(nb), %w(text/plain), 'Mathematica Notebook'], 'application/mathml+xml' => [%w(mml), %w(application/xml), 'MathML document'], 'application/mbox' => [%w(mbox), %w(text/plain), 'mailbox file'], 'application/metalink+xml' => [%w(metalink), %w(application/xml), 'Metalink file'], 'application/metalink4+xml' => [%w(meta4), %w(application/xml), 'Metalink file'], 'application/msword' => [%w(doc), %w(application/x-ole-storage), 'Word document'], 'application/msword-template' => [%w(dot), %w(application/msword), 'Word template'], 'application/mxf' => [%w(mxf), %w(), 'MXF video'], 'application/octet-stream' => [%w(bin), %w(), 'unknown'], 'application/oda' => [%w(oda), %w(), 'ODA document'], 'application/ogg' => [%w(ogx), %w(), 'Ogg multimedia file'], 'application/owl+xml' => [%w(owx), %w(application/xml), 'OWL XML file'], 'application/oxps' => [%w(oxps xps), %w(application/zip), 'XPS document'], 'application/pdf' => [%w(pdf), %w(), 'PDF document'], 'application/pgp-encrypted' => [%w(asc gpg pgp), %w(text/plain), 'PGP/MIME-encrypted message header'], 'application/pgp-keys' => [%w(asc gpg pgp pkr skr), %w(text/plain), 'PGP keys'], 'application/pgp-signature' => [%w(asc gpg pgp sig), %w(text/plain), 'detached OpenPGP signature'], 'application/pkcs10' => [%w(p10), %w(), 'PKCS#10 certification request'], 'application/pkcs12' => [%w(p12 pfx), %w(), 'PKCS#12 certificate bundle'], 'application/pkcs7-mime' => [%w(p7c p7m), %w(), 'PKCS#7 Message or Certificate'], 'application/pkcs7-signature' => [%w(p7s), %w(text/plain), 'detached S/MIME signature'], 'application/pkcs8' => [%w(p8), %w(), 'PKCS#8 private key'], 'application/pkix-cert' => [%w(cer), %w(), 'X.509 certificate'], 'application/pkix-crl' => [%w(crl), %w(), 'Certificate revocation list'], 'application/pkix-pkipath' => [%w(pkipath), %w(), 'PkiPath certification path'], 'application/postscript' => [%w(ps), %w(text/plain), 'PS document'], 'application/ram' => [%w(ram), %w(), 'RealMedia Metafile'], 'application/rdf+xml' => [%w(owl rdf rdfs), %w(application/xml), 'RDF file'], 'application/relax-ng-compact-syntax' => [%w(rnc), %w(text/plain), 'RELAX NG XML schema'], 'application/rss+xml' => [%w(rss), %w(application/xml), 'RSS summary'], 'application/rtf' => [%w(rtf), %w(text/plain), 'RTF document'], 'application/sdp' => [%w(sdp), %w(text/plain), 'SDP multicast stream file'], 'application/sieve' => [%w(siv), %w(application/xml), 'Sieve mail filter script'], 'application/smil+xml' => [%w(kino smi smil sml), %w(application/xml), 'SMIL document'], 'application/sql' => [%w(sql), %w(text/plain), 'SQL code'], 'application/vnd.adobe.flash.movie' => [%w(spl swf), %w(), 'Shockwave Flash file'], 'application/vnd.android.package-archive' => [%w(apk), %w(application/x-java-archive), 'Android package'], 'application/vnd.apple.mpegurl' => [%w(m3u m3u8), %w(text/plain), 'HTTP Live Streaming playlist'], 'application/vnd.coffeescript' => [%w(coffee), %w(text/plain), 'CoffeeScript document'], 'application/vnd.corel-draw' => [%w(cdr), %w(), 'Corel Draw drawing'], 'application/vnd.debian.binary-package' => [%w(deb udeb), %w(), 'Debian package'], 'application/vnd.emusic-emusic_package' => [%w(emp), %w(), 'eMusic download package'], 'application/vnd.geo+json' => [%w(geo.json geojson), %w(application/json), 'GeoJSON geospatial data'], 'application/vnd.google-earth.kml+xml' => [%w(kml), %w(application/xml), 'KML geographic data'], 'application/vnd.google-earth.kmz' => [%w(kmz), %w(application/zip), 'KML geographic compressed data'], 'application/vnd.hp-hpgl' => [%w(hpgl), %w(), 'HPGL file'], 'application/vnd.hp-pcl' => [%w(pcl), %w(), 'PCL file'], 'application/vnd.iccprofile' => [%w(icc icm), %w(), 'ICC profile'], 'application/vnd.lotus-1-2-3' => [%w(123 wk1 wk3 wk4 wks), %w(), 'Lotus 1-2-3 spreadsheet'], 'application/vnd.lotus-wordpro' => [%w(lwp), %w(), 'Lotus Word Pro'], 'application/vnd.mozilla.xul+xml' => [%w(xul), %w(application/xml), 'XUL interface document'], 'application/vnd.ms-access' => [%w(mdb), %w(), 'JET database'], 'application/vnd.ms-asf' => [%w(asf), %w(), 'ASF video'], 'application/vnd.ms-cab-compressed' => [%w(cab), %w(), 'Microsoft Cabinet archive'], 'application/vnd.ms-excel' => [%w(xla xlc xld xll xlm xls xlt xlw), %w(), 'Excel spreadsheet'], 'application/vnd.ms-excel.addin.macroEnabled.12' => [%w(xlam), %w(application/vnd.openxmlformats-officedocument.spreadsheetml.sheet), 'Excel add-in'], 'application/vnd.ms-excel.sheet.binary.macroEnabled.12' => [%w(xlsb), %w(application/vnd.openxmlformats-officedocument.spreadsheetml.sheet), 'Excel 2007 binary spreadsheet'], 'application/vnd.ms-excel.sheet.macroEnabled.12' => [%w(xlsm), %w(application/vnd.openxmlformats-officedocument.spreadsheetml.sheet), 'Excel spreadsheet'], 'application/vnd.ms-excel.template.macroEnabled.12' => [%w(xltm), %w(application/vnd.openxmlformats-officedocument.spreadsheetml.template), 'Excel spreadsheet template'], 'application/vnd.ms-htmlhelp' => [%w(chm), %w(), 'CHM document'], 'application/vnd.ms-powerpoint' => [%w(pot pps ppt ppz), %w(), 'PowerPoint presentation'], 'application/vnd.ms-powerpoint.addin.macroEnabled.12' => [%w(ppam), %w(), 'PowerPoint add-in'], 'application/vnd.ms-powerpoint.presentation.macroEnabled.12' => [%w(pptm), %w(application/vnd.openxmlformats-officedocument.presentationml.presentation), 'PowerPoint presentation'], 'application/vnd.ms-powerpoint.slide.macroEnabled.12' => [%w(sldm), %w(application/vnd.openxmlformats-officedocument.presentationml.slide), 'PowerPoint slide'], 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12' => [%w(ppsm), %w(application/vnd.openxmlformats-officedocument.presentationml.slideshow), 'PowerPoint presentation'], 'application/vnd.ms-powerpoint.template.macroEnabled.12' => [%w(potm), %w(application/vnd.openxmlformats-officedocument.presentationml.template), 'PowerPoint presentation template'], 'application/vnd.ms-publisher' => [%w(pub), %w(application/x-ole-storage), 'Microsoft Publisher document'], 'application/vnd.ms-tnef' => [%w(tnef tnf), %w(), 'TNEF message'], 'application/vnd.ms-visio.drawing.macroEnabled.main+xml' => [%w(vsdm), %w(application/zip), 'Office Open XML Visio Drawing'], 'application/vnd.ms-visio.drawing.main+xml' => [%w(vsdx), %w(application/zip), 'Office Open XML Visio Drawing'], 'application/vnd.ms-visio.stencil.macroEnabled.main+xml' => [%w(vssm), %w(application/zip), 'Office Open XML Visio Stencil'], 'application/vnd.ms-visio.stencil.main+xml' => [%w(vssx), %w(application/zip), 'Office Open XML Visio Stencil'], 'application/vnd.ms-visio.template.macroEnabled.main+xml' => [%w(vstm), %w(application/zip), 'Office Open XML Visio Template'], 'application/vnd.ms-visio.template.main+xml' => [%w(vstx), %w(application/zip), 'Office Open XML Visio Template'], 'application/vnd.ms-word.document.macroEnabled.12' => [%w(docm), %w(application/vnd.openxmlformats-officedocument.wordprocessingml.document), 'Word document'], 'application/vnd.ms-word.template.macroEnabled.12' => [%w(dotm), %w(application/vnd.openxmlformats-officedocument.wordprocessingml.template), 'Word document template'], 'application/vnd.ms-works' => [%w(wcm wdb wks wps xlr), %w(application/x-ole-storage), 'Microsoft Works document'], 'application/vnd.ms-wpl' => [%w(wpl), %w(), 'WPL playlist'], 'application/vnd.nintendo.snes.rom' => [%w(sfc smc), %w(), 'Super NES ROM'], 'application/vnd.oasis.opendocument.chart' => [%w(odc), %w(application/zip), 'ODC chart'], 'application/vnd.oasis.opendocument.chart-template' => [%w(otc), %w(application/zip), 'ODC template'], 'application/vnd.oasis.opendocument.database' => [%w(odb), %w(application/zip), 'ODB database'], 'application/vnd.oasis.opendocument.formula' => [%w(odf), %w(application/zip), 'ODF formula'], 'application/vnd.oasis.opendocument.formula-template' => [%w(otf), %w(application/zip), 'ODF template'], 'application/vnd.oasis.opendocument.graphics' => [%w(odg), %w(application/zip), 'ODG drawing'], 'application/vnd.oasis.opendocument.graphics-flat-xml' => [%w(fodg), %w(application/xml), 'ODG drawing (Flat XML)'], 'application/vnd.oasis.opendocument.graphics-template' => [%w(otg), %w(application/zip), 'ODG template'], 'application/vnd.oasis.opendocument.image' => [%w(odi), %w(application/zip), 'ODI image'], 'application/vnd.oasis.opendocument.presentation' => [%w(odp), %w(application/zip), 'ODP presentation'], 'application/vnd.oasis.opendocument.presentation-flat-xml' => [%w(fodp), %w(application/xml), 'ODP presentation (Flat XML)'], 'application/vnd.oasis.opendocument.presentation-template' => [%w(otp), %w(application/zip), 'ODP template'], 'application/vnd.oasis.opendocument.spreadsheet' => [%w(ods), %w(application/zip), 'ODS spreadsheet'], 'application/vnd.oasis.opendocument.spreadsheet-flat-xml' => [%w(fods), %w(application/xml), 'ODS spreadsheet (Flat XML)'], 'application/vnd.oasis.opendocument.spreadsheet-template' => [%w(ots), %w(application/zip), 'ODS template'], 'application/vnd.oasis.opendocument.text' => [%w(odt), %w(application/zip), 'ODT document'], 'application/vnd.oasis.opendocument.text-flat-xml' => [%w(fodt), %w(application/xml), 'ODT document (Flat XML)'], 'application/vnd.oasis.opendocument.text-master' => [%w(odm), %w(application/zip), 'ODM document'], 'application/vnd.oasis.opendocument.text-template' => [%w(ott), %w(application/zip), 'ODT template'], 'application/vnd.oasis.opendocument.text-web' => [%w(oth), %w(application/zip), 'OTH template'], 'application/vnd.openofficeorg.extension' => [%w(oxt), %w(application/zip), 'OpenOffice.org extension'], 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => [%w(pptx), %w(application/zip), 'PowerPoint 2007 presentation'], 'application/vnd.openxmlformats-officedocument.presentationml.slide' => [%w(sldx), %w(application/zip), 'PowerPoint 2007 slide'], 'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => [%w(ppsx), %w(application/zip), 'PowerPoint 2007 show'], 'application/vnd.openxmlformats-officedocument.presentationml.template' => [%w(potx), %w(application/zip), 'PowerPoint 2007 presentation template'], 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => [%w(xlsx), %w(application/zip), 'Excel 2007 spreadsheet'], 'application/vnd.openxmlformats-officedocument.spreadsheetml.template' => [%w(xltx), %w(application/zip), 'Excel 2007 spreadsheet template'], 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => [%w(docx), %w(application/zip), 'Word 2007 document'], 'application/vnd.openxmlformats-officedocument.wordprocessingml.template' => [%w(dotx), %w(application/zip), 'Word 2007 document template'], 'application/vnd.palm' => [%w(oprc pdb pqa prc), %w(), 'Palm OS database'], 'application/vnd.rn-realmedia' => [%w(rm rmj rmm rms rmvb rmx), %w(), 'RealMedia document'], 'application/vnd.stardivision.calc' => [%w(sdc), %w(), 'StarCalc spreadsheet'], 'application/vnd.stardivision.chart' => [%w(sds), %w(), 'StarChart chart'], 'application/vnd.stardivision.draw' => [%w(sda), %w(), 'StarDraw drawing'], 'application/vnd.stardivision.impress' => [%w(sdd sdp), %w(), 'StarImpress presentation'], 'application/vnd.stardivision.mail' => [%w(smd), %w(), 'StarMail email'], 'application/vnd.stardivision.math' => [%w(smf), %w(), 'StarMath formula'], 'application/vnd.stardivision.writer' => [%w(sdw sgl vor), %w(), 'StarWriter document'], 'application/vnd.sun.xml.calc' => [%w(sxc), %w(application/zip), 'OpenOffice Calc spreadsheet'], 'application/vnd.sun.xml.calc.template' => [%w(stc), %w(application/zip), 'OpenOffice Calc template'], 'application/vnd.sun.xml.draw' => [%w(sxd), %w(application/zip), 'OpenOffice Draw drawing'], 'application/vnd.sun.xml.draw.template' => [%w(std), %w(application/zip), 'OpenOffice Draw template'], 'application/vnd.sun.xml.impress' => [%w(sxi), %w(application/zip), 'OpenOffice Impress presentation'], 'application/vnd.sun.xml.impress.template' => [%w(sti), %w(application/zip), 'OpenOffice Impress template'], 'application/vnd.sun.xml.math' => [%w(sxm), %w(application/zip), 'OpenOffice Math formula'], 'application/vnd.sun.xml.writer' => [%w(sxw), %w(application/zip), 'OpenOffice Writer document'], 'application/vnd.sun.xml.writer.global' => [%w(sxg), %w(application/zip), 'OpenOffice Writer global document'], 'application/vnd.sun.xml.writer.template' => [%w(stw), %w(application/zip), 'OpenOffice Writer template'], 'application/vnd.symbian.install' => [%w(sis), %w(), 'SIS package'], 'application/vnd.tcpdump.pcap' => [%w(cap dmp pcap), %w(), 'Network Packet Capture'], 'application/vnd.visio' => [%w(vsd vss vst vsw), %w(application/x-ole-storage), 'Microsoft Visio document'], 'application/vnd.wordperfect' => [%w(wp wp4 wp5 wp6 wpd wpp), %w(), 'WordPerfect document'], 'application/vnd.xdgapp' => [%w(xdgapp), %w(), 'XDG application bundle'], 'application/winhlp' => [%w(hlp), %w(), 'WinHelp help file'], 'application/x-7z-compressed' => [%w(7z), %w(), '7-zip archive'], 'application/x-abiword' => [%w(abw abw.crashed abw.gz zabw), %w(application/xml), 'AbiWord document'], 'application/x-ace' => [%w(ace), %w(), 'ACE archive'], 'application/x-alz' => [%w(alz), %w(), 'Alzip archive'], 'application/x-amiga-disk-format' => [%w(adf), %w(), 'Amiga disk image'], 'application/x-amipro' => [%w(sam), %w(), 'Lotus AmiPro document'], 'application/x-aportisdoc' => [%w(pdb pdc), %w(application/x-palm-database), 'AportisDoc document'], 'application/x-apple-diskimage' => [%w(dmg), %w(), 'Apple disk image'], 'application/x-applix-spreadsheet' => [%w(as), %w(), 'Applix Spreadsheets spreadsheet'], 'application/x-applix-word' => [%w(aw), %w(), 'Applix Words document'], 'application/x-archive' => [%w(a ar), %w(), 'AR archive'], 'application/x-arj' => [%w(arj), %w(), 'ARJ archive'], 'application/x-asp' => [%w(asp), %w(text/plain), 'ASP page'], 'application/x-awk' => [%w(awk), %w(application/x-executable text/plain), 'AWK script'], 'application/x-bcpio' => [%w(bcpio), %w(), 'BCPIO document'], 'application/x-bittorrent' => [%w(torrent), %w(), 'BitTorrent seed file'], 'application/x-blender' => [%w(blend blend blender), %w(), 'Blender scene'], 'application/x-bzdvi' => [%w(dvi.bz2), %w(application/x-bzip), 'TeX DVI document (bzip-compressed)'], 'application/x-bzip' => [%w(bz bz2), %w(), 'Bzip archive'], 'application/x-bzip-compressed-tar' => [%w(tar.bz tar.bz2 tb2 tbz tbz2), %w(application/x-bzip), 'Tar archive (bzip-compressed)'], 'application/x-bzpdf' => [%w(pdf.bz2), %w(application/x-bzip), 'PDF document (bzip-compressed)'], 'application/x-bzpostscript' => [%w(ps.bz2), %w(application/x-bzip), 'PostScript document (bzip-compressed)'], 'application/x-cb7' => [%w(cb7), %w(application/x-7z-compressed), 'comic book archive'], 'application/x-cbr' => [%w(cbr), %w(application/x-rar), 'comic book archive'], 'application/x-cbt' => [%w(cbt), %w(application/x-tar), 'comic book archive'], 'application/x-cbz' => [%w(cbz), %w(application/zip), 'comic book archive'], 'application/x-ccmx' => [%w(ccmx), %w(text/plain), 'CCMX color correction file'], 'application/x-cd-image' => [%w(iso iso9660), %w(application/x-raw-disk-image), 'raw CD image'], 'application/x-cdrdao-toc' => [%w(toc), %w(text/plain), 'CD Table Of Contents'], 'application/x-chess-pgn' => [%w(pgn), %w(text/plain), 'PGN chess game notation'], 'application/x-cisco-vpn-settings' => [%w(pcf), %w(), 'Cisco VPN Settings'], 'application/x-compress' => [%w(z), %w(), 'UNIX-compressed file'], 'application/x-compressed-tar' => [%w(tar.gz tgz), %w(application/gzip), 'Tar archive (gzip-compressed)'], 'application/x-cpio' => [%w(cpio), %w(), 'CPIO archive'], 'application/x-cpio-compressed' => [%w(cpio.gz), %w(application/gzip), 'CPIO archive (gzip-compressed)'], 'application/x-csh' => [%w(csh), %w(application/x-shellscript text/plain), 'C shell script'], 'application/x-cue' => [%w(cue), %w(text/plain), 'CD image cuesheet'], 'application/x-dar' => [%w(dar), %w(), 'DAR archive'], 'application/x-dbf' => [%w(dbf), %w(), 'Xbase document'], 'application/x-dc-rom' => [%w(dc), %w(), 'Dreamcast GD-ROM'], 'application/x-designer' => [%w(ui), %w(application/xml), 'Qt Designer file'], 'application/x-desktop' => [%w(desktop kdelnk), %w(text/plain), 'desktop configuration file'], 'application/x-dia-diagram' => [%w(dia), %w(application/xml), 'Dia diagram'], 'application/x-dia-shape' => [%w(shape), %w(application/xml), 'Dia shape'], 'application/x-docbook+xml' => [%w(dbk docbook), %w(application/xml), 'DocBook document'], 'application/x-doom-wad' => [%w(wad), %w(), 'Doom WAD'], 'application/x-dvi' => [%w(dvi), %w(), 'TeX DVI document'], 'application/x-e-theme' => [%w(etheme), %w(), 'Enlightenment theme'], 'application/x-egon' => [%w(egon), %w(), 'Egon Animator animation'], 'application/x-fictionbook+xml' => [%w(fb2), %w(application/xml), 'FictionBook document'], 'application/x-fluid' => [%w(fl), %w(text/plain), 'FLTK Fluid file'], 'application/x-font-afm' => [%w(afm), %w(), 'Adobe font metrics'], 'application/x-font-bdf' => [%w(bdf), %w(), 'BDF font'], 'application/x-font-linux-psf' => [%w(psf), %w(), 'Linux PSF console font'], 'application/x-font-otf' => [%w(otf), %w(application/x-font-ttf), 'OpenType font'], 'application/x-font-pcf' => [%w(pcf pcf.gz pcf.z), %w(), 'PCF font'], 'application/x-font-speedo' => [%w(spd), %w(), 'Speedo font'], 'application/x-font-ttf' => [%w(ttc ttf), %w(), 'TrueType font'], 'application/x-font-ttx' => [%w(ttx), %w(text/xml), 'TrueType XML font'], 'application/x-font-type1' => [%w(gsf pfa pfb), %w(application/postscript), 'Postscript type-1 font'], 'application/x-gameboy-rom' => [%w(cgb gb gbc sgb), %w(), 'Game Boy ROM'], 'application/x-gamecube-rom' => [%w(iso), %w(), 'GameCube disc image'], 'application/x-gba-rom' => [%w(agb gba), %w(), 'Game Boy Advance ROM'], 'application/x-gedcom' => [%w(ged gedcom), %w(), 'GEDCOM family history'], 'application/x-genesis-rom' => [%w(32x gen mdx smd), %w(), 'Genesis ROM'], 'application/x-gettext-translation' => [%w(gmo mo), %w(), 'translated messages (machine-readable)'], 'application/x-glade' => [%w(glade), %w(application/xml), 'Glade project'], 'application/x-gnucash' => [%w(gnc gnucash xac), %w(), 'GnuCash financial data'], 'application/x-gnumeric' => [%w(gnumeric), %w(), 'Gnumeric spreadsheet'], 'application/x-gnuplot' => [%w(gnuplot gp gplt), %w(text/plain), 'Gnuplot document'], 'application/x-go-sgf' => [%w(sgf), %w(text/plain), 'SGF record'], 'application/x-graphite' => [%w(gra), %w(), 'Graphite scientific graph'], 'application/x-gtk-builder' => [%w(ui), %w(application/xml), 'GTK+ Builder'], 'application/x-gz-font-linux-psf' => [%w(psf.gz), %w(application/gzip), 'Linux PSF console font (gzip-compressed)'], 'application/x-gzdvi' => [%w(dvi.gz), %w(application/gzip), 'TeX DVI document (gzip-compressed)'], 'application/x-gzpdf' => [%w(pdf.gz), %w(application/gzip), 'PDF document (gzip-compressed)'], 'application/x-gzpostscript' => [%w(ps.gz), %w(application/gzip), 'PostScript document (gzip-compressed)'], 'application/x-hdf' => [%w(h4 h5 hdf hdf4 hdf5), %w(), 'HDF document'], 'application/x-hwp' => [%w(hwp), %w(), 'Haansoft Hangul document'], 'application/x-hwt' => [%w(hwt), %w(), 'Haansoft Hangul document template'], 'application/x-ica' => [%w(ica), %w(text/plain), 'Citrix ICA settings file'], 'application/x-it87' => [%w(it87), %w(text/plain), 'IT 8.7 color calibration file'], 'application/x-iwork-keynote-sffkey' => [%w(key), %w(application/zip), 'Apple Keynote 5 presentation'], 'application/x-java' => [%w(class), %w(), 'Java class'], 'application/x-java-archive' => [%w(jar), %w(application/zip), 'Java archive'], 'application/x-java-jce-keystore' => [%w(jceks), %w(), 'Java JCE keystore'], 'application/x-java-jnlp-file' => [%w(jnlp), %w(application/xml), 'JNLP file'], 'application/x-java-keystore' => [%w(jks ks), %w(), 'Java keystore'], 'application/x-java-pack200' => [%w(pack), %w(), 'Pack200 Java archive'], 'application/x-jbuilder-project' => [%w(jpr jpx), %w(), 'JBuilder project'], 'application/x-karbon' => [%w(karbon), %w(), 'Karbon14 drawing'], 'application/x-kchart' => [%w(chrt), %w(), 'KChart chart'], 'application/x-kexi-connectiondata' => [%w(kexic), %w(), 'Kexi settings for database server connection'], 'application/x-kexiproject-shortcut' => [%w(kexis), %w(), 'shortcut to Kexi project on database server'], 'application/x-kexiproject-sqlite2' => [%w(kexi), %w(application/x-sqlite2), 'Kexi database file-based project'], 'application/x-kexiproject-sqlite3' => [%w(kexi), %w(application/x-sqlite3), 'Kexi database file-based project'], 'application/x-kformula' => [%w(kfo), %w(), 'KFormula formula'], 'application/x-killustrator' => [%w(kil), %w(), 'KIllustrator drawing'], 'application/x-kivio' => [%w(flw), %w(), 'Kivio flowchart'], 'application/x-kontour' => [%w(kon), %w(), 'Kontour drawing'], 'application/x-kpovmodeler' => [%w(kpm), %w(), 'KPovModeler scene'], 'application/x-kpresenter' => [%w(kpr kpt), %w(), 'KPresenter presentation'], 'application/x-krita' => [%w(kra), %w(), 'Krita document'], 'application/x-kspread' => [%w(ksp), %w(), 'KSpread spreadsheet'], 'application/x-kugar' => [%w(kud), %w(), 'Kugar document'], 'application/x-kword' => [%w(kwd kwt), %w(), 'KWord document'], 'application/x-lha' => [%w(lha lzh), %w(), 'LHA archive'], 'application/x-lhz' => [%w(lhz), %w(), 'LHZ archive'], 'application/x-lrzip' => [%w(lrz), %w(), 'Lrzip archive'], 'application/x-lrzip-compressed-tar' => [%w(tar.lrz tlrz), %w(application/x-lrzip), 'Tar archive (lrzip-compressed)'], 'application/x-lyx' => [%w(lyx), %w(text/plain), 'LyX document'], 'application/x-lz4' => [%w(lz4), %w(), 'LZ4 archive'], 'application/x-lzip' => [%w(lz), %w(), 'Lzip archive'], 'application/x-lzma' => [%w(lzma), %w(), 'LZMA archive'], 'application/x-lzma-compressed-tar' => [%w(tar.lzma tlz), %w(application/x-lzma), 'Tar archive (LZMA-compressed)'], 'application/x-lzop' => [%w(lzo), %w(), 'LZO archive'], 'application/x-m4' => [%w(m4), %w(text/plain), 'M4 macro'], 'application/x-magicpoint' => [%w(mgp), %w(text/plain), 'MagicPoint presentation'], 'application/x-markaby' => [%w(mab), %w(application/x-ruby), 'Markaby script'], 'application/x-mif' => [%w(mif), %w(), 'Adobe FrameMaker MIF document'], 'application/x-mimearchive' => [%w(mht mhtml), %w(multipart/related), 'MHTML web archive'], 'application/x-mobipocket-ebook' => [%w(mobi prc), %w(application/x-palm-database), 'Mobipocket e-book'], 'application/x-ms-dos-executable' => [%w(exe), %w(), 'DOS/Windows executable'], 'application/x-ms-wim' => [%w(swm wim), %w(), 'WIM disk Image'], 'application/x-msi' => [%w(msi), %w(application/x-ole-storage), 'Windows Installer package'], 'application/x-mswinurl' => [%w(url), %w(), 'Internet shortcut'], 'application/x-mswrite' => [%w(wri), %w(), 'WRI document'], 'application/x-msx-rom' => [%w(msx), %w(), 'MSX ROM'], 'application/x-n64-rom' => [%w(n64 v64 z64), %w(), 'Nintendo64 ROM'], 'application/x-navi-animation' => [%w(ani), %w(), 'Windows animated cursor'], 'application/x-nes-rom' => [%w(nes nez unf unif), %w(), 'NES ROM'], 'application/x-netcdf' => [%w(cdf nc), %w(), 'Unidata NetCDF document'], 'application/x-netshow-channel' => [%w(nsc), %w(application/vnd.ms-asf), 'Windows Media Station file'], 'application/x-nintendo-ds-rom' => [%w(nds), %w(), 'Nintendo DS ROM'], 'application/x-nzb' => [%w(nzb), %w(application/xml), 'NewzBin usenet index'], 'application/x-object' => [%w(o), %w(), 'object code'], 'application/x-oleo' => [%w(oleo), %w(), 'GNU Oleo spreadsheet'], 'application/x-pagemaker' => [%w(p65 pm pm6 pmd), %w(application/x-ole-storage), 'Adobe PageMaker'], 'application/x-pak' => [%w(pak), %w(), 'PAK archive'], 'application/x-par2' => [%w(par2 par2), %w(), 'Parchive archive'], 'application/x-partial-download' => [%w(crdownload part wkdownload), %w(), 'Partially downloaded file'], 'application/x-pc-engine-rom' => [%w(pce), %w(), 'PC Engine ROM'], 'application/x-perl' => [%w(al perl pl pl pm pod t), %w(application/x-executable text/plain), 'Perl script'], 'application/x-php' => [%w(php php3 php4 php5 phps), %w(text/plain), 'PHP script'], 'application/x-pkcs7-certificates' => [%w(p7b spc), %w(), 'PKCS#7 certificate bundle'], 'application/x-planperfect' => [%w(pln), %w(), 'PlanPerfect spreadsheet'], 'application/x-pocket-word' => [%w(psw), %w(), 'Pocket Word document'], 'application/x-pw' => [%w(pw), %w(), 'Pathetic Writer document'], 'application/x-python-bytecode' => [%w(pyc pyo), %w(), 'Python bytecode'], 'application/x-qpress' => [%w(qp), %w(), 'Qpress archive'], 'application/x-qtiplot' => [%w(qti qti.gz), %w(text/plain), 'QtiPlot document'], 'application/x-quattropro' => [%w(wb1 wb2 wb3), %w(), 'Quattro Pro spreadsheet'], 'application/x-quicktime-media-link' => [%w(qtl), %w(video/quicktime), 'QuickTime metalink playlist'], 'application/x-qw' => [%w(qif), %w(), 'Quicken document'], 'application/x-rar' => [%w(rar), %w(), 'RAR archive'], 'application/x-raw-disk-image' => [%w(img raw-disk-image), %w(), 'Raw disk image'], 'application/x-raw-disk-image-xz-compressed' => [%w(img.xz raw-disk-image.xz), %w(application/x-xz), 'Raw disk image (XZ-compressed)'], 'application/x-rpm' => [%w(rpm), %w(), 'RPM package'], 'application/x-ruby' => [%w(rb), %w(application/x-executable text/plain), 'Ruby script'], 'application/x-sami' => [%w(sami smi), %w(text/plain), 'SAMI subtitles'], 'application/x-saturn-rom' => [%w(bin iso), %w(), 'Sega Saturn disc image'], 'application/x-shar' => [%w(shar), %w(), 'shell archive'], 'application/x-shared-library-la' => [%w(la), %w(text/plain), 'libtool shared library'], 'application/x-sharedlib' => [%w(so), %w(), 'shared library'], 'application/x-shellscript' => [%w(sh), %w(application/x-executable text/plain), 'shell script'], 'application/x-shorten' => [%w(shn), %w(), 'Shorten audio'], 'application/x-siag' => [%w(siag), %w(), 'Siag spreadsheet'], 'application/x-smaf' => [%w(mmf smaf), %w(), 'SMAF audio'], 'application/x-sms-rom' => [%w(gg sg sms), %w(), 'Sega Master System/Game Gear ROM'], 'application/x-source-rpm' => [%w(spm src.rpm), %w(application/x-rpm), 'Source RPM package'], 'application/x-spss-por' => [%w(por), %w(), 'SPSS Portable Data File'], 'application/x-spss-sav' => [%w(sav zsav), %w(), 'SPSS Data File'], 'application/x-stuffit' => [%w(sit), %w(), 'StuffIt archive'], 'application/x-subrip' => [%w(srt), %w(text/plain), 'SubRip subtitles'], 'application/x-sv4cpio' => [%w(sv4cpio), %w(), 'SV4 CPIO archive'], 'application/x-sv4crc' => [%w(sv4crc), %w(), 'SV4 CPIO archive (with CRC)'], 'application/x-t602' => [%w(602), %w(), 'T602 document'], 'application/x-tar' => [%w(gem gtar tar), %w(), 'Tar archive'], 'application/x-tarz' => [%w(tar.z taz), %w(application/x-compress), 'Tar archive (compressed)'], 'application/x-tex-gf' => [%w(gf), %w(), 'generic font file'], 'application/x-tex-pk' => [%w(pk), %w(), 'packed font file'], 'application/x-tgif' => [%w(obj), %w(), 'TGIF document'], 'application/x-theme' => [%w(theme), %w(application/x-desktop), 'theme'], 'application/x-trash' => [%w(bak old sik), %w(), 'backup file'], 'application/x-trig' => [%w(trig), %w(text/plain), 'TriG RDF document'], 'application/x-troff-man' => [%w(man), %w(text/plain), 'Manpage manual document'], 'application/x-tzo' => [%w(tar.lzo tzo), %w(application/x-lzop), 'Tar archive (LZO-compressed)'], 'application/x-ufraw' => [%w(ufraw), %w(text/xml), 'UFRaw ID image'], 'application/x-ustar' => [%w(ustar), %w(), 'Ustar archive'], 'application/x-wais-source' => [%w(src), %w(text/plain), 'WAIS source code'], 'application/x-wii-rom' => [%w(iso), %w(), 'Wii disc image'], 'application/x-wii-wad' => [%w(wad), %w(), 'WiiWare bundle'], 'application/x-windows-themepack' => [%w(themepack), %w(application/vnd.ms-cab-compressed), 'Microsoft Windows theme pack'], 'application/x-wpg' => [%w(wpg), %w(), 'WordPerfect/Drawperfect image'], 'application/x-wwf' => [%w(wwf), %w(application/pdf), 'WWF document'], 'application/x-x509-ca-cert' => [%w(cert crt der pem), %w(), 'DER/PEM/Netscape-encoded X.509 certificate'], 'application/x-xar' => [%w(pkg xar), %w(), 'XAR archive'], 'application/x-xbel' => [%w(xbel), %w(application/xml), 'XBEL bookmarks'], 'application/x-xliff' => [%w(xlf xliff), %w(application/xml), 'XLIFF translation file'], 'application/x-xpinstall' => [%w(xpi), %w(application/zip), 'XPInstall installer module'], 'application/x-xz' => [%w(xz), %w(), 'XZ archive'], 'application/x-xz-compressed-tar' => [%w(tar.xz txz), %w(application/x-xz), 'Tar archive (XZ-compressed)'], 'application/x-xzpdf' => [%w(pdf.xz), %w(application/x-xz), 'PDF document (XZ-compressed)'], 'application/x-yaml' => [%w(yaml yml), %w(text/plain), 'YAML document'], 'application/x-zip-compressed-fb2' => [%w(fb2.zip), %w(application/zip), 'Compressed FictionBook document'], 'application/x-zoo' => [%w(zoo), %w(), 'Zoo archive'], 'application/xhtml+xml' => [%w(xht xhtml), %w(application/xml), 'XHTML page'], 'application/xml' => [%w(rng xbl xml xsd), %w(text/plain), 'XML document'], 'application/xml-dtd' => [%w(dtd), %w(text/plain), 'DTD file'], 'application/xml-external-parsed-entity' => [%w(ent), %w(application/xml), 'XML entities document'], 'application/xslt+xml' => [%w(xsl xslt), %w(application/xml), 'XSLT stylesheet'], 'application/xspf+xml' => [%w(xspf), %w(application/xml), 'XSPF playlist'], 'application/zip' => [%w(zip), %w(), 'Zip archive'], 'application/zlib' => [%w(zz), %w(), 'Zlib archive'], 'audio/AMR' => [%w(amr), %w(), 'AMR audio'], 'audio/AMR-WB' => [%w(awb), %w(), 'AMR-WB audio'], 'audio/aac' => [%w(aac), %w(), 'AAC audio'], 'audio/ac3' => [%w(ac3), %w(), 'Dolby Digital audio'], 'audio/annodex' => [%w(axa), %w(application/annodex), 'Annodex Audio'], 'audio/basic' => [%w(au snd), %w(), 'ULAW (Sun) audio'], 'audio/flac' => [%w(flac), %w(), 'FLAC audio'], 'audio/midi' => [%w(kar mid midi), %w(), 'MIDI audio'], 'audio/mp2' => [%w(mp2), %w(), 'MP2 audio'], 'audio/mp4' => [%w(f4a m4a), %w(), 'MPEG-4 audio'], 'audio/mpeg' => [%w(mp3 mpga), %w(), 'MP3 audio'], 'audio/ogg' => [%w(oga ogg opus), %w(application/ogg), 'Ogg Audio'], 'audio/prs.sid' => [%w(psid sid), %w(), 'Commodore 64 audio'], 'audio/vnd.dts' => [%w(dts), %w(), 'DTS audio'], 'audio/vnd.dts.hd' => [%w(dtshd), %w(audio/vnd.dts), 'DTSHD audio'], 'audio/vnd.rn-realaudio' => [%w(ra rax), %w(), 'RealAudio document'], 'audio/x-aifc' => [%w(aifc aiffc), %w(application/x-iff), 'AIFC audio'], 'audio/x-aiff' => [%w(aif aiff), %w(application/x-iff), 'AIFF/Amiga/Mac audio'], 'audio/x-amzxml' => [%w(amz), %w(), 'AmazonMP3 download file'], 'audio/x-ape' => [%w(ape), %w(), "Monkey's audio"], 'audio/x-flac+ogg' => [%w(oga ogg), %w(audio/ogg), 'Ogg FLAC audio'], 'audio/x-gsm' => [%w(gsm), %w(), 'GSM 06.10 audio'], 'audio/x-iriver-pla' => [%w(pla), %w(), 'iRiver Playlist'], 'audio/x-it' => [%w(it), %w(), 'Impulse Tracker audio'], 'audio/x-m4b' => [%w(f4b m4b), %w(audio/mp4), 'MPEG-4 audio book'], 'audio/x-matroska' => [%w(mka), %w(application/x-matroska), 'Matroska audio'], 'audio/x-minipsf' => [%w(minipsf), %w(audio/x-psf), 'MiniPSF audio'], 'audio/x-mo3' => [%w(mo3), %w(), 'compressed Tracker audio'], 'audio/x-mod' => [%w(669 m15 med mod mtm ult uni), %w(), 'Amiga SoundTracker audio'], 'audio/x-mpegurl' => [%w(m3u m3u8 vlc), %w(text/plain), 'MP3 audio (streamed)'], 'audio/x-ms-asx' => [%w(asx wax wmx wvx), %w(), 'Microsoft ASX playlist'], 'audio/x-ms-wma' => [%w(wma), %w(application/vnd.ms-asf), 'Windows Media audio'], 'audio/x-musepack' => [%w(mp+ mpc mpp), %w(), 'Musepack audio'], 'audio/x-opus+ogg' => [%w(opus), %w(audio/ogg), 'Opus audio'], 'audio/x-psf' => [%w(psf), %w(), 'PSF audio'], 'audio/x-psflib' => [%w(psflib), %w(audio/x-psf), 'PSFlib audio library'], 'audio/x-s3m' => [%w(s3m), %w(), 'Scream Tracker 3 audio'], 'audio/x-scpls' => [%w(pls), %w(), 'MP3 ShoutCast playlist'], 'audio/x-speex' => [%w(spx), %w(), 'Speex audio'], 'audio/x-speex+ogg' => [%w(oga ogg), %w(audio/ogg), 'Ogg Speex audio'], 'audio/x-stm' => [%w(stm), %w(), 'Scream Tracker audio'], 'audio/x-tta' => [%w(tta), %w(), 'TrueAudio audio'], 'audio/x-voc' => [%w(voc), %w(), 'VOC audio'], 'audio/x-vorbis+ogg' => [%w(oga ogg), %w(audio/ogg), 'Ogg Vorbis audio'], 'audio/x-wav' => [%w(wav), %w(), 'WAV audio'], 'audio/x-wavpack' => [%w(wv wvp), %w(), 'WavPack audio'], 'audio/x-wavpack-correction' => [%w(wvc), %w(), 'WavPack audio correction file'], 'audio/x-xi' => [%w(xi), %w(), 'Scream Tracker instrument'], 'audio/x-xm' => [%w(xm), %w(), 'FastTracker II audio'], 'audio/x-xmf' => [%w(xmf), %w(), 'XMF audio'], 'image/bmp' => [%w(bmp), %w(), 'Windows BMP image'], 'image/cgm' => [%w(cgm), %w(), 'Computer Graphics Metafile'], 'image/fax-g3' => [%w(g3), %w(), 'CCITT G3 fax'], 'image/fits' => [%w(fits), %w(), 'FITS document'], 'image/gif' => [%w(gif), %w(), 'GIF image'], 'image/ief' => [%w(ief), %w(), 'IEF image'], 'image/jp2' => [%w(jp2 jpf jpx), %w(), 'JPEG-2000 image'], 'image/jpeg' => [%w(jpe jpeg jpg), %w(), 'JPEG image'], 'image/openraster' => [%w(ora), %w(), 'OpenRaster archiving image'], 'image/png' => [%w(png), %w(), 'PNG image'], 'image/rle' => [%w(rle), %w(), 'Run Length Encoded bitmap image'], 'image/svg+xml' => [%w(svg), %w(application/xml), 'SVG image'], 'image/svg+xml-compressed' => [%w(svgz), %w(application/gzip), 'compressed SVG image'], 'image/tiff' => [%w(tif tiff), %w(), 'TIFF image'], 'image/vnd.adobe.photoshop' => [%w(psd), %w(), 'Photoshop image'], 'image/vnd.djvu' => [%w(djv djvu), %w(), 'DjVu image'], 'image/vnd.dwg' => [%w(dwg), %w(), 'AutoCAD image'], 'image/vnd.dxf' => [%w(dxf), %w(), 'DXF vector image'], 'image/vnd.microsoft.icon' => [%w(ico), %w(), 'Windows icon'], 'image/vnd.ms-modi' => [%w(mdi), %w(), 'Microsoft Document Imaging format'], 'image/vnd.rn-realpix' => [%w(rp), %w(), 'RealPix document'], 'image/vnd.wap.wbmp' => [%w(wbmp), %w(), 'WBMP image'], 'image/vnd.zbrush.pcx' => [%w(pcx), %w(), 'PCX image'], 'image/webp' => [%w(webp), %w(), 'WebP image'], 'image/x-3ds' => [%w(3ds), %w(), '3D Studio image'], 'image/x-adobe-dng' => [%w(dng), %w(image/tiff image/x-dcraw), 'Adobe DNG negative'], 'image/x-applix-graphics' => [%w(ag), %w(), 'Applix Graphics image'], 'image/x-bzeps' => [%w(eps.bz2 epsf.bz2 epsi.bz2), %w(application/x-bzip), 'EPS image (bzip-compressed)'], 'image/x-canon-cr2' => [%w(cr2), %w(image/tiff image/x-dcraw), 'Canon CR2 raw image'], 'image/x-canon-crw' => [%w(crw), %w(image/x-dcraw), 'Canon CRW raw image'], 'image/x-cmu-raster' => [%w(ras), %w(), 'CMU raster image'], 'image/x-compressed-xcf' => [%w(xcf.bz2 xcf.gz), %w(), 'compressed GIMP image'], 'image/x-dds' => [%w(dds), %w(), 'DirectDraw surface'], 'image/x-emf' => [%w(emf), %w(), 'EMF image'], 'image/x-eps' => [%w(eps epsf epsi), %w(application/postscript), 'EPS image'], 'image/x-exr' => [%w(exr), %w(), 'EXR image'], 'image/x-fuji-raf' => [%w(raf), %w(image/x-dcraw), 'Fuji RAF raw image'], 'image/x-gzeps' => [%w(eps.gz epsf.gz epsi.gz), %w(application/gzip), 'EPS image (gzip-compressed)'], 'image/x-icns' => [%w(icns), %w(), 'MacOS X icon'], 'image/x-ilbm' => [%w(iff ilbm lbm), %w(application/x-iff), 'ILBM image'], 'image/x-jng' => [%w(jng), %w(), 'JNG image'], 'image/x-kodak-dcr' => [%w(dcr), %w(image/tiff image/x-dcraw), 'Kodak DCR raw image'], 'image/x-kodak-k25' => [%w(k25), %w(image/tiff image/x-dcraw), 'Kodak K25 raw image'], 'image/x-kodak-kdc' => [%w(kdc), %w(image/tiff image/x-dcraw), 'Kodak KDC raw image'], 'image/x-lwo' => [%w(lwo lwob), %w(), 'LightWave object'], 'image/x-lws' => [%w(lws), %w(), 'LightWave scene'], 'image/x-macpaint' => [%w(pntg), %w(), 'MacPaint Bitmap image'], 'image/x-minolta-mrw' => [%w(mrw), %w(image/x-dcraw), 'Minolta MRW raw image'], 'image/x-msod' => [%w(msod), %w(), 'Office drawing'], 'image/x-nikon-nef' => [%w(nef), %w(image/tiff image/x-dcraw), 'Nikon NEF raw image'], 'image/x-olympus-orf' => [%w(orf), %w(image/x-dcraw), 'Olympus ORF raw image'], 'image/x-panasonic-raw' => [%w(raw), %w(image/x-dcraw), 'Panasonic raw image'], 'image/x-panasonic-raw2' => [%w(rw2), %w(image/x-dcraw), 'Panasonic raw2 image'], 'image/x-pentax-pef' => [%w(pef), %w(image/tiff image/x-dcraw), 'Pentax PEF raw image'], 'image/x-photo-cd' => [%w(pcd), %w(), 'PCD image'], 'image/x-pict' => [%w(pct pict pict1 pict2), %w(), 'Macintosh Quickdraw/PICT drawing'], 'image/x-portable-anymap' => [%w(pnm), %w(), 'PNM image'], 'image/x-portable-bitmap' => [%w(pbm), %w(image/x-portable-anymap), 'PBM image'], 'image/x-portable-graymap' => [%w(pgm), %w(image/x-portable-anymap), 'PGM image'], 'image/x-portable-pixmap' => [%w(ppm), %w(image/x-portable-anymap), 'PPM image'], 'image/x-quicktime' => [%w(qif qtif), %w(), 'QuickTime image'], 'image/x-rgb' => [%w(rgb), %w(), 'RGB image'], 'image/x-sgi' => [%w(sgi), %w(), 'SGI image'], 'image/x-sigma-x3f' => [%w(x3f), %w(image/x-dcraw), 'Sigma X3F raw image'], 'image/x-skencil' => [%w(sk sk1), %w(), 'Skencil document'], 'image/x-sony-arw' => [%w(arw), %w(image/tiff image/x-dcraw), 'Sony ARW raw image'], 'image/x-sony-sr2' => [%w(sr2), %w(image/tiff image/x-dcraw), 'Sony SR2 raw image'], 'image/x-sony-srf' => [%w(srf), %w(image/tiff image/x-dcraw), 'Sony SRF raw image'], 'image/x-sun-raster' => [%w(sun), %w(), 'Sun raster image'], 'image/x-tga' => [%w(icb tga tpic vda vst), %w(), 'TGA image'], 'image/x-win-bitmap' => [%w(cur), %w(), 'Windows cursor'], 'image/x-wmf' => [%w(wmf), %w(), 'WMF image'], 'image/x-xbitmap' => [%w(xbm), %w(), 'XBM image'], 'image/x-xcf' => [%w(xcf), %w(), 'GIMP image'], 'image/x-xfig' => [%w(fig), %w(), 'XFig image'], 'image/x-xpixmap' => [%w(xpm), %w(), 'XPM image'], 'image/x-xwindowdump' => [%w(xwd), %w(), 'X window image'], 'message/rfc822' => [%w(eml), %w(text/plain), 'email message'], 'model/vrml' => [%w(vrm vrml wrl), %w(text/plain), 'VRML document'], 'text/cache-manifest' => [%w(manifest), %w(text/plain), 'Web application cache manifest'], 'text/calendar' => [%w(ics vcs), %w(text/plain), 'VCS/ICS calendar'], 'text/css' => [%w(css), %w(text/plain), 'CSS stylesheet'], 'text/csv' => [%w(csv), %w(text/plain), 'CSV document'], 'text/csv-schema' => [%w(csvs), %w(text/plain), 'CSV Schema document'], 'text/html' => [%w(htm html), %w(text/plain), 'HTML document'], 'text/markdown' => [%w(markdown md mkd), %w(text/plain), 'Markdown document'], 'text/plain' => [%w(asc txt), %w(), 'plain text document'], 'text/richtext' => [%w(rtx), %w(text/plain), 'rich text document'], 'text/rust' => [%w(rs), %w(text/plain), 'Rust source code'], 'text/sgml' => [%w(sgm sgml), %w(text/plain), 'SGML document'], 'text/spreadsheet' => [%w(slk sylk), %w(text/plain), 'spreadsheet interchange document'], 'text/tab-separated-values' => [%w(tsv), %w(text/plain), 'TSV document'], 'text/troff' => [%w(roff t tr), %w(text/plain), 'Troff document'], 'text/turtle' => [%w(ttl), %w(text/plain), 'Turtle document'], 'text/vcard' => [%w(gcrd vcard vcf vct), %w(text/plain), 'electronic business card'], 'text/vnd.graphviz' => [%w(dot gv), %w(), 'Graphviz DOT graph'], 'text/vnd.rn-realtext' => [%w(rt), %w(), 'RealText document'], 'text/vnd.sun.j2me.app-descriptor' => [%w(jad), %w(), 'JAD document'], 'text/vnd.trolltech.linguist' => [%w(ts), %w(application/xml), 'message catalog'], 'text/vnd.wap.wml' => [%w(wml), %w(application/xml), 'WML document'], 'text/vnd.wap.wmlscript' => [%w(wmls), %w(), 'WMLScript program'], 'text/vtt' => [%w(vtt), %w(text/plain), 'WebVTT subtitles'], 'text/x-adasrc' => [%w(adb ads), %w(text/plain), 'Ada source code'], 'text/x-bibtex' => [%w(bib), %w(text/plain), 'BibTeX document'], 'text/x-c++hdr' => [%w(h++ hh hp hpp hxx), %w(text/x-chdr), 'C++ header'], 'text/x-c++src' => [%w(c c++ cc cpp cxx), %w(text/x-csrc), 'C++ source code'], 'text/x-chdr' => [%w(h), %w(text/x-csrc), 'C header'], 'text/x-cmake' => [%w(cmake), %w(text/plain), 'CMake source code'], 'text/x-cobol' => [%w(cbl cob), %w(text/plain), 'COBOL source file'], 'text/x-csharp' => [%w(cs), %w(text/x-csrc), 'C# source code'], 'text/x-csrc' => [%w(c), %w(text/plain), 'C source code'], 'text/x-dcl' => [%w(dcl), %w(text/plain), 'DCL script'], 'text/x-dsl' => [%w(dsl), %w(text/plain), 'DSSSL document'], 'text/x-dsrc' => [%w(d di), %w(text/x-csrc), 'D source code'], 'text/x-eiffel' => [%w(e eif), %w(text/plain), 'Eiffel source code'], 'text/x-emacs-lisp' => [%w(el), %w(text/plain), 'Emacs Lisp source code'], 'text/x-erlang' => [%w(erl), %w(text/plain), 'Erlang source code'], 'text/x-fortran' => [%w(f f90 f95 for), %w(text/plain), 'Fortran source code'], 'text/x-genie' => [%w(gs), %w(text/plain), 'Genie source code'], 'text/x-gettext-translation' => [%w(po), %w(text/plain), 'translation file'], 'text/x-gettext-translation-template' => [%w(pot), %w(text/plain), 'translation template'], 'text/x-go' => [%w(go), %w(text/plain), 'Go source code'], 'text/x-google-video-pointer' => [%w(gvp), %w(), 'Google Video Pointer'], 'text/x-haskell' => [%w(hs), %w(text/plain), 'Haskell source code'], 'text/x-iMelody' => [%w(ime imy), %w(), 'iMelody ringtone'], 'text/x-idl' => [%w(idl), %w(text/plain), 'IDL document'], 'text/x-iptables' => [%w(iptables), %w(text/plain), 'iptables configuration file'], 'text/x-java' => [%w(java), %w(text/x-csrc), 'Java source code'], 'text/x-ldif' => [%w(ldif), %w(text/plain), 'LDIF address book'], 'text/x-lilypond' => [%w(ly), %w(text/plain), 'Lilypond music sheet'], 'text/x-literate-haskell' => [%w(lhs), %w(text/plain), 'LHS source code'], 'text/x-log' => [%w(log), %w(text/plain), 'application log'], 'text/x-lua' => [%w(lua), %w(application/x-executable text/plain), 'Lua script'], 'text/x-makefile' => [%w(mak mk), %w(text/plain), 'Makefile'], 'text/x-matlab' => [%w(m), %w(text/plain), 'MATLAB script/function'], 'text/x-microdvd' => [%w(sub), %w(text/plain), 'MicroDVD subtitles'], 'text/x-moc' => [%w(moc), %w(text/plain), 'Qt MOC file'], 'text/x-modelica' => [%w(mo), %w(text/plain), 'Modelica model'], 'text/x-mof' => [%w(mof), %w(text/x-csrc), 'Managed Object Format'], 'text/x-mpsub' => [%w(sub), %w(text/plain), 'MPSub subtitles'], 'text/x-mrml' => [%w(mrl mrml), %w(), 'MRML playlist'], 'text/x-ms-regedit' => [%w(reg), %w(text/plain), 'Windows Registry extract'], 'text/x-mup' => [%w(mup not), %w(text/plain), 'Mup publication'], 'text/x-nfo' => [%w(nfo), %w(text/x-readme), 'NFO document'], 'text/x-objcsrc' => [%w(m), %w(text/x-csrc), 'Objective-C source code'], 'text/x-ocaml' => [%w(ml mli), %w(), 'OCaml source code'], 'text/x-ocl' => [%w(ocl), %w(text/plain), 'OCL file'], 'text/x-ooc' => [%w(ooc), %w(text/x-csrc), 'OOC source code'], 'text/x-opml+xml' => [%w(opml), %w(application/xml), 'OPML syndication feed'], 'text/x-pascal' => [%w(p pas), %w(text/plain), 'Pascal source code'], 'text/x-patch' => [%w(diff patch), %w(text/plain), 'differences between files'], 'text/x-python' => [%w(py pyx wsgi), %w(application/x-executable text/plain), 'Python script'], 'text/x-qml' => [%w(qml qmlproject qmltypes), %w(), 'Qt Markup Language file'], 'text/x-reject' => [%w(rej), %w(text/plain), 'rejected patch'], 'text/x-rpm-spec' => [%w(spec), %w(text/plain), 'RPM spec file'], 'text/x-scala' => [%w(scala), %w(text/plain), 'Scala source code'], 'text/x-scheme' => [%w(scm ss), %w(text/plain), 'Scheme source code'], 'text/x-setext' => [%w(etx), %w(text/plain), 'Setext document'], 'text/x-ssa' => [%w(ass ssa), %w(text/plain), 'SSA subtitles'], 'text/x-subviewer' => [%w(sub), %w(text/plain), 'SubViewer subtitles'], 'text/x-svhdr' => [%w(svh), %w(text/x-verilog), 'SystemVerilog header'], 'text/x-svsrc' => [%w(sv), %w(text/x-verilog), 'SystemVerilog source code'], 'text/x-tcl' => [%w(tcl tk), %w(text/plain), 'Tcl script'], 'text/x-tex' => [%w(cls dtx ins latex ltx sty tex), %w(text/plain), 'TeX document'], 'text/x-texinfo' => [%w(texi texinfo), %w(text/plain), 'TeXInfo document'], 'text/x-troff-me' => [%w(me), %w(text/plain), 'Troff ME input document'], 'text/x-troff-mm' => [%w(mm), %w(text/plain), 'Troff MM input document'], 'text/x-troff-ms' => [%w(ms), %w(text/plain), 'Troff MS input document'], 'text/x-txt2tags' => [%w(t2t), %w(text/plain), 'txt2tags document'], 'text/x-uil' => [%w(uil), %w(text/plain), 'X-Motif UIL table'], 'text/x-uuencode' => [%w(uue), %w(text/plain), 'uuencoded file'], 'text/x-vala' => [%w(vala vapi), %w(text/x-csrc), 'Vala source code'], 'text/x-verilog' => [%w(v), %w(text/plain), 'Verilog source code'], 'text/x-vhdl' => [%w(vhd vhdl), %w(text/plain), 'VHDL source code'], 'text/x-xmi' => [%w(xmi), %w(application/xml), 'XMI file'], 'text/x-xslfo' => [%w(fo xslfo), %w(application/xml), 'XSL FO file'], 'video/3gpp' => [%w(3ga 3gp 3gpp), %w(video/mp4), '3GPP multimedia file'], 'video/3gpp2' => [%w(3g2 3gp2 3gpp2), %w(video/mp4), '3GPP2 multimedia file'], 'video/annodex' => [%w(axv), %w(application/annodex), 'Annodex Video'], 'video/dv' => [%w(dv), %w(), 'DV video'], 'video/mp2t' => [%w(bdm bdmv clpi cpi m2t m2ts mpl mpls mts ts), %w(), 'MPEG-2 transport stream'], 'video/mp4' => [%w(f4v lrv m4v mp4), %w(), 'MPEG-4 video'], 'video/mpeg' => [%w(mp2 mpe mpeg mpg vob), %w(), 'MPEG video'], 'video/ogg' => [%w(ogg ogv), %w(application/ogg), 'Ogg Video'], 'video/quicktime' => [%w(moov mov qt qtvr), %w(), 'QuickTime video'], 'video/vnd.mpegurl' => [%w(m1u m4u mxu), %w(text/plain), 'MPEG video (streamed)'], 'video/vnd.rn-realvideo' => [%w(rv rvx), %w(), 'RealVideo document'], 'video/vnd.vivo' => [%w(viv vivo), %w(), 'Vivo video'], 'video/webm' => [%w(webm), %w(), 'WebM video'], 'video/x-flic' => [%w(flc fli), %w(), 'FLIC animation'], 'video/x-flv' => [%w(flv), %w(), 'Flash video'], 'video/x-javafx' => [%w(fxm), %w(video/x-flv), 'JavaFX video'], 'video/x-matroska' => [%w(mkv), %w(application/x-matroska), 'Matroska video'], 'video/x-matroska-3d' => [%w(mk3d), %w(application/x-matroska), 'Matroska 3D video'], 'video/x-mng' => [%w(mng), %w(), 'MNG animation'], 'video/x-ms-wmv' => [%w(wmv), %w(application/vnd.ms-asf), 'Windows Media video'], 'video/x-msvideo' => [%w(avf avi divx), %w(), 'AVI video'], 'video/x-nsv' => [%w(nsv), %w(), 'NullSoft video'], 'video/x-ogm+ogg' => [%w(ogm), %w(video/ogg), 'OGM video'], 'video/x-sgi-movie' => [%w(movie), %w(), 'SGI video'], 'video/x-theora+ogg' => [%w(ogg), %w(video/ogg), 'Ogg Theora video'], 'x-epoc/x-sisx-app' => [%w(sisx), %w(), 'SISX package'], } # @private # :nodoc: MAGIC = [ ['image/jpeg', [[0, "\377\330\377"], [0, "\377\330"]]], ['image/png', [[0, "\211PNG"]]], ['image/gif', [[0, 'GIF8']]], ['image/tiff', [[0, "MM\000*"], [0, "II*\000"]]], ['image/bmp', [[0, 'BM', [[14, "\f"], [14, '@'], [14, '(']]]]], ['image/vnd.adobe.photoshop', []], ['image/webp', [[0, 'RIFF', [[8, 'WEBP']]]]], ['image/svg+xml', [[0..256, '']]], ['application/x-nzb', [[0..256, '', [[8, 'debian']]]]], ['application/vnd.emusic-emusic_package', [[0, 'nF7YLao']]], ['application/vnd.iccprofile', [[36, 'acsp']]], ['application/vnd.lotus-1-2-3', [[0, "\000\000\002\000\006\004\006\000\b\000\000\000\000\000"]]], ['application/vnd.lotus-wordpro', [[0, 'WordPro']]], ['application/vnd.ms-access', [[0, "\000\001\000\000Standard Jet DB"]]], ['application/vnd.ms-asf', [[0, "0&\262u"], [0, '[Reference]']]], ['application/vnd.ms-tnef', [[0, "x\237>\""]]], ['application/vnd.oasis.opendocument.chart', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.oasis.opendocument.chart']]]]]]], ['application/vnd.oasis.opendocument.chart-template', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.oasis.opendocument.chart-template']]]]]]], ['application/vnd.oasis.opendocument.database', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.oasis.opendocument.base']]]]]]], ['application/vnd.oasis.opendocument.formula', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.oasis.opendocument.formula']]]]]]], ['application/vnd.oasis.opendocument.formula-template', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.oasis.opendocument.formula-template']]]]]]], ['application/vnd.oasis.opendocument.graphics', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.oasis.opendocument.graphics']]]]]]], ['application/vnd.oasis.opendocument.graphics-template', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.oasis.opendocument.graphics-template']]]]]]], ['application/vnd.oasis.opendocument.image', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.oasis.opendocument.image']]]]]]], ['application/vnd.oasis.opendocument.presentation', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.oasis.opendocument.presentation']]]]]]], ['application/vnd.oasis.opendocument.presentation-template', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.oasis.opendocument.presentation-template']]]]]]], ['application/vnd.oasis.opendocument.spreadsheet', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.oasis.opendocument.spreadsheet']]]]]]], ['application/vnd.oasis.opendocument.spreadsheet-template', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.oasis.opendocument.spreadsheet-template']]]]]]], ['application/vnd.oasis.opendocument.text', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.oasis.opendocument.text']]]]]]], ['application/vnd.oasis.opendocument.text-master', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.oasis.opendocument.text-master']]]]]]], ['application/vnd.oasis.opendocument.text-template', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.oasis.opendocument.text-template']]]]]]], ['application/vnd.oasis.opendocument.text-web', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.oasis.opendocument.text-web']]]]]]], ['application/vnd.rn-realmedia', [[0, '.RMF']]], ['application/vnd.sun.xml.calc', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.sun.xml.calc']]]]]]], ['application/vnd.sun.xml.calc.template', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.sun.xml.calc']]]]]]], ['application/vnd.sun.xml.draw', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.sun.xml.draw']]]]]]], ['application/vnd.sun.xml.draw.template', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.sun.xml.draw']]]]]]], ['application/vnd.sun.xml.impress', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.sun.xml.impress']]]]]]], ['application/vnd.sun.xml.impress.template', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.sun.xml.impress']]]]]]], ['application/vnd.sun.xml.math', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.sun.xml.math']]]]]]], ['application/vnd.sun.xml.writer', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.sun.xml.writer']]]]]]], ['application/vnd.sun.xml.writer.global', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.sun.xml.writer']]]]]]], ['application/vnd.sun.xml.writer.template', [[0, "PK\003\004", [[30, 'mimetype', [[38, 'application/vnd.sun.xml.writer']]]]]]], ['application/vnd.symbian.install', [[8, "\031\004\000\020"]]], ['application/vnd.tcpdump.pcap', [[0, "\324\303\262\241"], [0, "\241\262\303\324"]]], ['application/vnd.wordperfect', [[1, 'WPC']]], ['application/vnd.xdgapp', [[0, "xdg-app\000\001\000\211\345"]]], ['application/winhlp', [[0, "?_\003\000"]]], ['application/x-abiword', [[0..256, '']]], ['application/x-saturn-rom', [[0, 'SEGA SEGASATURN'], [16, 'SEGA SEGASATURN']]], ['application/x-sc', [[38, 'Spreadsheet']]], ['application/x-sharedlib', [[0, "\177ELF", [[5, "\001", [[16, "\003\000"]]]]], [0, "\177ELF", [[5, "\002", [[16, "\000\003"]]]]], [0, "\203\001"]]], ['application/x-shellscript', [[10, '# This is a shell archive'], [2..16, '/bin/bash'], [2..16, '/bin/nawk'], [2..16, '/bin/zsh'], [2..16, '/bin/sh'], [2..16, '/bin/ksh'], [2..16, '/bin/dash'], [2..16, '/bin/env sh'], [2..16, '/bin/env bash'], [2..16, '/bin/env zsh'], [2..16, '/bin/env ksh']]], ['application/x-shorten', [[0, 'ajkg']]], ['application/x-smaf', [[0, 'MMMD']]], ['application/x-spss-por', [[40, 'ASCII SPSS PORT FILE']]], ['application/x-spss-sav', [[0, '$FL2'], [0, '$FL3']]], ['application/x-sqlite2', [[0, '** This file contains an SQLite']]], ['application/x-sqlite3', [[0, 'SQLite format 3']]], ['application/x-subrip', [[0, '1', [[0..256, ' --> ']]]]], ['application/x-t602', [[0, '@CT 0'], [0, '@CT 1'], [0, '@CT 2']]], ['application/x-tgif', [[0, '%TGIF']]], ['application/x-wii-rom', [[24, "]\034\236\243"], [0, 'WBFS'], [0, "WII\001DISC"]]], ['application/x-wii-wad', [[4, "Is\000\000"], [4, "ib\000\000"], [4, "Bk\000\000"]]], ['application/x-xbel', [[0..256, ''], [0, '!']]], ['application/x-riff', [[0, 'RIFF']]], ['application/x-executable', [[0, "\177ELF", [[5, "\001", [[16, "\002\000"]]]]], [0, "\177ELF", [[5, "\002", [[16, "\000\002"]]]]], [0, 'MZ'], [0, "\034R"], [0, "\020\001"], [0, "\021\001"], [0, "\203\001"]]], ['application/x-iff', [[0, 'FORM']]], ['application/x-perl', [[0..256, "\n=pod"], [0..256, "\n=head1 NAME"], [0..256, "\n=head1 DESCRIPTION"]]], ['application/xml', [[0, 'type: Mime type # * options: Options hash # # Option keys: # * :extensions: String list or single string of file extensions # * :parents: String list or single string of parent mime types # * :magic: Mime magic specification # * :comment: Comment string def self.add(type, options) extensions = [options[:extensions]].flatten.compact TYPES[type] = [extensions, [options[:parents]].flatten.compact, options[:comment]] extensions.each {|ext| EXTENSIONS[ext] = type } MAGIC.unshift [type, options[:magic]] if options[:magic] end # Removes a mime type from the dictionary. You might want to do this if # you're seeing impossible conflicts (for instance, application/x-gmc-link). # * type: The mime type to remove. All associated extensions and magic are removed too. def self.remove(type) EXTENSIONS.delete_if {|ext, t| t == type } MAGIC.delete_if {|t, m| t == type } TYPES.delete(type) end # Returns true if type is a text format def text?; mediatype == 'text' || child_of?('text/plain'); end # Mediatype shortcuts def image?; mediatype == 'image'; end def audio?; mediatype == 'audio'; end def video?; mediatype == 'video'; end # Returns true if type is child of parent type def child_of?(parent) MimeMagic.child?(type, parent) end # Get string list of file extensions def extensions TYPES.key?(type) ? TYPES[type][0] : [] end # Get mime comment def comment (TYPES.key?(type) ? TYPES[type][2] : nil).to_s end # Lookup mime type by file extension def self.by_extension(ext) ext = ext.to_s.downcase mime = ext[0..0] == '.' ? EXTENSIONS[ext[1..-1]] : EXTENSIONS[ext] mime && new(mime) end # Lookup mime type by filename def self.by_path(path) by_extension(File.extname(path)) end # Lookup mime type by magic content analysis. # This is a slow operation. def self.by_magic(io) mime = magic_match(io, :find) mime && new(mime[0]) end # Lookup all mime types by magic content analysis. # This is a slower operation. def self.all_by_magic(io) magic_match(io, :select).map { |mime| new(mime[0]) } end # Return type as string def to_s type end # Allow comparison with string def eql?(other) type == other.to_s end def hash type.hash end alias == eql? def self.child?(child, parent) child == parent || TYPES.key?(child) && TYPES[child][1].any? {|p| child?(p, parent) } end def self.magic_match(io, method) return magic_match(StringIO.new(io.to_s), method) unless io.respond_to?(:read) io.binmode if io.respond_to?(:binmode) io.set_encoding(Encoding::BINARY) if io.respond_to?(:set_encoding) buffer = "".force_encoding(Encoding::BINARY) MAGIC.send(method) { |type, matches| magic_match_io(io, matches, buffer) } end def self.magic_match_io(io, matches, buffer) matches.any? do |offset, value, children| match = if Range === offset io.read(offset.begin, buffer) x = io.read(offset.end - offset.begin + value.bytesize, buffer) x && x.include?(value) else io.read(offset, buffer) io.read(value.bytesize, buffer) == value end io.rewind match && (!children || magic_match_io(io, children, buffer)) end end private_class_method :magic_match, :magic_match_io end mimemagic-0.3.2/.yardopts0000644000004100000410000000003013272055171015336 0ustar www-datawww-data--no-private - README.mdmimemagic-0.3.2/Gemfile0000644000004100000410000000005013272055171014765 0ustar www-datawww-datasource 'https://rubygems.org/' gemspec mimemagic-0.3.2/mimemagic.gemspec0000644000004100000410000000134413272055171016776 0ustar www-datawww-data# -*- encoding: utf-8 -*- require File.dirname(__FILE__) + '/lib/mimemagic/version' require 'date' Gem::Specification.new do |s| s.name = 'mimemagic' s.version = MimeMagic::VERSION s.authors = ['Daniel Mendler'] s.date = Date.today.to_s s.email = ['mail@daniel-mendler.de'] s.files = `git ls-files`.split("\n") s.require_paths = %w(lib) s.rubyforge_project = s.name s.summary = 'Fast mime detection by extension or content' s.description = 'Fast mime detection by extension or content in pure ruby (Uses freedesktop.org.xml shared-mime-info database)' s.homepage = 'https://github.com/minad/mimemagic' s.license = 'MIT' s.add_development_dependency('bacon') s.add_development_dependency('rake') end