mini_mime 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 519524c1e8a814d03548d567200eae2af6255498
4
- data.tar.gz: 10173872af6271b41a3ac4723a8f1ceee26adc5d
3
+ metadata.gz: a948e97ee94cb1cb607b585ace922fca6c456d72
4
+ data.tar.gz: 40f15c3040648c1cccf7ab8720348c29a854a354
5
5
  SHA512:
6
- metadata.gz: 6f0ce7297cf0c718df1cf8a26aff6880136fdc84ec4f3c859792cf2d68064c2c2eb9beb8253cddf6238d4358da0608673627af31f66d158f0e4caa27b8c4e46b
7
- data.tar.gz: 2dae81f176221e7241876ab965eda0020709c3b9595c756f81303b86858f475a13220257f9ef89014dfb279f9cf6efa4b7f21cabb528f09582645ea0c7fbc075
6
+ metadata.gz: fb5c97af815c33e449e277d5ae9af58fb5c55af4bc38e60bfd30812f13c6ca31a8e618e81b87dcda3872a7994d94055aeffdfa170f69b6306f890050d17d5647
7
+ data.tar.gz: a542eb290b5659e3a8e11ff67679667c168406f156e11c8637f17a5c38104ee3a1119e0f9f6d16cbd2d540bd7a6e3037affd3a1c84af6b655f67a169ccc42fea
@@ -10,8 +10,9 @@ rvm:
10
10
  - 1.9.3
11
11
  - 2.0.0
12
12
  - 2.1.10
13
- - 2.2.6
14
- - 2.3.3
13
+ - 2.2.7
14
+ - 2.3.4
15
+ - 2.4.1
15
16
  - ruby-head
16
17
  - jruby
17
18
  - jruby-9.0.5.0
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ 11-08-2017
2
+ - Version 0.1.4
3
+ - Return preferred extension when looking up by content type
4
+
5
+
1
6
  28-03-2016
2
7
 
3
8
  - Version 0.1.3
data/Rakefile CHANGED
@@ -46,12 +46,9 @@ task :rebuild_db do
46
46
  buffer = []
47
47
 
48
48
  index.each do |ext, list|
49
- mime_type = nil
50
- list.each do |type|
51
- mime_type = type
52
- break unless type.obsolete?
53
- end
54
- mime_type = list.first if mime_type.obsolete?
49
+ mime_type = list.detect { |t| !t.obsolete? }
50
+ mime_type ||= list.detect(&:registered)
51
+ mime_type ||= list.first
55
52
  buffer << [ext.dup, mime_type.content_type.dup, mime_type.encoding.dup]
56
53
  end
57
54
 
@@ -67,7 +64,21 @@ task :rebuild_db do
67
64
 
68
65
  puts "#{buffer.count} rows written to lib/db/ext_mime.db"
69
66
 
70
- buffer.sort!{|a,b| a[1] <=> b[1]}
67
+ buffer.sort!{|a,b| [a[1], a[0]] <=> [b[1], b[0]]}
68
+
69
+ # strip cause we are going to re-pad
70
+ buffer.each do |row|
71
+ row.each do |col|
72
+ col.strip!
73
+ end
74
+ end
75
+
76
+ # we got to confirm we pick the right extension for each type
77
+ buffer.each do |row|
78
+ row[0] = MIME::Types.type_for("xyz.#{row[0].strip}")[0].extensions[0].dup
79
+ end
80
+
81
+ pad(buffer)
71
82
 
72
83
  File.open("lib/db/content_type_mime.db", File::CREAT|File::TRUNC|File::RDWR) do |f|
73
84
  last = nil
@@ -52,8 +52,8 @@ m21 application/mp21
52
52
  mp4 application/mp4 base64
53
53
  doc application/msword base64
54
54
  mxf application/mxf base64
55
- cdf application/netcdf base64
56
- ani application/octet-stream base64
55
+ nc application/netcdf base64
56
+ bin application/octet-stream base64
57
57
  oda application/oda base64
58
58
  opf application/oebps-package+xml base64
59
59
  ogx application/ogg base64
@@ -65,7 +65,7 @@ pdf application/pdf
65
65
  asc application/pgp-signature base64
66
66
  prf application/pics-rules base64
67
67
  p10 application/pkcs10 base64
68
- p7c application/pkcs7-mime base64
68
+ p7m application/pkcs7-mime base64
69
69
  p7s application/pkcs7-signature base64
70
70
  p8 application/pkcs8 base64
71
71
  ac application/pkix-attr-cert base64
