m2config 0.5.0 → 0.5.2

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: 22149dceed17d88788e956fe65fbf666350426e3
4
- data.tar.gz: 6c8871d2b828cdd74696d14c7e647c8b5d87b301
3
+ metadata.gz: 8dfeb1a86a0a6cdf4af5bb69f36298d1baa1f97b
4
+ data.tar.gz: f8fdfff8b5ab0941d27ce01519195936ea1c2ce3
5
5
  SHA512:
6
- metadata.gz: 87479944f11ec8be606b18ba960e4bc8178dd65d5cba95a40463cfd79a3d0038781dc6f1d242b82c92b8af66fc86add5753566abcfe58833783f01f3f2f65b39
7
- data.tar.gz: 77d1fab253e7b2782f47c15eb3dcbf7fa9bb8fbbf41f9f0fc3cb5ec8e4990b51e10ed8039cbfe3b13ee2d8e0210b6f16bf393c21bd537c29a9f7b0812ec02761
6
+ metadata.gz: adf30e48ee1e39f25e694ade3172cc29464d34dd3c15221ec145df190e17c362758d7bc00b551362e798ef11b2f4a87bf75483713d6c56dbbe9ba0cef0bface4
7
+ data.tar.gz: 0952a47d1daceaf5cf1eb94b92d053d385f8597a84917de9050a819c4ebf3d1121123962b20febdb883ce6bfd517854667a2518be37e32c7a2ff8b50ed826d4f
data/Gemfile CHANGED
@@ -1,7 +1,6 @@
1
1
  source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
- gem 'mime-types', git: "git://github.com/ameuret/mime-types.git", branch: 'enumerable'
5
4
 
6
5
  group :dev do
7
6
  gem 'guard'
data/README.md CHANGED
@@ -78,11 +78,12 @@ TODO
78
78
 
79
79
  A few features that you may miss if your needs go beyond mine:
80
80
 
