summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Ziegler <austin@zieglers.ca>2015-04-24 14:54:35 -0400
committerAustin Ziegler <austin@zieglers.ca>2015-04-24 15:04:38 -0400
commit2d5a1d1ad63fded4154e16ce1d469f0a8ee9680f (patch)
treee1f5f1332ae5e01346a2a45ff8fad8215fdc4f96
parent853a47b2220a14ed5ec5e44898303fe173857104 (diff)
downloadmime-types-2.5-work.tar.gz
Convert MIME::Type#use_instead to a single entry.2.5-work
- Fixes #91.
-rw-r--r--support/iana_registry.rb13
-rw-r--r--type-lists/application.yaml120
-rw-r--r--type-lists/audio.yaml3
-rw-r--r--type-lists/image.yaml15
-rw-r--r--type-lists/multipart.yaml3
-rw-r--r--type-lists/text.yaml18
-rw-r--r--type-lists/video.yaml6
7 files changed, 59 insertions, 119 deletions
diff --git a/support/iana_registry.rb b/support/iana_registry.rb
index 3cf47de..9aaab3a 100644
--- a/support/iana_registry.rb
+++ b/support/iana_registry.rb
@@ -54,20 +54,15 @@ class IANARegistry
@registry.css('record').each do |record|
subtype = record.at_css('name').text
obsolete = record.at_css('obsolete').text rescue nil
- use_instead = [ record.at_css('deprecated').text ] rescue []
+ use_instead = record.at_css('deprecated').text rescue nil
if subtype =~ /OBSOLETE|DEPRECATE/i
- if subtype =~ /in favou?r of (.*)/
- use_instead = [ use_instead, $1 ]
- end
+ use_instead ||= $1 if subtype =~ /in favou?r of (.*)/
obsolete = true
end
subtype, notes = subtype.split(/ /, 2)
- use_instead.flatten!
- use_instead.compact!
-
refs, xrefs = parse_refs_and_files(record.css('xref'),
record.css('file'),
subtype)
@@ -86,7 +81,7 @@ class IANARegistry
mt.xrefs = xrefs
mt.registered = true
mt.obsolete = obsolete if obsolete
- mt.use_instead = use_instead unless use_instead.empty?
+ mt.use_instead = use_instead if use_instead
@types << mt
end
else
@@ -95,7 +90,7 @@ class IANARegistry
mt.registered = true
mt.xrefs = xrefs
mt.obsolete = obsolete if obsolete
- mt.use_instead = use_instead unless use_instead.empty?
+ mt.use_instead = use_instead if use_instead
}
end
end
diff --git a/type-lists/application.yaml b/type-lists/application.yaml
index 1b92b00..0ac409e 100644
--- a/type-lists/application.yaml
+++ b/type-lists/application.yaml
@@ -68,8 +68,7 @@
- mdb
- mde
obsolete: true
- use-instead:
- - application/x-msaccess
+ use-instead: application/x-msaccess
registered: false
- !ruby/object:MIME::Type
content-type: application/activemessage
@@ -455,8 +454,7 @@
extensions:
- bleep
obsolete: true
- use-instead:
- - application/x-bleeper
+ use-instead: application/x-bleeper
registered: false
- !ruby/object:MIME::Type
content-type: application/calendar+json
@@ -514,8 +512,7 @@
content-type: application/cals1840
encoding: base64
obsolete: true
- use-instead:
- - application/cals-1840
+ use-instead: application/cals-1840
registered: false
- !ruby/object:MIME::Type
content-type: application/cbor
@@ -1266,8 +1263,7 @@
- xls
- xlt
obsolete: true
- use-instead:
- - application/vnd.ms-excel
+ use-instead: application/vnd.ms-excel
registered: false
- !ruby/object:MIME::Type
content-type: application/exi
@@ -1413,15 +1409,13 @@
extensions:
- spl
obsolete: true
- use-instead:
- - application/x-futuresplash
+ use-instead: application/x-futuresplash
registered: false
- !ruby/object:MIME::Type
content-type: application/ghostview
encoding: base64
obsolete: true
- use-instead:
- - application/x-ghostview
+ use-instead: application/x-ghostview
registered: false
- !ruby/object:MIME::Type
content-type: application/gml+xml
@@ -1488,8 +1482,7 @@
extensions:
- hep
obsolete: true
- use-instead:
- - application/x-hep
+ use-instead: application/x-hep
registered: false
- !ruby/object:MIME::Type
content-type: application/http
@@ -1597,8 +1590,7 @@
- imagemap
- imap
obsolete: true
- use-instead:
- - application/x-imagemap
+ use-instead: application/x-imagemap
registered: false
- !ruby/object:MIME::Type
content-type: application/index
@@ -2022,8 +2014,7 @@
extensions:
- wks
obsolete: true
- use-instead:
- - application/vnd.lotus-1-2-3
+ use-instead: application/vnd.lotus-1-2-3
registered: false
- !ruby/object:MIME::Type
content-type: application/LXF
@@ -2065,8 +2056,7 @@
extensions:
- cpt
obsolete: true
- use-instead:
- - application/x-mac-compactpro
+ use-instead: application/x-mac-compactpro
registered: false
- !ruby/object:MIME::Type
content-type: application/macbinary
@@ -2142,8 +2132,7 @@
extensions:
- mcd
obsolete: true
- use-instead:
- - application/vnd.mcd
+ use-instead: application/vnd.mcd
registered: false
- !ruby/object:MIME::Type
content-type: application/mathematica
@@ -2168,8 +2157,7 @@
content-type: application/mathematica-old
encoding: base64
obsolete: true
- use-instead:
- - application/x-mathematica-old
+ use-instead: application/x-mathematica-old
registered: false
- !ruby/object:MIME::Type
content-type: application/mathml+xml
@@ -3521,8 +3509,7 @@
extensions:
- qtl
obsolete: true
- use-instead:
- - application/x-quicktimeplayer
+ use-instead: application/x-quicktimeplayer
registered: false
- !ruby/object:MIME::Type
content-type: application/raptorfec
@@ -3621,8 +3608,7 @@
content-type: application/remote_printing
encoding: base64
obsolete: true
- use-instead:
- - application/remote-printing
+ use-instead: application/remote-printing
registered: false
- !ruby/object:MIME::Type
content-type: application/reputon+json
@@ -4208,8 +4194,7 @@
- smi
- smil
obsolete: true
- use-instead:
- - application/smil+xml
+ use-instead: application/smil+xml
references:
- IANA
- RFC4536
@@ -4648,8 +4633,7 @@
extensions:
- tbk
obsolete: true
- use-instead:
- - application/x-toolbook
+ use-instead: application/x-toolbook
registered: false
- !ruby/object:MIME::Type
content-type: application/ttml+xml
@@ -4799,8 +4783,7 @@
extensions:
- bck
obsolete: true
- use-instead:
- - application/x-VMSBACKUP
+ use-instead: application/x-VMSBACKUP
registered: false
- !ruby/object:MIME::Type
content-type: application/vnd.3gpp.bsf+xml
@@ -5400,8 +5383,7 @@
content-type: application/vnd.arastra.swi
encoding: base64
obsolete: true
- use-instead:
- - application/vnd.aristanetworks.swi
+ use-instead: application/vnd.aristanetworks.swi
references:
- IANA
- "[Bill_Fenner]"
@@ -8912,8 +8894,7 @@
content-type: application/vnd.informix-visionary
encoding: base64
obsolete: true
- use-instead:
- - application/vnd.visionary
+ use-instead: application/vnd.visionary
references:
- IANA
- "[Christopher_Gales]"
@@ -11478,8 +11459,7 @@
content-type: application/vnd.nokia.ncd+xml
encoding: base64
obsolete: true
- use-instead:
- - application/vnd.nokia.ncd
+ use-instead: application/vnd.nokia.ncd
references:
- IANA
- "[Nokia]"
@@ -16973,8 +16953,7 @@
extensions:
- wp
obsolete: true
- use-instead:
- - application/vnd.wordperfect
+ use-instead: application/vnd.wordperfect
registered: false
- !ruby/object:MIME::Type
content-type: application/wordperfect5.1
@@ -16998,8 +16977,7 @@
extensions:
- wp6
obsolete: true
- use-instead:
- - application/x-wordperfect6.1
+ use-instead: application/x-wordperfect6.1
registered: false
- !ruby/object:MIME::Type
content-type: application/wordperfectd
@@ -17007,8 +16985,7 @@
extensions:
- wpd
obsolete: true
- use-instead:
- - application/vnd.wordperfect
+ use-instead: application/vnd.wordperfect
registered: false
- !ruby/object:MIME::Type
content-type: application/wsdl+xml
@@ -17050,8 +17027,7 @@
extensions:
- wk
obsolete: true
- use-instead:
- - application/vnd.lotus-1-2-3
+ use-instead: application/vnd.lotus-1-2-3
registered: false
- !ruby/object:MIME::Type
content-type: application/x-7z-compressed
@@ -17080,8 +17056,7 @@
- mdb
- mde
obsolete: true
- use-instead:
- - application/x-msaccess
+ use-instead: application/x-msaccess
registered: false
- !ruby/object:MIME::Type
content-type: application/x-ace-compressed
@@ -17228,8 +17203,7 @@
- z
- Z
obsolete: true
- use-instead:
- - application/x-compressed
+ use-instead: application/x-compressed
registered: false
- !ruby/object:MIME::Type
content-type: application/x-compressed
@@ -17364,8 +17338,7 @@
content-type: application/x-excel
encoding: base64
obsolete: true
- use-instead:
- - application/vnd.ms-excel
+ use-instead: application/vnd.ms-excel
registered: false
- !ruby/object:MIME::Type
content-type: application/x-font-bdf
@@ -17512,8 +17485,7 @@
extensions:
- gz
obsolete: true
- use-instead:
- - application/gzip
+ use-instead: application/gzip
registered: false
- !ruby/object:MIME::Type
content-type: application/x-hdf
@@ -17628,8 +17600,7 @@
extensions:
- js
obsolete: true
- use-instead:
- - application/javascript
+ use-instead: application/javascript
registered: false
- !ruby/object:MIME::Type
content-type: application/x-koan
@@ -17655,8 +17626,7 @@
extensions:
- wks
obsolete: true
- use-instead:
- - application/vnd.lotus-1-2-3
+ use-instead: application/vnd.lotus-1-2-3
registered: false
- !ruby/object:MIME::Type
content-type: application/x-lzh-compressed
@@ -17701,8 +17671,7 @@
- book
- fbdoc
obsolete: true
- use-instead:
- - application/vnd.framemaker
+ use-instead: application/vnd.framemaker
registered: false
- !ruby/object:MIME::Type
content-type: application/x-mathcad
@@ -17710,8 +17679,7 @@
extensions:
- mcd
obsolete: true
- use-instead:
- - application/vnd.mcd
+ use-instead: application/vnd.mcd
registered: false
- !ruby/object:MIME::Type
content-type: application/x-mathematica-old
@@ -17900,8 +17868,7 @@
- dot
- wrd
obsolete: true
- use-instead:
- - application/msword
+ use-instead: application/msword
registered: false
- !ruby/object:MIME::Type
content-type: application/x-mswrite
@@ -18020,8 +17987,7 @@
extensions:
- rtf
obsolete: true
- use-instead:
- - application/rtf
+ use-instead: application/rtf
registered: false
- !ruby/object:MIME::Type
content-type: application/x-ruby
@@ -18205,8 +18171,7 @@
- tr
- roff
obsolete: true
- use-instead:
- - text/troff
+ use-instead: text/troff
registered: false
- !ruby/object:MIME::Type
content-type: application/x-troff-man
@@ -18230,8 +18195,7 @@
content-type: application/x-u-star
encoding: base64
obsolete: true
- use-instead:
- - application/x-ustar
+ use-instead: application/x-ustar
registered: false
- !ruby/object:MIME::Type
content-type: application/x-ustar
@@ -18275,8 +18239,7 @@
- doc
- dot
obsolete: true
- use-instead:
- - application/msword
+ use-instead: application/msword
registered: false
- !ruby/object:MIME::Type
content-type: application/x-wordperfect
@@ -18284,8 +18247,7 @@
extensions:
- wp
obsolete: true
- use-instead:
- - application/vnd.wordperfect
+ use-instead: application/vnd.wordperfect
registered: false
- !ruby/object:MIME::Type
content-type: application/x-wordperfect6.1
@@ -18299,8 +18261,7 @@
extensions:
- wpd
obsolete: true
- use-instead:
- - application/vnd.wordperfect
+ use-instead: application/vnd.wordperfect
registered: false
- !ruby/object:MIME::Type
content-type: application/x-www-form-urlencoded
@@ -18384,8 +18345,7 @@
content-type: application/x400.bp
encoding: base64
obsolete: true
- use-instead:
- - application/x400-bp
+ use-instead: application/x400-bp
registered: false
- !ruby/object:MIME::Type
content-type: application/xacml+xml
diff --git a/type-lists/audio.yaml b/type-lists/audio.yaml
index c3bda95..3e5aa2d 100644
--- a/type-lists/audio.yaml
+++ b/type-lists/audio.yaml
@@ -1892,8 +1892,7 @@
extensions:
- qcp
obsolete: true
- use-instead:
- - audio/qcelp
+ use-instead: audio/qcelp
references:
- IANA
- RFC3625
diff --git a/type-lists/image.yaml b/type-lists/image.yaml
index 4d22813..fac7ac9 100644
--- a/type-lists/image.yaml
+++ b/type-lists/image.yaml
@@ -7,8 +7,7 @@
extensions:
- bmp
obsolete: true
- use-instead:
- - image/x-bmp
+ use-instead: image/x-bmp
registered: false
- !ruby/object:MIME::Type
content-type: image/cgm
@@ -31,8 +30,7 @@
content-type: image/cmu-raster
encoding: base64
obsolete: true
- use-instead:
- - image/x-cmu-raster
+ use-instead: image/x-cmu-raster
registered: false
- !ruby/object:MIME::Type
content-type: image/example
@@ -313,8 +311,7 @@
extensions:
- tga
obsolete: true
- use-instead:
- - image/x-targa
+ use-instead: image/x-targa
registered: false
- !ruby/object:MIME::Type
content-type: image/tiff
@@ -416,8 +413,7 @@
extensions:
- dgn
obsolete: true
- use-instead:
- - image/x-vnd.dgn
+ use-instead: image/x-vnd.dgn
registered: false
- !ruby/object:MIME::Type
content-type: image/vnd.djvu
@@ -662,8 +658,7 @@
content-type: image/vnd.net.fpx
encoding: base64
obsolete: true
- use-instead:
- - image/vnd.net-fpx
+ use-instead: image/vnd.net-fpx
registered: false
- !ruby/object:MIME::Type
content-type: image/vnd.radiance
diff --git a/type-lists/multipart.yaml b/type-lists/multipart.yaml
index 261d90d..6ada894 100644
--- a/type-lists/multipart.yaml
+++ b/type-lists/multipart.yaml
@@ -202,8 +202,7 @@
content-type: multipart/x-parallel
encoding: base64
obsolete: true
- use-instead:
- - multipart/parallel
+ use-instead: multipart/parallel
registered: false
- !ruby/object:MIME::Type
content-type: multipart/x-tar
diff --git a/type-lists/text.yaml b/type-lists/text.yaml
index 0b7fb47..d9e895f 100644
--- a/type-lists/text.yaml
+++ b/type-lists/text.yaml
@@ -54,8 +54,7 @@
extensions:
- csv
obsolete: true
- use-instead:
- - text/csv
+ use-instead: text/csv
registered: false
- !ruby/object:MIME::Type
content-type: text/css
@@ -158,8 +157,7 @@
content-type: text/ecmascript
encoding: quoted-printable
obsolete: true
- use-instead:
- - application/ecmascript
+ use-instead: application/ecmascript
references:
- IANA
- RFC4329
@@ -263,8 +261,7 @@
extensions:
- js
obsolete: true
- use-instead:
- - application/javascript
+ use-instead: application/javascript
references:
- IANA
- RFC4329
@@ -819,8 +816,7 @@
content-type: text/vnd.flatland.3dml
encoding: quoted-printable
obsolete: true
- use-instead:
- - model/vnd.flatland.3dml
+ use-instead: model/vnd.flatland.3dml
registered: false
- !ruby/object:MIME::Type
content-type: text/vnd.fly
@@ -1191,8 +1187,7 @@
extensions:
- rtf
obsolete: true
- use-instead:
- - text/rtf
+ use-instead: text/rtf
registered: false
- !ruby/object:MIME::Type
content-type: text/x-setext
@@ -1237,8 +1232,7 @@
content-type: text/x-vnd.flatland.3dml
encoding: quoted-printable
obsolete: true
- use-instead:
- - model/vnd.flatland.3dml
+ use-instead: model/vnd.flatland.3dml
registered: false
- !ruby/object:MIME::Type
content-type: text/x-yaml
diff --git a/type-lists/video.yaml b/type-lists/video.yaml
index 7bc54ae..8e34a02 100644
--- a/type-lists/video.yaml
+++ b/type-lists/video.yaml
@@ -110,8 +110,7 @@
extensions:
- dl
obsolete: true
- use-instead:
- - video/x-dl
+ use-instead: video/x-dl
registered: false
- !ruby/object:MIME::Type
content-type: video/DV
@@ -160,8 +159,7 @@
extensions:
- gl
obsolete: true
- use-instead:
- - video/x-gl
+ use-instead: video/x-gl
registered: false
- !ruby/object:MIME::Type
content-type: video/H261