@@ -75,9 +75,9 @@ pkipath application/pkix-pkipath
75
75
  pki application/pkixcmp base64
76
76
  pls application/pls+xml base64
77
77
  ai application/postscript 8bit
78
- pot application/powerpoint base64
78
+ ppt application/powerpoint base64
79
79
  cw application/prs.cww base64
80
- rct application/prs.nprend base64
80
+ rnd application/prs.nprend base64
81
81
  pskcxml application/pskc+xml base64
82
82
  rdf application/rdf+xml 8bit
83
83
  rif application/reginfo+xml base64
@@ -131,12 +131,12 @@ mqy application/vnd.Mobius.MQY
131
131
  msl application/vnd.Mobius.MSL base64
132
132
  plc application/vnd.Mobius.PLC base64
133
133
  txf application/vnd.Mobius.TXF base64
134
- qwd application/vnd.Quark.QuarkXPress 8bit
134
+ qxd application/vnd.Quark.QuarkXPress 8bit
135
135
  twd application/vnd.SimTech-MindMapper base64
136
136
  aso application/vnd.accpac.simply.aso base64
137
137
  imp application/vnd.accpac.simply.imp base64
138
138
  acu application/vnd.acucobol base64
139
- acutc application/vnd.acucorp 7bit
139
+ atc application/vnd.acucorp 7bit
140
140
  air application/vnd.adobe.air-application-installer-package+zip base64
141
141
  fcdt application/vnd.adobe.formscentral.fcdt base64
142
142
  fxp application/vnd.adobe.fxp base64
@@ -212,7 +212,7 @@ fdf application/vnd.fdf
212
212
  mseed application/vnd.fdsn.mseed base64
213
213
  dataless application/vnd.fdsn.seed base64
214
214
  ftc application/vnd.fluxtime.clip base64
215
- book application/vnd.framemaker base64
215
+ frm application/vnd.framemaker base64
216
216
  fnc application/vnd.frogans.fnc base64
217
217
  ltf application/vnd.frogans.ltf base64
218
218
  fsc application/vnd.fsc.weblaunch 7bit
@@ -244,9 +244,9 @@ gtm application/vnd.groove-tool-message
244
244
  tpl application/vnd.groove-tool-template base64
245
245
  vcg application/vnd.groove-vcard base64
246
246
  hal application/vnd.hal+xml base64
247
- bpd application/vnd.hbci base64
247
+ hbci application/vnd.hbci base64
248
248
  les application/vnd.hhe.lesson-player base64
249
- hpgl application/vnd.hp-HPGL base64
249
+ plt application/vnd.hp-HPGL base64
250
250
  pcl application/vnd.hp-PCL base64
251
251
  pclxl application/vnd.hp-PCLXL base64
252
252
  hpid application/vnd.hp-hpid base64
@@ -291,7 +291,7 @@ sse application/vnd.kodak-descriptor
291
291
  lasxml application/vnd.las.las+xml base64
292
292
  lbd application/vnd.llamagraphics.life-balance.desktop base64
293
293
  lbe application/vnd.llamagraphics.life-balance.exchange+xml base64
294
- 123 application/vnd.lotus-1-2-3 base64
294
+ wks application/vnd.lotus-1-2-3 base64
295
295
  apr application/vnd.lotus-approach base64
296
296
  pre application/vnd.lotus-freelance base64
297
297
  nsf application/vnd.lotus-notes base64
@@ -312,7 +312,7 @@ xul application/vnd.mozilla.xul+xml
312
312
  cil application/vnd.ms-artgalry base64
313
313
  asf application/vnd.ms-asf base64
314
314
  cab application/vnd.ms-cab-compressed base64
315
- xla application/vnd.ms-excel base64
315
+ xls application/vnd.ms-excel base64
316
316
  xlam application/vnd.ms-excel.addin.macroEnabled.12 base64
317
317
  xlsb application/vnd.ms-excel.sheet.binary.macroEnabled.12 base64
318
318
  xlsm application/vnd.ms-excel.sheet.macroEnabled.12 base64
@@ -340,7 +340,7 @@ mseq application/vnd.mseq
340
340
  mus application/vnd.musician base64
341
341
  msty application/vnd.muvee.style base64
342
342
  taglet application/vnd.mynfc base64
343
- bkm application/vnd.nervana base64
343
+ ent application/vnd.nervana base64
344
344
  nlu application/vnd.neurolanguage.nlu base64
345
345
  nitf application/vnd.nitf base64
346
346
  nnd application/vnd.noblenet-directory base64