81
- - MIME types are not handled (trivial to add, just ask)
82
- - Multiple DBs in same process
83
- - A DSL-like syntax (likely to improve readability in complex setups)
84
- - Declare proper associations
85
- - Cleanup / consolidate DB (delete unreferenced entries)
81
+ - [x] MIME types are not handled (trivial to add, just ask)
82
+ - [ ] Support forcing redefinition of existing extension in MimeType
83
+ - [ ] Multiple DBs in same process (must use Sequel's sharding support)
84
+ - [ ] A DSL-like syntax (likely to improve readability in complex setups)
85
+ - [ ] Declare proper associations
86
+ - [ ] Cleanup / consolidate DB (delete unreferenced entries)
86
87
 
87
88
 
88
89
 
@@ -1,21 +1,66 @@
1
1
  require "mime/types"
2
+ require "yaml"
2
3
 
3
4
  module M2Config
4
5
  class MimeType < Sequel::Model(:mimetype)
5
6
 
7
+ MONGREL2_PREFS = YAML.load File.read "#{File.dirname(__FILE__)}/mongrel2.mime.yml"
8
+ RECESSIVE = YAML.load File.read "#{File.dirname(__FILE__)}/mongrel2.mime.yml"
9
+ SQL_FIND_DUPLICATES = <<-SQL
10
+ select mimetype, extension, count(*)
11
+ from mimetype
12
+ group by extension
13
+ having count(*)>1
14
+ SQL
15
+
6
16
  def self.populate_table
17
+ raise RuntimeError, "Table must be empty" if db[:mimetype].count > 0
7
18
  rows = []
8
19
  MIME::Types.each {
9
20
  |type|
21
+ next if not_dominant(type)
10
22
  type.extensions.each {
11
23
  |ext|
24
+ ext = "."+ext
25
+ clashingType = M2Config::MimeType[extension:ext]
26
+ raise ArgumentError, "extension #{ext} is already covered by #{clashingType.mimetype} type" if clashingType
12
27
  rows << [type.content_type, ext]
13
28
  }
14
29
  }
15
- db[:mimetype].import([:mimetype, :extension], rows)
30
+ db.transaction {
31
+ db[:mimetype].import([:mimetype, :extension], rows)
32
+ }
33
+ remove_duplicates
34
+ end
35
+
36
+ def self.not_dominant( mtype )
37
+ mtype.obsolete? || superceded?(mtype)
38
+ end
39
+
40
+ def self.superceded?( mtype )
41
+ mtype.docs =~ /instead/
16
42
  end
17
43
 
44
+ def self.remove_duplicates
45
+ db[SQL_FIND_DUPLICATES].all.each {
46
+ |r|
47
+ ext = r[:extension]
48
+ preferred = MONGREL2_PREFS[ext]
49
+ if preferred
50
+ db[:mimetype].where(extension:ext).delete
51
+ db[:mimetype].insert(extension:ext, mimetype:preferred)
52
+ else
53
+ raise ArgumentError, "#{ext} has multiple content types but no Mongrel2 preference"
54
+ end
55
+ }
56
+ raise RuntimeError, "Still duplicates after removing duplicates!" if
57
+ db[SQL_FIND_DUPLICATES].all.size > 0
58
+ end
59
+
18
60
  def initialize( fields )
61
+ raise ArgumentError, "Extension must start with a ." unless fields[:extension] =~ /^\./
62
+ type = M2Config::MimeType[extension:fields[:extension]]
63
+ raise ArgumentError, "extension #{fields[:extension]} is already covered by #{type.mimetype} type" if type
19
64
  super(fields, false)
20
65
  save
21
66
  end
@@ -0,0 +1,856 @@
1
+ '.obd': 'application/x-msbinder'
2
+ '.obj': 'application/octet-stream'
3
+ '.silo': 'model/mesh'
4
+ '.pml': 'application/vnd.ctc-posml'
5
+ '.gam': 'chemical/x-gamess-input'
6
+ '.iso': 'application/x-iso9660-image'
7
+ '.rl': 'application/resource-lists+xml'
8
+ '.ras': 'image/x-cmu-raster'
9
+ '.rar': 'application/rar'
10
+ '.embl': 'chemical/x-embl-dl-nucleotide'
11
+ '.mrc': 'application/marc'
12
+ '.sdkd': 'application/vnd.solent.sdkm+xml'
13
+ '.bcpio': 'application/x-bcpio'
14
+ '.sdkm': 'application/vnd.solent.sdkm+xml'
15
+ '.list3820': 'application/vnd.ibm.modcap'
16
+ '.ecelp7470': 'audio/vnd.nuera.ecelp7470'
17
+ '.ist': 'chemical/x-isostar'
18
+ '.bz': 'application/x-bzip'
19
+ '.bmp': 'image/x-ms-bmp'
20
+ '.gen': 'chemical/x-genbank'
21
+ '.jisp': 'application/vnd.jisp'
22
+ '.bmi': 'application/vnd.bmi'
23
+ '.tcl': 'text/x-tcl'
24
+ '.dvi': 'application/x-dvi'
25
+ '.aif': 'audio/x-aiff'
26
+ '.rd': 'chemical/x-mdl-rdfile'
27
+ '.gjf': 'chemical/x-gaussian-input'
28
+ '.hpid': 'application/vnd.hp-hpid'
29
+ '.ott': 'application/vnd.oasis.opendocument.text-template'
30
+ '.rss': 'application/rss+xml'
31
+ '.ots': 'application/vnd.oasis.opendocument.spreadsheet-template'
32
+ '.cst': 'application/vnd.commonspace'
33
+ '.p10': 'application/pkcs10'
34
+ '.csv': 'text/comma-separated-values'
35
+ '.p12': 'application/x-pkcs12'
36
+ '.csp': 'application/vnd.commonspace'
37
+ '.sus': 'application/vnd.sus-calendar'
38
+ '.css': 'text/css'
39
+ '.csm': 'chemical/x-csml'
40
+ '.otg': 'application/vnd.oasis.opendocument.graphics-template'
41
+ '.otf': 'application/vnd.oasis.opendocument.formula-template'
42
+ '.csh': 'text/x-csh'
43
+ '.otc': 'application/vnd.oasis.opendocument.chart-template'
44
+ '.otm': 'application/vnd.oasis.opendocument.text-master'
45
+ '.csf': 'chemical/x-cache-csf'
46
+ '.clkp': 'application/vnd.crick.clicker.palette'
47
+ '.pdf': 'application/pdf'
48
+ '.bdm': 'application/vnd.syncml.dm+wbxml'
49
+ '.pm': 'text/x-perl'
50
+ '.pl': 'text/x-perl'
51
+ '.atomsvc': 'application/atomsvc+xml'
52
+ '.pk': 'application/x-tex-pk'
53
+ '.chm': 'chemical/x-chemdraw'
54
+ '.djv': 'image/vnd.djvu'
55
+ '.hta': 'application/hta'
56
+ '.py': 'text/x-python'
57
+ '.mopcrt': 'chemical/x-mopac-input'
58
+ '.xml': 'application/xml'
59
+ '.umj': 'application/vnd.umajin'
60
+ '.htm': 'text/html'
61
+ '.m2a': 'audio/mpeg'
62
+ '.fig': 'application/x-xfig'
63
+ '.sig': 'application/pgp-signature'
64
+ '.sid': 'audio/prs.sid'
65
+ '.cab': 'application/vnd.ms-cab-compressed'
66
+ '.tsv': 'text/tab-separated-values'
67
+ '.so': 'application/octet-stream'
68
+ '.ltx': 'text/x-tex'
69
+ '.tsp': 'application/dsptype'
70
+ '.ltf': 'application/vnd.frogans.ltf'
71
+ '.wbs': 'application/vnd.criticaltools.wbs+xml'
72
+ '.prc': 'application/vnd.palm'
73
+ '.pre': 'application/vnd.lotus-freelance'
74
+ '.prf': 'application/pics-rules'
75
+ '.oprc': 'application/vnd.palm'
76
+ '.c3d': 'chemical/x-chem3d'
77
+ '.dd2': 'application/vnd.oma.dd2+xml'
78
+ '.cat': 'application/vnd.ms-pki.seccat'
79
+ '.dms': 'application/x-dms'
80
+ '.xla': 'application/vnd.ms-excel'
81
+ '.fti': 'application/vnd.anser-web-funds-transfer-initiation'
82
+ '.ief': 'image/ief'
83
+ '.mp4s': 'application/mp4'
84
+ '.qwt': 'application/vnd.quark.quarkxpress'
85
+ '.c4d': 'application/vnd.clonk.c4group'
86
+ '.c4g': 'application/vnd.clonk.c4group'
87
+ '.c4f': 'application/vnd.clonk.c4group'
88
+ '.texinfo': 'application/x-texinfo'
89
+ '.mp4a': 'audio/mp4'
90
+ '.dmg': 'application/x-apple-diskimage'
91
+ '.c4p': 'application/vnd.clonk.c4group'
92
+ '.c4u': 'application/vnd.clonk.c4group'
93
+ '.vis': 'application/vnd.visionary'
94
+ '.viv': 'video/vnd.vivo'
95
+ '.listafp': 'application/vnd.ibm.modcap'
96
+ '.ddd': 'application/vnd.fujixerox.ddd'
97
+ '.tmo': 'application/vnd.tmobile-livetv'
98
+ '.ext': 'application/vnd.novadigm.ext'
99
+ '.csml': 'chemical/x-csml'
100
+ '.mus': 'application/vnd.musician'
101
+ '.exe': 'application/x-msdos-program'
102
+ '.xpw': 'application/vnd.intercon.formnet'
103
+ '.wsc': 'text/scriptlet'
104
+ '.xpr': 'application/vnd.is-xpr'
105
+ '.xps': 'application/vnd.ms-xpsdocument'
106
+ '.dsc': 'text/prs.lines.tag'
107
+ '.xpx': 'application/vnd.intercon.formnet'
108
+ '.mscml': 'application/mediaservercontrol+xml'
109
+ '.rep': 'application/vnd.businessobjects'
110
+ '.xpm': 'image/x-xpixmap'
111
+ '.mpeg': 'video/mpeg'
112
+ '.mxf': 'application/mxf'
113
+ '.spq': 'application/scvp-vp-request'
114
+ '.spp': 'application/scvp-vp-response'
115
+ '.ami': 'application/vnd.amiga.ami'
116
+ '.fm': 'application/x-maker'
117
+ '.ram': 'audio/x-pn-realaudio'
118
+ '.sgml': 'text/sgml'
119
+ '.spf': 'application/vnd.yamaha.smaf-phrase'
120
+ '.cil': 'application/vnd.ms-artgalry'
121
+ '.spc': 'chemical/x-galactic-spc'
122
+ '.spl': 'application/x-futuresplash'
123
+ '.bat': 'application/x-msdos-program'
124
+ '.clkx': 'application/vnd.crick.clicker'
125
+ '.portpkg': 'application/vnd.macports.portpkg'
126
+ '.emb': 'chemical/x-embl-dl-nucleotide'
127
+ '.eml': 'message/rfc822'
128
+ '.cbin': 'chemical/x-cactvs-binary'
129
+ '.diff': 'text/plain'
130
+ '.gac': 'application/vnd.groove-account'
131
+ '.cww': 'application/prs.cww'
132
+ '.gal': 'chemical/x-gaussian-log'
133
+ '.efif': 'application/vnd.picsel'
134
+ '.isp': 'application/x-internet-signup'
135
+ '.gjc': 'chemical/x-gaussian-input'
136
+ '.wad': 'application/x-doom'
137
+ '.saf': 'application/vnd.yamaha.smaf-audio'
138
+ '.txf': 'application/vnd.mobius.txf'
139
+ '.utz': 'application/vnd.uiq.theme'
140
+ '.txd': 'application/vnd.genomatix.tuxedo'
141
+ '.m2v': 'video/mpeg'
142
+ '.art': 'image/x-jg'
143
+ '.tk': 'text/x-tcl'
144
+ '.wav': 'audio/x-wav'
145
+ '.rsd': 'application/rsd+xml'
146
+ '.xbm': 'image/x-xbitmap'
147
+ '.txt': 'text/plain'
148
+ '.jlt': 'application/vnd.hp-jlyt'
149
+ '.xbd': 'application/vnd.fujixerox.docuworks.binder'
150
+ '.wax': 'audio/x-ms-wax'
151
+ '.mlp': 'application/vnd.dolby.mlp'
152
+ '.sc': 'application/vnd.ibm.secure-container'
153
+ '.twd': 'application/vnd.simtech-mindmapper'
154
+ '.dna': 'application/vnd.dna'
155
+ '.ts': 'text/texmacs'
156
+ '.tr': 'application/x-troff'
157
+ '.distz': 'application/octet-stream'
158
+ '.fbdoc': 'application/x-maker'
159
+ '.tm': 'text/texmacs'
160
+ '.smil': 'application/smil'
161
+ '.fnc': 'application/vnd.frogans.fnc'
162
+ '.sh': 'text/x-sh'
163
+ '.et3': 'application/vnd.eszigno3+xml'
164
+ '.xif': 'image/vnd.xiff'
165
+ '.daf': 'application/vnd.mobius.daf'
166
+ '.ez2': 'application/vnd.ezpix-album'
167
+ '.old': 'application/x-trash'
168
+ '.cer': 'chemical/x-cerius'
169
+ '.smf': 'application/vnd.stardivision.math'
170
+ '.ufd': 'application/vnd.ufdl'
171
+ '.cef': 'chemical/x-cxf'
172
+ '.smi': 'application/smil'
173
+ '.bsd': 'chemical/x-crossfire'
174
+ '.ctab': 'chemical/x-cactvs-binary'
175
+ '.inp': 'chemical/x-gamess-input'
176
+ '.sfs': 'application/vnd.spotfire.sfs'
177
+ '.ecma': 'application/ecmascript'
178
+ '.etx': 'text/x-setext'
179
+ '.iges': 'model/iges'
180
+ '.dxr': 'application/x-director'
181
+ '.dxp': 'application/vnd.spotfire.dxp'
182
+ '.png': 'image/png'
183
+ '.mhtml': 'message/rfc822'
184
+ '.tar': 'application/x-tar'
185
+ '.pnm': 'image/x-portable-anymap'
186
+ '.taz': 'application/x-gtar'
187
+ '.pnt': 'image/x-macpaint'
188
+ '.mqy': 'application/vnd.mobius.mqy'
189
+ '.dxf': 'image/vnd.dxf'
190
+ '.rnc': 'application/relax-ng-compact-syntax'
191
+ '.tao': 'application/vnd.tao.intent-module-archive'
192
+ '.323': 'text/h323'
193
+ '.wvx': 'video/x-ms-wvx'
194
+ '.gdl': 'model/vnd.gdl'
195
+ '.hpgl': 'application/vnd.hp-hpgl'
196
+ '.bak': 'application/x-trash'
197
+ '.jng': 'image/x-jng'
198
+ '.ecelp9600': 'audio/vnd.nuera.ecelp9600'
199
+ '.wbxml': 'application/vnd.wap.wbxml'
200
+ '.chrt': 'application/x-kchart'
201
+ '.wsdl': 'application/wsdl+xml'
202
+ '.dwg': 'image/vnd.dwg'
203
+ '.dwf': 'model/vnd.dwf'
204
+ '.jmz': 'application/x-jmol'
205
+ '.fg5': 'application/vnd.fujitsu.oasysgp'
206
+ '.oza': 'application/x-oz-application'
207
+ '.cc': 'text/x-c++src'
208
+ '.cu': 'application/cu-seeme'
209
+ '.rxn': 'chemical/x-mdl-rxnfile'
210
+ '.ei6': 'application/vnd.pg.osasli'
211
+ '.sty': 'text/x-tex'
212
+ '.rpm': 'application/x-redhat-package-manager'
213
+ '.mcd': 'application/vnd.mcd'
214
+ '.nnd': 'application/vnd.noblenet-directory'
215
+ '.nlu': 'application/vnd.neurolanguage.nlu'
216
+ '.str': 'application/vnd.pg.format'
217
+ '.stw': 'application/vnd.sun.xml.writer.template'
218
+ '.mjp2': 'video/mj2'
219
+ '.xhvml': 'application/xv+xml'
220
+ '.stk': 'application/hyperstudio'
221
+ '.crl': 'application/x-pkcs7-crl'
222
+ '.semd': 'application/vnd.semd'
223
+ '.nnw': 'application/vnd.noblenet-web'
224
+ '.semf': 'application/vnd.semf'
225
+ '.stc': 'application/vnd.sun.xml.calc.template'
226
+ '.crd': 'application/x-mscardfile'
227
+ '.std': 'application/vnd.sun.xml.draw.template'
228
+ '.m1v': 'video/mpeg'
229
+ '.stf': 'application/vnd.wt.stf'
230
+ '.icz': 'text/calendar'
231
+ '.mime': 'message/rfc822'
232
+ '.hin': 'chemical/x-hin'
233
+ '.avi': 'video/x-msvideo'
234
+ '.fgd': 'application/x-director'
235
+ '.istr': 'chemical/x-isostar'
236
+ '.cascii': 'chemical/x-cactvs-binary'
237
+ '.qfx': 'application/vnd.intu.qfx'
238
+ '.wdb': 'application/vnd.ms-works'
239
+ '.cla': 'application/vnd.claymore'
240
+ '.pwn': 'application/vnd.3m.post-it-notes'
241
+ '.hxx': 'text/x-c++hdr'
242
+ '.wml': 'text/vnd.wap.wml'
243
+ '.mht': 'message/rfc822'
244
+ '.wma': 'audio/x-ms-wma'
245
+ '.wmf': 'application/x-msmetafile'
246
+ '.wmd': 'application/x-ms-wmd'
247
+ '.wmz': 'application/x-ms-wmz'
248
+ '.clp': 'application/x-msclip'
249
+ '.wmx': 'video/x-ms-wmx'
250
+ '.gamin': 'chemical/x-gamess-input'
251
+ '.pwz': 'application/vnd.ms-powerpoint'
252
+ '.hpp': 'text/x-c++hdr'
253
+ '.mc1': 'application/vnd.medcalcdata'
254
+ '.m13': 'application/x-msmediaview'
255
+ '.m14': 'application/x-msmediaview'
256
+ '.dist': 'application/octet-stream'
257
+ '.nml': 'application/vnd.enliven'
258
+ '.kpt': 'application/x-kpresenter'
259
+ '.kpr': 'application/x-kpresenter'
260
+ '.src': 'application/x-wais-source'
261
+ '.sik': 'application/x-trash'
262
+ '.oa2': 'application/vnd.fujitsu.oasys2'
263
+ '.oa3': 'application/vnd.fujitsu.oasys3'
264
+ '.gtar': 'application/x-gtar'
265
+ '.p7m': 'application/pkcs7-mime'
266
+ '.nws': 'message/rfc822'
267
+ '.deb': 'application/x-debian-package'
268
+ '.p7c': 'application/pkcs7-mime'
269
+ '.p7b': 'application/x-pkcs7-certificates'
270
+ '.book': 'application/x-maker'
271
+ '.def': 'text/plain'
272
+ '.mts': 'model/vnd.mts'
273
+ '.cls': 'text/x-tex'
274
+ '.nwc': 'application/x-nwc'
275
+ '.bpk': 'application/octet-stream'
276
+ '.ez': 'application/andrew-inset'
277
+ '.der': 'application/x-x509-ca-cert'
278
+ '.p7s': 'application/pkcs7-signature'
279
+ '.p7r': 'application/x-pkcs7-certreqresp'
280
+ '.pntg': 'image/x-macpaint'
281
+ '.eps': 'application/postscript'
282
+ '.xul': 'application/vnd.mozilla.xul+xml'
283
+ '.ace': 'application/x-ace-compressed'
284
+ '.hh': 'text/x-c++hdr'
285
+ '.cdr': 'image/x-coreldraw'
286
+ '.pdb': 'chemical/x-pdb'
287
+ '.dfac': 'application/vnd.dreamfactory'
288
+ '.hs': 'text/x-haskell'
289
+ '.acu': 'application/vnd.acucobol'
290
+ '.wmlsc': 'application/vnd.wap.wmlscriptc'
291
+ '.oas': 'application/vnd.fujitsu.oasys'
292
+ '.c++': 'text/x-c++src'
293
+ '.tex': 'text/x-tex'
294
+ '.wri': 'application/x-mswrite'
295
+ '.ica': 'application/x-ica'
296
+ '.irp': 'application/vnd.irepository.package+xml'
297
+ '.wrl': 'x-world/x-vrml'
298
+ '.oti': 'application/vnd.oasis.opendocument.image-template'
299
+ '.ssf': 'application/vnd.epson.ssf'
300
+ '.sitx': 'application/x-stuffitx'
301
+ '.oth': 'application/vnd.oasis.opendocument.text-web'
302
+ '.xpi': 'application/x-xpinstall'
303
+ '.rtx': 'text/richtext'
304
+ '.moc': 'text/x-moc'
305
+ '.irm': 'application/vnd.ibm.rights-management'
306
+ '.cdf': 'application/x-cdf'
307
+ '.joda': 'application/vnd.joost.joda-archive'
308
+ '.rpst': 'application/vnd.nokia.radio-preset'
309
+ '.gsm': 'audio/x-gsm'
310
+ '.fdf': 'application/vnd.fdf'
311
+ '.elc': 'application/octet-stream'
312
+ '.man': 'application/x-troff-man'
313
+ '.rpss': 'application/vnd.nokia.radio-presets'
314
+ '.pac': 'application/x-ns-proxy-autoconfig'
315
+ '.flac': 'application/x-flac'
316
+ '.hps': 'application/vnd.hp-hps'
317
+ '.mfm': 'application/vnd.mfmp'
318
+ '.pas': 'text/x-pascal'
319
+ '.pat': 'image/x-coreldrawpattern'
320
+ '.fbs': 'image/vnd.fastbidsheet'
321
+ '.gim': 'application/vnd.groove-identity-message'
322
+ '.kfo': 'application/vnd.kde.kformula'
323
+ '.moo': 'chemical/x-mopac-out'
324
+ '.mol': 'chemical/x-mdl-molfile'
325
+ '.ims': 'application/vnd.ms-ims'
326
+ '.gif': 'image/gif'
327
+ '.lrm': 'application/vnd.ms-lrm'
328
+ '.cdkey': 'application/vnd.mediastation.cdkey'
329
+ '.atomcat': 'application/atomcat+xml'
330
+ '.les': 'application/vnd.hhe.lesson-player'
331
+ '.shtml': 'text/html'
332
+ '.djvu': 'image/vnd.djvu'
333
+ '.rtf': 'text/rtf'
334
+ '.fchk': 'chemical/x-gaussian-checkpoint'
335
+ '.mop': 'chemical/x-mopac-input'
336
+ '.mov': 'video/quicktime'
337
+ '.xcf': 'application/x-xcf'
338
+ '.twds': 'application/vnd.simtech-mindmapper'
339
+ '.movie': 'video/x-sgi-movie'
340
+ '.uls': 'text/iuls'
341
+ '.qt': 'video/quicktime'
342
+ '.pyc': 'application/x-python-code'
343
+ '.sv4cpio': 'application/x-sv4cpio'
344
+ '.rms': 'application/vnd.jcp.javame.midlet-rms'
345
+ '.com': 'application/x-msdos-program'
346
+ '.cac': 'chemical/x-cache'
347
+ '.mathml': 'application/mathml+xml'
348
+ '.key': 'application/pgp-keys'
349
+ '.psp': 'text/x-psp'
350
+ '.wiz': 'application/msword'
351
+ '.vcd': 'application/x-cdlink'
352
+ '.vcg': 'application/vnd.groove-vcard'
353
+ '.vcf': 'text/x-vcard'
354
+ '.json': 'application/json'
355
+ '.shf': 'application/shf+xml'
356
+ '.cdbcmsg': 'application/vnd.contact.cmsg'
357
+ '.tpt': 'application/vnd.trid.tpt'
358
+ '.psb': 'application/vnd.3gpp.pic-bw-small'
359
+ '.vxml': 'application/voicexml+xml'
360
+ '.tpl': 'application/vnd.groove-tool-template'
361
+ '.htke': 'application/vnd.kenameaapp'
362
+ '.vcx': 'application/vnd.vcx'
363
+ '.xhtml': 'application/xhtml+xml'
364
+ '.midi': 'audio/midi'
365
+ '.tiff': 'image/tiff'
366
+ '.odg': 'application/vnd.oasis.opendocument.graphics'
367
+ '.texi': 'application/x-texinfo'
368
+ '.oda': 'application/oda'
369
+ '.ustar': 'application/x-ustar'
370
+ '.ssml': 'application/ssml+xml'
371
+ '.odb': 'application/vnd.oasis.opendocument.database'
372
+ '.odm': 'application/vnd.oasis.opendocument.text-master'
373
+ '.xvm': 'application/xv+xml'
374
+ '.see': 'application/vnd.seemail'
375
+ '.odi': 'application/vnd.oasis.opendocument.image'
376
+ '.mpkg': 'application/vnd.apple.installer+xml'
377
+ '.odt': 'application/vnd.oasis.opendocument.text'
378
+ '.3g2': 'video/3gpp2'
379
+ '.odp': 'application/vnd.oasis.opendocument.presentation'
380
+ '.ods': 'application/vnd.oasis.opendocument.spreadsheet'
381
+ '.stl': 'application/vnd.ms-pki.stl'
382
+ '.msi': 'application/x-msi'
383
+ '.ser': 'application/java-serialized-object'
384
+ '.text': 'text/plain'
385
+ '.ros': 'chemical/x-rosdal'
386
+ '.mpn': 'application/vnd.mophun.application'
387
+ '.mpm': 'application/vnd.blueice.multipass'
388
+ '.mpc': 'chemical/x-mopac-input'
389
+ '.mpa': 'video/mpeg'
390
+ '.mpg': 'video/mpeg'
391
+ '.mng': 'video/x-mng'
392
+ '.mpe': 'video/mpeg'
393
+ '.jdx': 'chemical/x-jcamp-dx'
394
+ '.mpy': 'application/vnd.ibm.minipay'
395
+ '.pot': 'text/plain'
396
+ '.ps': 'application/postscript'
397
+ '.g3': 'image/g3fax'
398
+ '.mpp': 'application/vnd.ms-project'
399
+ '.xspf': 'application/xspf+xml'
400
+ '.nsf': 'application/vnd.lotus-notes'
401
+ '.wmlc': 'application/vnd.wap.wmlc'
402
+ '.dpg': 'application/vnd.dpgraph'
403
+ '.nb': 'application/mathematica'
404
+ '.wmls': 'text/vnd.wap.wmlscript'
405
+ '.mmod': 'chemical/x-macromodel-input'
406
+ '.kon': 'application/vnd.kde.kontour'
407
+ '.karbon': 'application/vnd.kde.karbon'
408
+ '.prt': 'chemical/x-ncbi-asn1-ascii'
409
+ '.sw': 'chemical/x-swissprot'
410
+ '.alc': 'chemical/x-alchemy'
411
+ '.gf': 'application/x-tex-gf'
412
+ '.pfx': 'application/x-pkcs12'
413
+ '.m4a': 'audio/mpeg'
414
+ '.jnlp': 'application/x-java-jnlp-file'
415
+ '.gl': 'video/gl'
416
+ '.ivp': 'application/vnd.immervision-ivp'
417
+ '.ivu': 'application/vnd.immervision-ivu'
418
+ '.pfr': 'application/font-tdpfr'
419
+ '.mcif': 'chemical/x-mmcif'
420
+ '.m4v': 'video/mp4'
421
+ '.m4u': 'video/vnd.mpegurl'
422
+ '.swf': 'application/x-shockwave-flash'
423
+ '.m4p': 'audio/mp4a-latm'
424
+ '.mp3': 'audio/mpeg'
425
+ '.mp2': 'audio/mpeg'
426
+ '.pfa': 'application/x-font'
427
+ '.pfb': 'application/x-font'
428
+ '.mp4': 'video/mp4'
429
+ '.cxf': 'chemical/x-cxf'
430
+ '.hvp': 'application/vnd.yamaha.hv-voice'
431
+ '.rm': 'audio/x-pn-realaudio'
432
+ '.hvs': 'application/vnd.yamaha.hv-script'
433
+ '.scpt': 'application/octet-stream'
434
+ '.ra': 'audio/x-realaudio'
435
+ '.sbml': 'application/sbml+xml'
436
+ '.gsf': 'application/x-font'
437
+ '.hvd': 'application/vnd.yamaha.hv-dic'
438
+ '.cmdf': 'chemical/x-cmdf'
439
+ '.wcm': 'application/vnd.ms-works'
440
+ '.sxd': 'application/vnd.sun.xml.draw'
441
+ '.rs': 'application/rls-services+xml'
442
+ '.rq': 'application/sparql-query'
443
+ '.sxg': 'application/vnd.sun.xml.writer.global'
444
+ '.xop': 'application/xop+xml'
445
+ '.skd': 'application/x-koan'
446
+ '.sis': 'application/vnd.symbian.install'
447
+ '.h263': 'video/h263'
448
+ '.skm': 'application/x-koan'
449
+ '.h261': 'video/h261'
450
+ '.h264': 'video/h264'
451
+ '.skt': 'application/x-koan'
452
+ '.plf': 'application/vnd.pocketlearn'
453
+ '.skp': 'application/x-koan'
454
+ '.ufdl': 'application/vnd.ufdl'
455
+ '.for': 'text/x-fortran'
456
+ '.lvp': 'audio/vnd.lucent.voice'
457
+ '.hqx': 'application/mac-binhex40'
458
+ '.swfl': 'application/x-shockwave-flash'
459
+ '.ksp': 'application/x-kspread'
460
+ '.sit': 'application/x-stuffit'
461
+ '.doc': 'application/msword'
462
+ '.uu': 'text/x-uuencode'
463
+ '.shar': 'application/x-shar'
464
+ '.ptid': 'application/vnd.pvi.ptid1'
465
+ '.ksh': 'text/plain'
466
+ '.ccxml': 'application/ccxml+xml'
467
+ '.dot': 'application/msword'
468
+ '.cdy': 'application/vnd.cinderella'
469
+ '.cdx': 'chemical/x-cdx'
470
+ '.slt': 'application/vnd.epson.salt'
471
+ '.fvt': 'video/vnd.fvt'
472
+ '.vor': 'application/vnd.stardivision.writer'
473
+ '.ics': 'text/calendar'
474
+ '.o': 'application/x-object'
475
+ '.cdt': 'image/x-coreldrawtemplate'
476
+ '.ktr': 'application/vnd.kahootz'
477
+ '.qps': 'application/vnd.publishare-delta-tree'
478
+ '.ico': 'image/x-icon'
479
+ '.sti': 'application/vnd.sun.xml.impress.template'
480
+ '.uoml': 'application/vnd.uoml+xml'
481
+ '.ktz': 'application/vnd.kahootz'
482
+ '.ice': 'x-conference/x-cooltalk'
483
+ '.wbmp': 'image/vnd.wap.wbmp'
484
+ '.in': 'text/plain'
485
+ '.edm': 'application/vnd.novadigm.edm'
486
+ '.mp4v': 'video/mp4'
487
+ '.grv': 'application/vnd.groove-injector'
488
+ '.list': 'text/plain'
489
+ '.esf': 'application/vnd.epson.esf'
490
+ '.abw': 'application/x-abiword'
491
+ '.wspolicy': 'application/wspolicy+xml'
492
+ '.mpga': 'audio/mpeg'
493
+ '.pki': 'application/pkixcmp'
494
+ '.hdf': 'application/x-hdf'
495
+ '.davmount': 'application/davmount+xml'
496
+ '.xpdl': 'application/xml'
497
+ '.pkg': 'application/octet-stream'
498
+ '.zaz': 'application/vnd.zzazz.deck+xml'
499
+ '.wqd': 'application/vnd.wqd'
500
+ '.log': 'text/plain'
501
+ '.cxx': 'text/x-c++src'
502
+ '.srx': 'application/sparql-results+xml'
503
+ '.box': 'application/vnd.previewsystems.box'
504
+ '.boz': 'application/x-bzip2'
505
+ '.vcs': 'text/x-vcalendar'
506
+ '.oxt': 'application/vnd.openofficeorg.extension'
507
+ '.pbd': 'application/vnd.powerbuilder6'
508
+ '.bh2': 'application/vnd.fujitsu.oasysprs'
509
+ '.h++': 'text/x-c++hdr'
510
+ '.mpg4': 'video/mp4'
511
+ '.psd': 'image/x-photoshop'
512
+ '.gcd': 'text/x-pcs-gcd'
513
+ '.pbm': 'image/x-portable-bitmap'
514
+ '.gcf': 'application/x-graphing-calculator'
515
+ '.es3': 'application/vnd.eszigno3+xml'
516
+ '.qbo': 'application/vnd.intu.qbo'
517
+ '.vrml': 'x-world/x-vrml'
518
+ '.msty': 'application/vnd.muvee.style'
519
+ '.dtd': 'application/xml-dtd'
520
+ '.gcg': 'chemical/x-gcg8-sequence'
521
+ '.pclxl': 'application/vnd.hp-pclxl'
522
+ '.xdp': 'application/vnd.adobe.xdp+xml'
523
+ '.apr': 'application/vnd.lotus-approach'
524
+ '.mbk': 'application/vnd.mobius.mbk'
525
+ '.cdxml': 'application/vnd.chemdraw+xml'
526
+ '.wpl': 'application/vnd.ms-wpl'
527
+ '.kar': 'audio/midi'
528
+ '.org': 'application/vnd.lotus-organizer'
529
+ '.xslt': 'application/xslt+xml'
530
+ '.aiff': 'audio/x-aiff'
531
+ '.vrm': 'x-world/x-vrml'
532
+ '.aifc': 'audio/x-aiff'
533
+ '.xdm': 'application/vnd.syncml.dm+xml'
534
+ '.gqf': 'application/vnd.grafeq'
535
+ '.crt': 'application/x-x509-ca-cert'
536
+ '.flx': 'text/vnd.fmi.flexstor'
537
+ '.fly': 'text/vnd.fly'
538
+ '.kne': 'application/vnd.kinar'
539
+ '.edx': 'application/vnd.novadigm.edx'
540
+ '.flv': 'video/x-flv'
541
+ '.flw': 'application/vnd.kde.kivio'
542
+ '.html': 'text/html'
543
+ '.susp': 'application/vnd.sus-calendar'
544
+ '.ez3': 'application/vnd.ezpix-package'
545
+ '.knp': 'application/vnd.kinar'
546
+ '.gqs': 'application/vnd.grafeq'
547
+ '.hbci': 'application/vnd.hbci'
548
+ '.ins': 'application/x-internet-signup'
549
+ '.pkipath': 'application/pkix-pkipath'
550
+ '.lzx': 'application/x-lzx'
551
+ '.odc': 'application/vnd.oasis.opendocument.chart'
552
+ '.nns': 'application/vnd.noblenet-sealer'
553
+ '.ppt': 'application/vnd.ms-powerpoint'
554
+ '.zmt': 'chemical/x-mopac-input'
555
+ '.pps': 'application/vnd.ms-powerpoint'
556
+ '.ppm': 'image/x-portable-pixmap'
557
+ '.lzh': 'application/x-lzh'
558
+ '.latex': 'application/x-latex'
559
+ '.ppd': 'application/vnd.cups-ppd'
560
+ '.cgm': 'image/cgm'
561
+ '.ppa': 'application/vnd.ms-powerpoint'
562
+ '.fpx': 'image/vnd.fpx'
563
+ '.igl': 'application/vnd.igloader'
564
+ '.mbox': 'application/mbox'
565
+ '.frm': 'application/x-maker'
566
+ '.kwt': 'application/x-kword'
567
+ '.dcr': 'application/x-director'
568
+ '.mp2a': 'audio/mpeg'
569
+ '.igx': 'application/vnd.micrografx.igx'
570
+ '.kwd': 'application/x-kword'
571
+ '.igs': 'model/iges'
572
+ '.xdw': 'application/vnd.fujixerox.docuworks'
573
+ '.qti': 'image/x-quicktime'
574
+ '.jad': 'text/vnd.sun.j2me.app-descriptor'
575
+ '.mwf': 'application/vnd.mfer'
576
+ '.qtl': 'application/x-quicktimeplayer'
577
+ '.npx': 'image/vnd.net-fpx'
578
+ '.jam': 'application/vnd.jam'
579
+ '.rlc': 'image/vnd.fujixerox.edmics-rlc'
580
+ '.svgz': 'image/svg+xml'
581
+ '.bz2': 'application/x-bzip2'
582
+ '.jar': 'application/java-archive'
583
+ '.fch': 'chemical/x-gaussian-checkpoint'
584
+ '.ogg': 'application/ogg'
585
+ '.afp': 'application/vnd.ibm.modcap'
586
+ '.f90': 'text/x-fortran'
587
+ '.ms': 'application/x-troff-ms'
588
+ '.rgb': 'image/x-rgb'
589
+ '.mxl': 'application/vnd.recordare.musicxml'
590
+ '.mxs': 'application/vnd.triscape.mxs'
591
+ '.gram': 'application/srgs'
592
+ '.me': 'application/x-troff-me'
593
+ '.mb': 'application/mathematica'
594
+ '.mxu': 'video/vnd.mpegurl'
595
+ '.ma': 'application/mathematica'
596
+ '.qam': 'application/vnd.epson.quickanime'
597
+ '.mm': 'application/x-freemind'
598
+ '.dl': 'video/dl'
599
+ '.mesh': 'model/mesh'
600
+ '.pgp': 'application/pgp-signature'
601
+ '.pgn': 'application/x-chess-pgn'
602
+ '.pgm': 'image/x-portable-graymap'
603
+ '.xyz': 'chemical/x-xyz'
604
+ '.svg': 'image/svg+xml'
605
+ '.svd': 'application/vnd.svd'
606
+ '.atom': 'application/atom+xml'
607
+ '.dp': 'application/vnd.osgi.dp'
608
+ '.roff': 'application/x-troff'
609
+ '.unityweb': 'application/vnd.unity'
610
+ '.123': 'application/vnd.lotus-1-2-3'
611
+ '.dv': 'video/dv'
612
+ '.cub': 'chemical/x-gaussian-cube'
613
+ '.eol': 'audio/vnd.digital-winds'
614
+ '.frame': 'application/x-maker'
615
+ '.qtif': 'image/x-quicktime'
616
+ '.eot': 'application/vnd.ms-fontobject'
617
+ '.gau': 'chemical/x-gaussian-input'
618
+ '.mac': 'image/x-macpaint'
619
+ '.dat': 'chemical/x-mopac-input'
620
+ '.mag': 'application/vnd.ecowin.chart'
621
+ '.lsf': 'video/x-la-asf'
622
+ '.iif': 'application/vnd.shana.informed.interchange'
623
+ '.atx': 'application/vnd.antix.game-component'
624
+ '.mmf': 'application/vnd.smaf'
625
+ '.mny': 'application/x-msmoney'
626
+ '.iii': 'application/x-iphone'
627
+ '.pyo': 'application/x-python-code'
628
+ '.ghf': 'application/vnd.groove-help'
629
+ '.cpio': 'application/x-cpio'
630
+ '.rdf': 'application/rdf+xml'
631
+ '.setreg': 'application/set-registration-initiation'
632
+ '.atc': 'application/vnd.acucorp'
633
+ '.lsx': 'video/x-la-asf'
634
+ '.ecelp4800': 'audio/vnd.nuera.ecelp4800'
635
+ '.sema': 'application/vnd.sema'
636
+ '.val': 'chemical/x-ncbi-asn1-binary'
637
+ '.dll': 'application/x-msdos-program'
638
+ '.sd2': 'audio/x-sd2'
639
+ '.rif': 'application/reginfo+xml'
640
+ '.sct': 'text/scriptlet'
641
+ '.scq': 'application/scvp-cv-request'
642
+ '.scs': 'application/scvp-cv-response'
643
+ '.scm': 'application/vnd.lotus-screencam'
644
+ '.xfdl': 'application/vnd.xfdl'
645
+ '.scd': 'application/x-msschedule'
646
+ '.xfdf': 'application/vnd.adobe.xfdf'
647
+ '.xwd': 'image/x-xwindowdump'
648
+ '.mif': 'application/x-mif'
649
+ '.sda': 'application/vnd.stardivision.draw'
650
+ '.sdc': 'application/vnd.stardivision.calc'
651
+ '.sdd': 'application/vnd.stardivision.impress'
652
+ '.sdf': 'chemical/x-mdl-sdfile'
653
+ '.js': 'application/x-javascript'
654
+ '.sdp': 'application/vnd.stardivision.impress'
655
+ '.sdw': 'application/vnd.stardivision.writer'
656
+ '.plb': 'application/vnd.3gpp.pic-bw-large'
657
+ '.plc': 'application/vnd.mobius.plc'
658
+ '.ipk': 'application/vnd.shana.informed.package'
659
+ '.%': 'application/x-trash'
660
+ '.3dml': 'text/vnd.in3d.3dml'
661
+ '.qxt': 'application/vnd.quark.quarkxpress'
662
+ '.n-gage': 'application/vnd.nokia.n-gage.symbian.install'
663
+ '.wtb': 'application/vnd.webturbo'
664
+ '.msf': 'application/vnd.epson.msf'
665
+ '.pls': 'audio/x-scpls'
666
+ '.flo': 'application/vnd.micrografx.flo'
667
+ '.tgf': 'chemical/x-mdl-tgf'
668
+ '.tgz': 'application/x-gtar'
669
+ '.gz': 'application/x-gzip'
670
+ '.lhs': 'text/x-literate-haskell'
671
+ '.msl': 'application/vnd.mobius.msl'
672
+ '.qxd': 'application/vnd.quark.quarkxpress'
673
+ '.qxb': 'application/vnd.quark.quarkxpress'
674
+ '.msh': 'model/mesh'
675
+ '.fli': 'video/fli'
676
+ '.lha': 'application/x-lha'
677
+ '.cpa': 'chemical/x-compass'
678
+ '.au': 'audio/basic'
679
+ '.pcl': 'application/vnd.hp-pcl'
680
+ '.cpt': 'image/x-corelphotopaint'
681
+ '.jpg': 'image/jpeg'
682
+ '.mdb': 'application/msaccess'
683
+ '.pct': 'image/x-pict'
684
+ '.jpm': 'video/jpm'
685
+ '.mpega': 'audio/mpeg'
686
+ '.pcx': 'image/pcx'
687
+ '.mdi': 'image/vnd.ms-modi'
688
+ '.zip': 'application/zip'
689
+ '.xtel': 'chemical/x-xtel'
690
+ '.vss': 'application/vnd.visio'
691
+ '.m3u': 'audio/x-mpegurl'
692
+ '.clkk': 'application/vnd.crick.clicker.keyboard'
693
+ '.vst': 'application/vnd.visio'
694
+ '.vsw': 'application/vnd.visio'
695
+ '.class': 'application/java-vm'
696
+ '.torrent': 'application/x-bittorrent'
697
+ '.hlp': 'application/winhlp'
698
+ '.mj2': 'video/mj2'
699
+ '.m3a': 'audio/mpeg'
700
+ '.asc': 'text/plain'
701
+ '.qxl': 'application/vnd.quark.quarkxpress'
702
+ '.asf': 'video/x-ms-asf'
703
+ '.vsd': 'application/vnd.visio'
704
+ '.vsf': 'application/vnd.vsf'
705
+ '.clkw': 'application/vnd.crick.clicker.wordbank'
706
+ '.xo': 'application/vnd.olpc-sugar'
707
+ '.clkt': 'application/vnd.crick.clicker.template'
708
+ '.asn': 'chemical/x-ncbi-asn1-spec'
709
+ '.aso': 'chemical/x-ncbi-asn1-binary'
710
+ '.mmr': 'image/vnd.fujixerox.edmics-mmr'
711
+ '.asm': 'text/x-asm'
712
+ '.uri': 'text/uri-list'
713
+ '.jp2': 'image/jp2'
714
+ '.xlm': 'application/vnd.ms-excel'
715
+ '.xlb': 'application/vnd.ms-excel'
716
+ '.xlc': 'application/vnd.ms-excel'
717
+ '.tcap': 'application/vnd.3gpp2.tcap'
718
+ '.sd': 'chemical/x-mdl-sdfile'
719
+ '.cif': 'chemical/x-cif'
720
+ '.wz': 'application/x-wingz'
721
+ '.xls': 'application/vnd.ms-excel'
722
+ '.cii': 'application/vnd.anser-web-certificate-issue-initiation'
723
+ '.xlw': 'application/vnd.ms-excel'
724
+ '.xlt': 'application/vnd.ms-excel'
725
+ '.fb': 'application/x-maker'
726
+ '.3gp': 'video/3gpp'
727
+ '.wks': 'application/vnd.ms-works'
728
+ '.wmv': 'video/x-ms-wmv'
729
+ '.gtw': 'model/vnd.gtw'
730
+ '.dx': 'chemical/x-jcamp-dx'
731
+ '.gtm': 'application/vnd.groove-tool-message'
732
+ '.trm': 'application/x-msterminal'
733
+ '.kin': 'chemical/x-kinemage'
734
+ '.urls': 'text/uri-list'
735
+ '.kil': 'application/x-killustrator'
736
+ '.pub': 'application/x-mspublisher'
737
+ '.imp': 'application/vnd.accpac.simply.imp'
738
+ '.lwp': 'application/vnd.lotus-wordpro'
739
+ '.odf': 'application/vnd.oasis.opendocument.formula'
740
+ '.tra': 'application/vnd.trueapp'
741
+ '.fsc': 'application/vnd.fsc.weblaunch'
742
+ '.ifm': 'application/vnd.shana.informed.formdata'
743
+ '.mpt': 'application/vnd.ms-project'
744
+ '.sgf': 'application/x-go-sgf'
745
+ '.ifb': 'text/calendar'
746
+ '.sgl': 'application/vnd.stardivision.writer-global'
747
+ '.sgm': 'text/sgml'
748
+ '.lbd': 'application/vnd.llamagraphics.life-balance.desktop'
749
+ '.lbe': 'application/vnd.llamagraphics.life-balance.exchange+xml'
750
+ '.maker': 'application/x-maker'
751
+ '.fst': 'image/vnd.fst'
752
+ '.mcm': 'chemical/x-macmolecule'
753
+ '.tif': 'image/tiff'
754
+ '.otp': 'application/vnd.oasis.opendocument.presentation-template'
755
+ '.pcf': 'application/x-font'
756
+ '.rmi': 'audio/midi'
757
+ '.wp5': 'application/wordperfect5.1'
758
+ '.f77': 'text/x-fortran'
759
+ '.pic': 'image/x-pict'
760
+ '.cache': 'chemical/x-cache'
761
+ '.mvb': 'chemical/x-mopac-vib'
762
+ '.qwd': 'application/vnd.quark.quarkxpress'
763
+ '.ngdat': 'application/vnd.nokia.n-gage.data'
764
+ '.rmp': 'audio/x-pn-realaudio-plugin'
765
+ '.wk': 'application/x-123'
766
+ '.acutc': 'application/vnd.acucorp'
767
+ '.xsm': 'application/vnd.syncml+xml'
768
+ '.xsl': 'application/xml'
769
+ '.sxw': 'application/vnd.sun.xml.writer'
770
+ '.spot': 'text/vnd.in3d.spot'
771
+ '.nc': 'application/x-netcdf'
772
+ '.fzs': 'application/vnd.fuzzysheet'
773
+ '.sxm': 'application/vnd.sun.xml.math'
774
+ '.mseq': 'application/vnd.mseq'
775
+ '.sxi': 'application/vnd.sun.xml.impress'
776
+ '.bib': 'text/x-bibtex'
777
+ '.aep': 'application/vnd.audiograph'
778
+ '.bin': 'application/octet-stream'
779
+ '.rdz': 'application/vnd.data-vision.rdz'
780
+ '.pcf.Z': 'application/x-font'
781
+ '.uris': 'text/uri-list'
782
+ '.sxc': 'application/vnd.sun.xml.calc'
783
+ '.h': 'text/x-chdr'
784
+ '.wps': 'application/vnd.ms-works'
785
+ '.itp': 'application/vnd.shana.informed.formtemplate'
786
+ '.jpe': 'image/jpeg'
787
+ '.a': 'application/octet-stream'
788
+ '.b': 'chemical/x-molconn-Z'
789
+ '.c': 'text/x-csrc'
790
+ '.rcprofile': 'application/vnd.ipunplugged.rcprofile'
791
+ '.udeb': 'application/x-debian-package'
792
+ '.f': 'text/x-fortran'
793
+ '.fe_launch': 'application/vnd.denovo.fcselayout-link'
794
+ '.vtu': 'model/vnd.vtu'
795
+ '.wpd': 'application/wordperfect'
796
+ '.~': 'application/x-trash'
797
+ '.mxml': 'application/xv+xml'
798
+ '.p': 'text/x-pascal'
799
+ '.s': 'text/x-asm'
800
+ '.t': 'application/x-troff'
801
+ '.ai': 'application/postscript'
802
+ '.cpp': 'text/x-c++src'
803
+ '.xenc': 'application/xenc+xml'
804
+ '.btif': 'image/prs.btif'
805
+ '.gnumeric': 'application/x-gnumeric'
806
+ '.kia': 'application/vnd.kidspiration'
807
+ '.conf': 'text/plain'
808
+ '.xvml': 'application/xv+xml'
809
+ '.x3d': 'application/vnd.hzn-3d-crossword'
810
+ '.mol2': 'chemical/x-mol2'
811
+ '.ctx': 'chemical/x-ctx'
812
+ '.xar': 'application/vnd.xara'
813
+ '.ent': 'chemical/x-pdb'
814
+ '.zmm': 'application/vnd.handheld-entertainment+xml'
815
+ '.sv4crc': 'application/x-sv4crc'
816
+ '.cmc': 'application/vnd.cosmocaller'
817
+ '.cml': 'chemical/x-cml'
818
+ '.pvb': 'application/vnd.3gpp.pic-bw-var'
819
+ '.jpeg': 'image/jpeg'
820
+ '.mgz': 'application/vnd.proteus.magazine'
821
+ '.mid': 'audio/midi'
822
+ '.cmp': 'application/vnd.yellowriver-custom-menu'
823
+ '.chat': 'application/x-chat'
824
+ '.cmx': 'image/x-cmx'
825
+ '.mml': 'text/mathml'
826
+ '.kml': 'application/vnd.google-earth.kml+xml'
827
+ '.dump': 'application/octet-stream'
828
+ '.gph': 'application/vnd.flographit'
829
+ '.xht': 'application/xhtml+xml'
830
+ '.dif': 'video/dv'
831
+ '.grxml': 'application/srgs+xml'
832
+ '.dic': 'text/x-c'
833
+ '.kmz': 'application/vnd.google-earth.kmz'
834
+ '.gpt': 'chemical/x-mopac-graph'
835
+ '.wm': 'video/x-ms-wm'
836
+ '.dis': 'application/vnd.mobius.dis'
837
+ '.dir': 'application/x-director'
838
+ '.curl': 'application/vnd.curl'
839
+ '.setpay': 'application/set-payment-initiation'
840
+ '.cod': 'application/vnd.rim.cod'
841
+ '.vmd': 'chemical/x-vmd'
842
+ '.jpgm': 'video/jpm'
843
+ '.snd': 'audio/basic'
844
+ '.mmd': 'chemical/x-macromodel-input'
845
+ '.pict': 'image/pict'
846
+ '.jpgv': 'video/jpeg'
847
+ '.ftc': 'application/vnd.fluxtime.clip'
848
+ '.pqa': 'application/vnd.palm'
849
+ '.java': 'text/x-java'
850
+ '.apk': 'application/vnd.android.package-archive'
851
+ '.vms': 'chemical/x-vamas-iso14976'
852
+ '.asx': 'video/x-ms-asf'
853
+ '.webm': 'video/webm'
854
+ '.ogv': 'video/ogg'
855
+ '.oga': 'audio/ogg'
856
+
@@ -1,3 +1,3 @@
1
1
  module M2Config
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.2"
3
3
  end
data/m2config.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.require_paths = ["lib"]
19
19
 
20
20
  spec.add_dependency "sqlite3"
21
- spec.add_dependency "sequel"
21
+ spec.add_dependency "sequel", '~> 3'
22
22
  spec.add_dependency "uuid"
23
23
  spec.add_dependency "mime-types"
24
24
 
@@ -22,8 +22,8 @@ describe M2Config do
22
22
  end
23
23
 
24
24
  it 'populates the MIME table with a nice set of mappings' do
25
- M2Config::MimeType[extension:"html"].mimetype.should eq("text/html")
26
- M2Config::MimeType[extension:"css"].mimetype.should eq("text/css")
25
+ M2Config::MimeType[extension:".html"].mimetype.should eq("text/html")
26
+ M2Config::MimeType[extension:".css"].mimetype.should eq("text/css")
27
27
  end
28
28
  end
29
29
 
@@ -0,0 +1,39 @@
1
+ require 'env'
2
+
3
+ describe M2Config::MimeType do
4
+
5
+ describe '::new' do
6
+ it 'reminds you that Mongrel2 wants the extension string to start with a .' do
7
+ expect {
8
+ M2Config::MimeType.new(extension:'bs', mimetype:'text/bullshit')
9
+ }.to raise_exception(ArgumentError, /extension must start with a \./i)
10
+ end
11
+
12
+ it 'yells when you try to insert duplicate extensions' do
13
+ expect {
14
+ M2Config::MimeType.new(extension:'.css', mimetype:'text/better-css')
15
+ }.to raise_exception(ArgumentError, /extension .css is already covered by text\/css type/i)
16
+ end
17
+
18
+ it 'allows you to force the redefinition of an existing extension' do
19
+ pending
20
+ end
21
+ end
22
+
23
+ describe '::populate_table' do
24
+ it 'fills up the extension to MIME type mapping table' do
25
+ # Clear entire table
26
+ CFG.db[:mimetype].delete
27
+ M2Config::MimeType.populate_table
28
+ M2Config::MimeType[extension:'.css'].mimetype.should eq('text/css')
29
+ end
30
+
31
+ it 'frowns when asked to populate a non-empty table' do
32
+ # At this point the table has been filled up on creation
33
+ expect {
34
+ M2Config::MimeType.populate_table
35
+ }.to raise_exception(RuntimeError, /table must be empty/i)
36
+ end
37
+ end
38
+
39
+ end
data/spec/route_spec.rb CHANGED
@@ -18,14 +18,30 @@ describe M2Config::Route do
18
18
  host = M2Config::Host.new({name:"main",matching:"actime.biz"})
19
19
  dirH = M2Config::Dir.new({base: "static/"})
20
20
  dir2 = M2Config::Dir.new({base: "ManceRayder/"})
21
- r1 = M2Config::Route.new({path:"/king", target: dirH})
22
- r2 = M2Config::Route.new({path:"/king", target: dir2})
23
- r3 = M2Config::Route.new({path:"/king", target: dirH})
21
+ r1 = M2Config::Route.new({path:"/king", target: dirH, host: host})
22
+ r2 = M2Config::Route.new({path:"/king", target: dir2, host: host})
23
+ r3 = M2Config::Route.new({path:"/king", target: dirH, host: host})
24
24
  M2Config::Route.elect!(r2)
25
25
  host.check_routes.should be_true
26
26
  king = M2Config::Route.where(path: "/king").first
27
27
  king.target.base.should eq("ManceRayder/")
28
28
  end
29
+
30
+ it "leaves routes belonging to a different host untouched" do
31
+ host = M2Config::Host.new({name:"main",matching:"actime.biz"})
32
+ host2 = M2Config::Host.new({name:"secondary",matching:"nameforge.net"})
33
+ dirH = M2Config::Dir.new({base: "static/"})
34
+ dir2 = M2Config::Dir.new({base: "ManceRayder/"})
35
+ r1 = M2Config::Route.new({path:"/king", target: dirH, host: host})
36
+ r2 = M2Config::Route.new({path:"/king", target: dir2, host: host})
37
+ r3 = M2Config::Route.new({path:"/king", target: dirH, host: host2})
38
+ M2Config::Route.elect!(r2)
39
+ host.check_routes.should be_true
40
+ king = M2Config::Route.where(path: "/king").first
41
+ king.target.base.should eq("ManceRayder/")
42
+ onOtherHost = M2Config::Route.where(path:"/king", target_id: dirH.id, host: host2).first
43
+ onOtherHost.should_not be_nil
44
+ end
29
45
  end
30
46
 
31
47
  describe "#host=" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: m2config
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arnaud Meuret
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-15 00:00:00.000000000 Z
11
+ date: 2013-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sqlite3
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: sequel
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '3'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: uuid
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -113,6 +113,7 @@ files:
113
113
  - lib/m2config/handler.rb
114
114
  - lib/m2config/host.rb
115
115
  - lib/m2config/mimetype.rb
116
+ - lib/m2config/mongrel2.mime.yml
116
117
  - lib/m2config/proxy.rb
117
118
  - lib/m2config/route.rb
118
119
  - lib/m2config/schema.sql
@@ -126,6 +127,7 @@ files:
126
127
  - spec/handler_spec.rb
127
128
  - spec/host_spec.rb
128
129
  - spec/m2config_spec.rb
130
+ - spec/mimetype_spec.rb
129
131
  - spec/proxy_spec.rb
130
132
  - spec/route_spec.rb
131
133
  - spec/server_spec.rb
@@ -150,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
152
  version: '0'
151
153
  requirements: []
152
154
  rubyforge_project:
153
- rubygems_version: 2.0.3
155
+ rubygems_version: 2.0.0
154
156
  signing_key:
155
157
  specification_version: 4
156
158
  summary: Manage your Mongrel2 configuration database using handy model classes that
@@ -161,6 +163,7 @@ test_files:
161
163
  - spec/handler_spec.rb
162
164
  - spec/host_spec.rb
163
165
  - spec/m2config_spec.rb
166
+ - spec/mimetype_spec.rb
164
167
  - spec/proxy_spec.rb
165
168
  - spec/route_spec.rb
166
169
  - spec/server_spec.rb