@@ -354,14 +354,14 @@ edm application/vnd.novadigm.EDM
354
354
  edx application/vnd.novadigm.EDX base64
355
355
  ext application/vnd.novadigm.EXT base64
356
356
  odc application/vnd.oasis.opendocument.chart base64
357
- otc application/vnd.oasis.opendocument.chart-template base64
357
+ odc application/vnd.oasis.opendocument.chart-template base64
358
358
  odb application/vnd.oasis.opendocument.database base64
359
359
  odf application/vnd.oasis.opendocument.formula base64
360
- odft application/vnd.oasis.opendocument.formula-template base64
360
+ odf application/vnd.oasis.opendocument.formula-template base64
361
361
  odg application/vnd.oasis.opendocument.graphics base64
362
362
  otg application/vnd.oasis.opendocument.graphics-template base64
363
363
  odi application/vnd.oasis.opendocument.image base64
364
- oti application/vnd.oasis.opendocument.image-template base64
364
+ odi application/vnd.oasis.opendocument.image-template base64
365
365
  odp application/vnd.oasis.opendocument.presentation base64
366
366
  otp application/vnd.oasis.opendocument.presentation-template base64
367
367
  ods application/vnd.oasis.opendocument.spreadsheet base64
@@ -384,7 +384,7 @@ dotx application/vnd.openxmlformats-officedocument.wordprocessingml.templ
384
384
  mgp application/vnd.osgeo.mapguide.package base64
385
385
  dp application/vnd.osgi.dp base64
386
386
  esa application/vnd.osgi.subsystem base64
387
- oprc application/vnd.palm base64
387
+ prc application/vnd.palm base64
388
388
  paw application/vnd.pawaafile base64
389
389
  str application/vnd.pg.format base64
390
390
  ei6 application/vnd.pg.osasli base64
@@ -405,13 +405,13 @@ rm application/vnd.rn-realmedia
405
405
  rmvb application/vnd.rn-realmedia-vbr base64
406
406
  link66 application/vnd.route66.link66+xml base64
407
407
  st application/vnd.sailingtracker.track base64
408
- s1w application/vnd.sealed.doc base64
409
- sem application/vnd.sealed.eml base64
410
- smh application/vnd.sealed.mht base64
411
- s1p application/vnd.sealed.ppt base64
412
- s1e application/vnd.sealed.xls base64
413
- s1h application/vnd.sealedmedia.softseal.html base64
414
- s1a application/vnd.sealedmedia.softseal.pdf base64
408
+ sdoc application/vnd.sealed.doc base64
409
+ seml application/vnd.sealed.eml base64
410
+ smht application/vnd.sealed.mht base64
411
+ sppt application/vnd.sealed.ppt base64
412
+ sxls application/vnd.sealed.xls base64
413
+ stml application/vnd.sealedmedia.softseal.html base64
414
+ spdf application/vnd.sealedmedia.softseal.pdf base64
415
415
  see application/vnd.seemail base64
416
416
  sema application/vnd.sema base64
417
417
  semd application/vnd.semd base64
@@ -429,7 +429,7 @@ sdc application/vnd.stardivision.calc
429
429
  sds application/vnd.stardivision.chart base64
430
430
  sda application/vnd.stardivision.draw base64
431
431
  sdd application/vnd.stardivision.impress base64
432
- smf application/vnd.stardivision.math base64
432
+ sdf application/vnd.stardivision.math base64
433
433
  sdw application/vnd.stardivision.writer base64
434
434
  sgl application/vnd.stardivision.writer-global base64
435
435
  smzip application/vnd.stepmania.package base64
@@ -499,7 +499,7 @@ wspolicy application/wspolicy+xml
499
499
  wk application/x-123 base64
500
500
  7z application/x-7z-compressed base64
501
501
  bck application/x-VMSBACKUP base64
502
- wkz application/x-Wingz base64
502
+ wz application/x-Wingz base64
503
503
  abw application/x-abiword base64
504
504
  ace application/x-ace-compressed base64
505
505
  dmg application/x-apple-diskimage base64
@@ -525,7 +525,7 @@ csh application/x-csh
525
525
  csm application/x-cu-seeme base64
526
526
  deb application/x-debian-package base64
527
527
  dgc application/x-dgc-compressed base64
528
- @dir application/x-director base64
528
+ dcr application/x-director base64
529
529
  wad application/x-doom base64
530
530
  ncx application/x-dtbncx+xml base64
531
531
  dtb application/x-dtbook+xml base64
@@ -550,7 +550,7 @@ gtar application/x-gtar
550
550
  hdf application/x-hdf base64
551
551
  hep application/x-hep base64
552
552
  rhtml application/x-html+ruby 8bit
553
- php application/x-httpd-php 8bit
553
+ phtml application/x-httpd-php 8bit
554
554
  ibooks application/x-ibooks+zip base64
555
555
  ica application/x-ica base64
556
556
  imagemap application/x-imagemap 8bit
@@ -560,7 +560,7 @@ key application/x-iwork-keynote-sffkey
560
560
  numbers application/x-iwork-numbers-sffnumbers base64
561
561
  pages application/x-iwork-pages-sffpages base64
562
562
  jnlp application/x-java-jnlp-file base64
563
- latex application/x-latex 8bit
563
+ ltx application/x-latex 8bit
564
564
  cpt application/x-mac-compactpro base64
565
565
  mie application/x-mie base64
566
566
  mobi application/x-mobipocket-ebook base64
@@ -569,12 +569,12 @@ lnk application/x-ms-shortcut
569
569
  wmd application/x-ms-wmd base64
570
570
  wmz application/x-ms-wmz base64
571
571
  xbap application/x-ms-xbap base64
572
- mda application/x-msaccess base64
572
+ mdf application/x-msaccess base64
573
573
  obd application/x-msbinder base64
574
574
  crd application/x-mscardfile base64
575
575
  clp application/x-msclip base64
576
- bat application/x-msdos-program base64
577
- msi application/x-msdownload base64
576
+ cmd application/x-msdos-program base64
577
+ exe application/x-msdownload base64
578
578
  m13 application/x-msmediaview base64
579
579
  emf application/x-msmetafile base64
580
580
  mny application/x-msmoney base64
@@ -612,7 +612,7 @@ tar application/x-tar
612
612
  tcl application/x-tcl 8bit
613
613
  tex application/x-tex 8bit
614
614
  tfm application/x-tex-tfm base64
615
- texi application/x-texinfo 8bit
615
+ texinfo application/x-texinfo 8bit
616
616
  obj application/x-tgif base64
617
617
  tbk application/x-toolbook base64
618
618
  man application/x-troff-man 8bit
@@ -650,8 +650,8 @@ smv audio/SMV
650
650
  adp audio/adpcm base64
651
651
  au audio/basic base64
652
652
  kar audio/midi base64
653
- f4a audio/mp4 base64
654
- m2a audio/mpeg base64
653
+ mp4 audio/mp4 base64
654
+ mpga audio/mpeg base64
655
655
  oga audio/ogg base64
656
656
  s3m audio/s3m base64
657
657
  sil audio/silk base64
@@ -670,7 +670,7 @@ ecelp7470 audio/vnd.nuera.ecelp7470
670
670
  ecelp9600 audio/vnd.nuera.ecelp9600 base64
671
671
  qcp audio/vnd.qcelp base64
672
672
  rip audio/vnd.rip base64
673
- s1m audio/vnd.sealedmedia.softseal.mpeg base64
673
+ smp3 audio/vnd.sealedmedia.softseal.mpeg base64
674
674
  weba audio/webm base64
675
675
  aac audio/x-aac base64
676
676
  aif audio/x-aiff base64
@@ -695,18 +695,18 @@ g3 image/g3fax
695
695
  gif image/gif base64
696
696
  ief image/ief base64
697
697
  jp2 image/jp2 base64
698
- jpe image/jpeg base64
699
- jpgm image/jpm base64
700
- jpf image/jpx base64
698
+ jpeg image/jpeg base64
699
+ jpm image/jpm base64
700
+ jpx image/jpx base64
701
701
  ktx image/ktx base64
702
702
  png image/png base64
703
703
  btif image/prs.btif base64
704
704
  sgi image/sgi base64
705
705
  svg image/svg+xml 8bit
706
- tif image/tiff base64
706
+ tiff image/tiff base64
707
707
  psd image/vnd.adobe.photoshop base64
708
708
  uvg image/vnd.dece.graphic base64
709
- djv image/vnd.djvu base64
709
+ djvu image/vnd.djvu base64
710
710
  sub image/vnd.dvb.subtitle base64
711
711
  dwg image/vnd.dwg base64
712
712
  dxf image/vnd.dxf base64
@@ -746,8 +746,8 @@ xcf image/x-xcf
746
746
  xpm image/x-xpixmap 8bit
747
747
  xwd image/x-xwindowdump base64
748
748
  eml message/rfc822 8bit
749
- iges model/iges base64
750
- mesh model/mesh base64
749
+ igs model/iges base64
750
+ msh model/mesh base64
751
751
  dae model/vnd.collada+xml base64
752
752
  dwf model/vnd.dwf base64
753
753
  gdl model/vnd.gdl base64
@@ -756,7 +756,7 @@ mts model/vnd.mts
756
756
  x_b model/vnd.parasolid.transmit.binary base64
757
757
  x_t model/vnd.parasolid.transmit.text quoted-printable
758
758
  vtu model/vnd.vtu base64
759
- vrml model/vrml base64
759
+ wrl model/vrml base64
760
760
  x3db model/x3d+binary base64
761
761
  x3dv model/x3d+vrml base64
762
762
  x3d model/x3d+xml base64
@@ -764,14 +764,14 @@ appcache text/cache-manifest
764
764
  ics text/calendar quoted-printable
765
765
  css text/css 8bit
766
766
  csv text/csv 8bit
767
- htm text/html 8bit
767
+ html text/html 8bit
768
768
  n3 text/n3 quoted-printable
769
- c text/plain quoted-printable
769
+ txt text/plain quoted-printable
770
770
  dsc text/prs.lines.tag quoted-printable
771
771
  rtx text/richtext 8bit
772
- sgm text/sgml quoted-printable
772
+ sgml text/sgml quoted-printable
773
773
  tsv text/tab-separated-values quoted-printable
774
- roff text/troff 8bit
774
+ t text/troff 8bit
775
775
  ttl text/turtle quoted-printable
776
776
  uri text/uri-list quoted-printable
777
777
  vcard text/vcard quoted-printable
@@ -790,7 +790,7 @@ sl text/vnd.wap.sl
790
790
  wml text/vnd.wap.wml quoted-printable
791
791
  wmls text/vnd.wap.wmlscript quoted-printable
792
792
  asm text/x-asm quoted-printable
793
- cxx text/x-c quoted-printable
793
+ c text/x-c quoted-printable
794
794
  coffee text/x-coffescript 8bit
795
795
  htc text/x-component 8bit
796
796
  f text/x-fortran quoted-printable
@@ -813,10 +813,10 @@ h264 video/H264
813
813
  jpgv video/JPEG base64
814
814
  mj2 video/MJ2 base64
815
815
  ts video/MP2T base64
816
- f4p video/mp4 base64
817
- m1v video/mpeg base64
818
- ogv video/ogg base64
819
- mov video/quicktime base64
816
+ mp4 video/mp4 base64
817
+ mp2 video/mpeg base64
818
+ ogg video/ogg base64
819
+ qt video/quicktime base64
820
820
  uvh video/vnd.dece.hd base64
821
821
  uvm video/vnd.dece.mobile base64
822
822
  uvp video/vnd.dece.pd base64
@@ -824,14 +824,14 @@ uvs video/vnd.dece.sd
824
824
  uvv video/vnd.dece.video base64
825
825
  dvb video/vnd.dvb.file base64
826
826
  fvt video/vnd.fvt base64
827
- m4u video/vnd.mpegurl 8bit
827
+ mxu video/vnd.mpegurl 8bit
828
828
  pyv video/vnd.ms-playready.media.pyv base64
829
829
  nim video/vnd.nokia.interleaved-multimedia base64
830
- m4v video/vnd.objectvideo base64
830
+ mp4 video/vnd.objectvideo base64
831
831
  s11 video/vnd.sealed.mpeg1 base64
832
- s14 video/vnd.sealed.mpeg4 base64
833
- ssw video/vnd.sealed.swf base64
834
- s1q video/vnd.sealedmedia.softseal.mov base64
832
+ smpg video/vnd.sealed.mpeg4 base64
833
+ sswf video/vnd.sealed.swf base64
834
+ smov video/vnd.sealedmedia.softseal.mov base64
835
835
  uvu video/vnd.uvvu.mp4 base64
836
836
  viv video/vnd.vivo base64
837
837
  dl video/x-dl base64
@@ -841,8 +841,8 @@ gl video/x-gl
841
841
  ivf video/x-ivf base64
842
842
  mk3d video/x-matroska base64
843
843
  mng video/x-mng base64
844
- mjpeg video/x-motion-jpeg base64
845
- asx video/x-ms-asf base64
844
+ mjpg video/x-motion-jpeg base64
845
+ asf video/x-ms-asf base64
846
846
  vob video/x-ms-vob base64
847
847
  wm video/x-ms-wm base64
848
848
  wmx video/x-ms-wmx base64
@@ -1,3 +1,3 @@
1
1
  module MiniMime
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_mime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-28 00:00:00.000000000 Z
11
+ date: 2017-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler