mini_mime 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +38 -0
- data/.github/workflows/db.yml +26 -0
- data/.rubocop.yml +5 -0
- data/CHANGELOG +4 -0
- data/Gemfile +1 -0
- data/README.md +3 -0
- data/Rakefile +9 -8
- data/bench/bench.rb +1 -2
- data/bin/console +1 -0
- data/bin/db_pull_request +20 -0
- data/lib/db/content_type_mime.db +25 -2
- data/lib/db/ext_mime.db +27 -3
- data/lib/mini_mime.rb +3 -2
- data/lib/mini_mime/version.rb +2 -1
- data/mini_mime.gemspec +2 -0
- metadata +38 -7
- data/.travis.yml +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dad29ac32b63431b2602b9d5e26157db6e98b8edcc6dbccd8e843cc0ceb78670
|
4
|
+
data.tar.gz: d8eab6e3b66cd1133b95c10e08a9a9fd10bcdf9c373b4119872d9aa161e155e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a0954805ffe7ae7c9085516677b7e94ad7f5c1e351979fe5eb01ff63fa5c2b29e6c85b96e4b8bf109dcd2fdd204b7d79eaf10aefda891198d9433f31b79e99a
|
7
|
+
data.tar.gz: 1bfee23498709b2cd132d2257b56187a411ea969c503819c616075fcfb8e10f839e3a41fa36e68a1e898b4871d695fe3084b184574dbef8a59316157fba2142e
|
@@ -0,0 +1,38 @@
|
|
1
|
+
name: Mini Mime Tests
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
push:
|
6
|
+
branches:
|
7
|
+
- master
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
build:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
name: "Ruby ${{ matrix.ruby }} / Failure allowed: ${{ matrix.experimental }}"
|
13
|
+
continue-on-error: ${{ matrix.experimental }}
|
14
|
+
strategy:
|
15
|
+
fail-fast: false
|
16
|
+
matrix:
|
17
|
+
ruby: ["2.4", "2.5", "2.6", "2.7"]
|
18
|
+
experimental: [false]
|
19
|
+
include:
|
20
|
+
- ruby: "ruby-head"
|
21
|
+
experimental: true
|
22
|
+
- ruby: "jruby-head"
|
23
|
+
experimental: true
|
24
|
+
- ruby: "jruby-9.1.17.0"
|
25
|
+
experimental: true
|
26
|
+
- ruby: "jruby-9.2.13.0"
|
27
|
+
experimental: true
|
28
|
+
steps:
|
29
|
+
- uses: actions/checkout@v2
|
30
|
+
- uses: ruby/setup-ruby@v1
|
31
|
+
with:
|
32
|
+
ruby-version: ${{ matrix.ruby }}
|
33
|
+
bundler-cache: true
|
34
|
+
- name: Rubocop
|
35
|
+
run: bundle exec rubocop
|
36
|
+
if: "!contains(matrix.ruby, 'jruby')"
|
37
|
+
- name: Tests
|
38
|
+
run: bundle exec rake test
|
@@ -0,0 +1,26 @@
|
|
1
|
+
name: Update MIME type DB
|
2
|
+
|
3
|
+
on:
|
4
|
+
schedule:
|
5
|
+
# 10am on the 1st every month https://crontab.guru/#0_10_1_*_*
|
6
|
+
- cron: "0 10 1 * *"
|
7
|
+
workflow_dispatch:
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
update_db:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
name: "Update MIME type DB"
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v2
|
15
|
+
- uses: ruby/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
ruby-version: "2.7"
|
18
|
+
bundler-cache: true
|
19
|
+
- name: Update mime-types-data
|
20
|
+
run: bundle update mime-types-data
|
21
|
+
- name: Update DB
|
22
|
+
run: bundle exec rake rebuild_db
|
23
|
+
- name: Create PR
|
24
|
+
run: bin/db_pull_request
|
25
|
+
env:
|
26
|
+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
data/.rubocop.yml
ADDED
data/CHANGELOG
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
data/Rakefile
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require "bundler/gem_tasks"
|
2
3
|
require "rake/testtask"
|
3
4
|
|
@@ -7,7 +8,7 @@ Rake::TestTask.new(:test) do |t|
|
|
7
8
|
t.test_files = FileList['test/**/*_test.rb']
|
8
9
|
end
|
9
10
|
|
10
|
-
task :
|
11
|
+
task default: :test
|
11
12
|
|
12
13
|
def pad(array)
|
13
14
|
max = []
|
@@ -36,11 +37,11 @@ task :rebuild_db do
|
|
36
37
|
index = {}
|
37
38
|
|
38
39
|
MIME::Types.each do |type|
|
39
|
-
type.extensions.each {|ext| (index[ext.downcase] ||= []) << type}
|
40
|
+
type.extensions.each { |ext| (index[ext.downcase] ||= []) << type }
|
40
41
|
end
|
41
42
|
|
42
|
-
index.each do |k,list|
|
43
|
-
list.sort!{|a,b| a.priority_compare(b)}
|
43
|
+
index.each do |k, list|
|
44
|
+
list.sort! { |a, b| a.priority_compare(b) }
|
44
45
|
end
|
45
46
|
|
46
47
|
buffer = []
|
@@ -54,9 +55,9 @@ task :rebuild_db do
|
|
54
55
|
|
55
56
|
pad(buffer)
|
56
57
|
|
57
|
-
buffer.sort!{|a,b| a[0] <=> b[0]}
|
58
|
+
buffer.sort! { |a, b| a[0] <=> b[0] }
|
58
59
|
|
59
|
-
File.open("lib/db/ext_mime.db", File::CREAT|File::TRUNC|File::RDWR) do |f|
|
60
|
+
File.open("lib/db/ext_mime.db", File::CREAT | File::TRUNC | File::RDWR) do |f|
|
60
61
|
buffer.each do |row|
|
61
62
|
f.write "#{row[0]} #{row[1]} #{row[2]}\n"
|
62
63
|
end
|
@@ -64,7 +65,7 @@ task :rebuild_db do
|
|
64
65
|
|
65
66
|
puts "#{buffer.count} rows written to lib/db/ext_mime.db"
|
66
67
|
|
67
|
-
buffer.sort!{|a,b| [a[1], a[0]] <=> [b[1], b[0]]}
|
68
|
+
buffer.sort! { |a, b| [a[1], a[0]] <=> [b[1], b[0]] }
|
68
69
|
|
69
70
|
# strip cause we are going to re-pad
|
70
71
|
buffer.each do |row|
|
@@ -80,7 +81,7 @@ task :rebuild_db do
|
|
80
81
|
|
81
82
|
pad(buffer)
|
82
83
|
|
83
|
-
File.open("lib/db/content_type_mime.db", File::CREAT|File::TRUNC|File::RDWR) do |f|
|
84
|
+
File.open("lib/db/content_type_mime.db", File::CREAT | File::TRUNC | File::RDWR) do |f|
|
84
85
|
last = nil
|
85
86
|
count = 0
|
86
87
|
buffer.each do |row|
|
data/bench/bench.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'memory_profiler'
|
2
3
|
require 'benchmark/ips'
|
3
4
|
|
4
5
|
$: << File.expand_path('../../lib', __FILE__)
|
5
6
|
|
6
|
-
|
7
7
|
puts
|
8
8
|
puts "Memory stats for requiring mime/types/columnar"
|
9
9
|
result = MemoryProfiler.report do
|
@@ -22,7 +22,6 @@ end
|
|
22
22
|
puts "Total allocated: #{result.total_allocated_memsize} bytes (#{result.total_allocated} objects)"
|
23
23
|
puts "Total retained: #{result.total_retained_memsize} bytes (#{result.total_retained} objects)"
|
24
24
|
|
25
|
-
|
26
25
|
Benchmark.ips do |bm|
|
27
26
|
bm.report 'cached content_type lookup MiniMime' do
|
28
27
|
MiniMime.lookup_by_filename("a.txt").content_type
|
data/bin/console
CHANGED
data/bin/db_pull_request
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "time"
|
5
|
+
|
6
|
+
if `git status --porcelain lib/db`.empty?
|
7
|
+
puts "Skipping, no DB changes to commit..."
|
8
|
+
return
|
9
|
+
end
|
10
|
+
|
11
|
+
moment = Time.now.utc
|
12
|
+
branch_name = "db-updates-#{moment.strftime("%Y%m%d%H%M%S")}"
|
13
|
+
|
14
|
+
system("git", "checkout", "-b", branch_name) || abort("Unable to create branch")
|
15
|
+
system("git", "add", "lib/db")
|
16
|
+
system("git", "config", "--local", "user.email", "actions@github.com")
|
17
|
+
system("git", "config", "--local", "user.name", "github-actions")
|
18
|
+
system("git", "commit", "-m", "DB updates #{moment.iso8601}") || abort("Unable to commit changes")
|
19
|
+
system("git", "push", "-u", "origin", branch_name) || abort("Unable to push branch")
|
20
|
+
system("gh", "pr", "create", "--title", "DB updates #{moment.iso8601}", "--body", "From Github Actions") || abort("Unable to create PR")
|
data/lib/db/content_type_mime.db
CHANGED
@@ -71,7 +71,7 @@ crl application/pkix-crl
|
|
71
71
|
pkipath application/pkix-pkipath base64
|
72
72
|
pki application/pkixcmp base64
|
73
73
|
pls application/pls+xml base64
|
74
|
-
|
74
|
+
eps application/postscript 8bit
|
75
75
|
cw application/prs.cww base64
|
76
76
|
rnd application/prs.nprend base64
|
77
77
|
pskcxml application/pskc+xml base64
|
@@ -561,6 +561,7 @@ cpt application/x-mac-compactpro
|
|
561
561
|
mie application/x-mie base64
|
562
562
|
mobi application/x-mobipocket-ebook base64
|
563
563
|
application application/x-ms-application base64
|
564
|
+
exe application/x-ms-dos-executable base64
|
564
565
|
lnk application/x-ms-shortcut base64
|
565
566
|
wmd application/x-ms-wmd base64
|
566
567
|
wmz application/x-ms-wmz base64
|
@@ -595,6 +596,7 @@ sh application/x-sh
|
|
595
596
|
shar application/x-shar 8bit
|
596
597
|
swf application/x-shockwave-flash base64
|
597
598
|
xap application/x-silverlight-app base64
|
599
|
+
notebook application/x-smarttech-notebook base64
|
598
600
|
sav application/x-spss base64
|
599
601
|
sql application/x-sql base64
|
600
602
|
sit application/x-stuffit base64
|
@@ -664,6 +666,7 @@ ecelp9600 audio/vnd.nuera.ecelp9600
|
|
664
666
|
qcp audio/vnd.qcelp base64
|
665
667
|
rip audio/vnd.rip base64
|
666
668
|
smp3 audio/vnd.sealedmedia.softseal.mpeg base64
|
669
|
+
wav audio/wav base64
|
667
670
|
weba audio/webm base64
|
668
671
|
aac audio/x-aac base64
|
669
672
|
aif audio/x-aiff base64
|
@@ -676,7 +679,6 @@ wma audio/x-ms-wma
|
|
676
679
|
wmv audio/x-ms-wmv base64
|
677
680
|
ra audio/x-pn-realaudio base64
|
678
681
|
rmp audio/x-pn-realaudio-plugin base64
|
679
|
-
wav audio/x-wav base64
|
680
682
|
xm audio/xm base64
|
681
683
|
cdx chemical/x-cdx base64
|
682
684
|
cif chemical/x-cif base64
|
@@ -688,9 +690,14 @@ otf font/otf
|
|
688
690
|
ttf font/ttf base64
|
689
691
|
woff font/woff base64
|
690
692
|
woff2 font/woff2 base64
|
693
|
+
avif image/avif base64
|
691
694
|
cgm image/cgm base64
|
692
695
|
g3 image/g3fax base64
|
693
696
|
gif image/gif base64
|
697
|
+
heic image/heic base64
|
698
|
+
heics image/heic-sequence base64
|
699
|
+
heif image/heif base64
|
700
|
+
heifs image/heif-sequence base64
|
694
701
|
ief image/ief base64
|
695
702
|
jp2 image/jp2 base64
|
696
703
|
jpeg image/jpeg base64
|
@@ -722,21 +729,37 @@ wbmp image/vnd.wap.wbmp
|
|
722
729
|
xif image/vnd.xiff base64
|
723
730
|
webp image/webp base64
|
724
731
|
3ds image/x-3ds base64
|
732
|
+
dng image/x-adobe-dng base64
|
725
733
|
bmp image/x-bmp base64
|
734
|
+
cr2 image/x-canon-cr2 base64
|
735
|
+
crw image/x-canon-crw base64
|
726
736
|
ras image/x-cmu-raster base64
|
727
737
|
cmx image/x-cmx base64
|
728
738
|
xcfbz2 image/x-compressed-xcf base64
|
739
|
+
erf image/x-epson-erf base64
|
729
740
|
fh image/x-freehand base64
|
741
|
+
raf image/x-fuji-raf base64
|
730
742
|
3fr image/x-hasselblad-3fr base64
|
743
|
+
k25 image/x-kodak-k25 base64
|
744
|
+
kdc image/x-kodak-kdc base64
|
745
|
+
mrw image/x-minolta-mrw base64
|
731
746
|
sid image/x-mrsid-image base64
|
747
|
+
nef image/x-nikon-nef base64
|
748
|
+
orf image/x-olympus-orf base64
|
732
749
|
psp image/x-paintshoppro base64
|
750
|
+
raw image/x-panasonic-raw base64
|
733
751
|
pcx image/x-pcx base64
|
752
|
+
pef image/x-pentax-pef base64
|
734
753
|
pct image/x-pict base64
|
735
754
|
pnm image/x-portable-anymap base64
|
736
755
|
pbm image/x-portable-bitmap base64
|
737
756
|
pgm image/x-portable-graymap base64
|
738
757
|
ppm image/x-portable-pixmap base64
|
739
758
|
rgb image/x-rgb base64
|
759
|
+
x3f image/x-sigma-x3f base64
|
760
|
+
arw image/x-sony-arw base64
|
761
|
+
sr2 image/x-sony-sr2 base64
|
762
|
+
srf image/x-sony-srf base64
|
740
763
|
tga image/x-targa base64
|
741
764
|
dgn image/x-vnd.dgn base64
|
742
765
|
xbm image/x-xbitmap 7bit
|
data/lib/db/ext_mime.db
CHANGED
@@ -24,7 +24,7 @@ aep application/vnd.audiograph
|
|
24
24
|
afm application/x-font-type1 base64
|
25
25
|
afp application/vnd.ibm.modcap base64
|
26
26
|
ahead application/vnd.ahead.space base64
|
27
|
-
ai application/
|
27
|
+
ai application/pdf base64
|
28
28
|
aif audio/x-aiff base64
|
29
29
|
aifc audio/x-aiff base64
|
30
30
|
aiff audio/x-aiff base64
|
@@ -38,6 +38,7 @@ appcache text/cache-manifest
|
|
38
38
|
application application/x-ms-application base64
|
39
39
|
apr application/vnd.lotus-approach base64
|
40
40
|
arc application/x-freearc base64
|
41
|
+
arw image/x-sony-arw base64
|
41
42
|
asc application/pgp-signature base64
|
42
43
|
asf application/vnd.ms-asf base64
|
43
44
|
asm text/x-asm quoted-printable
|
@@ -50,6 +51,7 @@ atomsvc application/atomsvc+xml
|
|
50
51
|
atx application/vnd.antix.game-component base64
|
51
52
|
au audio/basic base64
|
52
53
|
avi video/x-msvideo base64
|
54
|
+
avif image/avif base64
|
53
55
|
aw application/applixware base64
|
54
56
|
awb audio/AMR-WB base64
|
55
57
|
azf application/vnd.airzip.filesecure.azf base64
|
@@ -142,9 +144,11 @@ cpi video/MP2T
|
|
142
144
|
cpio application/x-cpio base64
|
143
145
|
cpp text/plain quoted-printable
|
144
146
|
cpt application/x-mac-compactpro base64
|
147
|
+
cr2 image/x-canon-cr2 base64
|
145
148
|
crd application/x-mscardfile base64
|
146
149
|
crl application/pkix-crl base64
|
147
150
|
crt application/x-x509-ca-cert base64
|
151
|
+
crw image/x-canon-crw base64
|
148
152
|
crx application/x-chrome-extension base64
|
149
153
|
cryptonote application/vnd.rig.cryptonote base64
|
150
154
|
csh application/x-csh 8bit
|
@@ -192,6 +196,7 @@ dmg application/x-apple-diskimage
|
|
192
196
|
dmp application/vnd.tcpdump.pcap base64
|
193
197
|
dms application/octet-stream base64
|
194
198
|
dna application/vnd.dna base64
|
199
|
+
dng image/x-adobe-dng base64
|
195
200
|
doc application/msword base64
|
196
201
|
docm application/vnd.ms-word.document.macroEnabled.12 base64
|
197
202
|
docx application/vnd.openxmlformats-officedocument.wordprocessingml.document base64
|
@@ -237,6 +242,7 @@ eol audio/vnd.digital-winds
|
|
237
242
|
eot application/vnd.ms-fontobject base64
|
238
243
|
eps application/postscript 8bit
|
239
244
|
epub application/epub+zip base64
|
245
|
+
erf image/x-epson-erf base64
|
240
246
|
es application/ecmascript base64
|
241
247
|
es3 application/vnd.eszigno3+xml base64
|
242
248
|
esa application/vnd.osgi.subsystem base64
|
@@ -246,7 +252,7 @@ etx text/x-setext
|
|
246
252
|
eva application/x-eva base64
|
247
253
|
evc audio/EVRC base64
|
248
254
|
evy application/x-envoy base64
|
249
|
-
exe application/
|
255
|
+
exe application/x-ms-dos-executable base64
|
250
256
|
exi application/exi base64
|
251
257
|
ext application/vnd.novadigm.EXT base64
|
252
258
|
ez application/andrew-inset base64
|
@@ -340,8 +346,13 @@ hal application/vnd.hal+xml
|
|
340
346
|
hbc application/vnd.hbci base64
|
341
347
|
hbci application/vnd.hbci base64
|
342
348
|
hdf application/x-hdf base64
|
349
|
+
heic image/heic base64
|
350
|
+
heics image/heic-sequence base64
|
351
|
+
heif image/heif base64
|
352
|
+
heifs image/heif-sequence base64
|
343
353
|
hep application/x-hep base64
|
344
354
|
hh text/plain quoted-printable
|
355
|
+
hif image/heic base64
|
345
356
|
hlp text/plain quoted-printable
|
346
357
|
hpgl application/vnd.hp-HPGL base64
|
347
358
|
hpid application/vnd.hp-hpid base64
|
@@ -414,9 +425,11 @@ jpx image/jpx
|
|
414
425
|
js application/javascript 8bit
|
415
426
|
json application/json 8bit
|
416
427
|
jsonml application/jsonml+json base64
|
428
|
+
k25 image/x-kodak-k25 base64
|
417
429
|
kar audio/midi base64
|
418
430
|
karbon application/vnd.kde.karbon base64
|
419
431
|
kcm application/vnd.nervana base64
|
432
|
+
kdc image/x-kodak-kdc base64
|
420
433
|
key application/x-iwork-keynote-sffkey base64
|
421
434
|
kfo application/vnd.kde.kformula base64
|
422
435
|
kia application/vnd.kidspiration base64
|
@@ -550,6 +563,7 @@ mpy application/vnd.ibm.MiniPay
|
|
550
563
|
mqy application/vnd.Mobius.MQY base64
|
551
564
|
mrc application/marc base64
|
552
565
|
mrcx application/marcxml+xml base64
|
566
|
+
mrw image/x-minolta-mrw base64
|
553
567
|
ms text/troff 8bit
|
554
568
|
mscml application/mediaservercontrol+xml base64
|
555
569
|
mseed application/vnd.fdsn.mseed base64
|
@@ -577,6 +591,7 @@ nb application/mathematica
|
|
577
591
|
nbp application/vnd.wolfram.player base64
|
578
592
|
nc application/netcdf base64
|
579
593
|
ncx application/x-dtbncx+xml base64
|
594
|
+
nef image/x-nikon-nef base64
|
580
595
|
nfo text/x-nfo quoted-printable
|
581
596
|
ngdat application/vnd.nokia.n-gage.data base64
|
582
597
|
nim video/vnd.nokia.interleaved-multimedia base64
|
@@ -586,6 +601,7 @@ nml application/vnd.enliven
|
|
586
601
|
nnd application/vnd.noblenet-directory base64
|
587
602
|
nns application/vnd.noblenet-sealer base64
|
588
603
|
nnw application/vnd.noblenet-web base64
|
604
|
+
notebook application/x-smarttech-notebook base64
|
589
605
|
npx image/vnd.net-fpx base64
|
590
606
|
nsc application/x-conference base64
|
591
607
|
nsf application/vnd.lotus-notes base64
|
@@ -621,6 +637,8 @@ onetoc2 application/onenote
|
|
621
637
|
opf application/oebps-package+xml base64
|
622
638
|
opml text/x-opml quoted-printable
|
623
639
|
oprc application/vnd.palm base64
|
640
|
+
opus audio/ogg base64
|
641
|
+
orf image/x-olympus-orf base64
|
624
642
|
org application/vnd.lotus-organizer base64
|
625
643
|
osf application/vnd.yamaha.openscoreformat base64
|
626
644
|
osfpvg application/vnd.yamaha.openscoreformat.osfpvg+xml base64
|
@@ -658,6 +676,7 @@ pcurl application/vnd.curl.pcurl
|
|
658
676
|
pcx image/x-pcx base64
|
659
677
|
pdb application/vnd.palm base64
|
660
678
|
pdf application/pdf base64
|
679
|
+
pef image/x-pentax-pef base64
|
661
680
|
pfa application/x-font-type1 base64
|
662
681
|
pfb application/x-font-type1 base64
|
663
682
|
pfm application/x-font-type1 base64
|
@@ -736,9 +755,11 @@ qxd application/vnd.Quark.QuarkXPress
|
|
736
755
|
qxl application/vnd.Quark.QuarkXPress 8bit
|
737
756
|
qxt application/vnd.Quark.QuarkXPress 8bit
|
738
757
|
ra audio/x-pn-realaudio base64
|
758
|
+
raf image/x-fuji-raf base64
|
739
759
|
ram audio/x-pn-realaudio base64
|
740
760
|
rar application/x-rar-compressed base64
|
741
761
|
ras image/x-cmu-raster base64
|
762
|
+
raw image/x-panasonic-raw base64
|
742
763
|
rb application/x-ruby 8bit
|
743
764
|
rbw application/x-ruby 8bit
|
744
765
|
rcprofile application/vnd.ipunplugged.rcprofile base64
|
@@ -883,7 +904,9 @@ spq application/scvp-vp-request
|
|
883
904
|
sps application/x-spss base64
|
884
905
|
spx audio/ogg base64
|
885
906
|
sql application/x-sql base64
|
907
|
+
sr2 image/x-sony-sr2 base64
|
886
908
|
src application/x-wais-source base64
|
909
|
+
srf image/x-sony-srf base64
|
887
910
|
srt application/x-subrip base64
|
888
911
|
sru application/sru+xml base64
|
889
912
|
srx application/sparql-results+xml base64
|
@@ -1037,7 +1060,7 @@ vxml application/voicexml+xml
|
|
1037
1060
|
w3d application/x-director base64
|
1038
1061
|
wad application/x-doom base64
|
1039
1062
|
wasm application/wasm 8bit
|
1040
|
-
wav audio/
|
1063
|
+
wav audio/wav base64
|
1041
1064
|
wax audio/x-ms-wax base64
|
1042
1065
|
wbmp image/vnd.wap.wbmp base64
|
1043
1066
|
wbs application/vnd.criticaltools.wbs+xml base64
|
@@ -1091,6 +1114,7 @@ x3dbz model/x3d+binary
|
|
1091
1114
|
x3dv model/x3d+vrml base64
|
1092
1115
|
x3dvz model/x3d+vrml base64
|
1093
1116
|
x3dz model/x3d+xml base64
|
1117
|
+
x3f image/x-sigma-x3f base64
|
1094
1118
|
x_b model/vnd.parasolid.transmit.binary base64
|
1095
1119
|
x_t model/vnd.parasolid.transmit.text quoted-printable
|
1096
1120
|
xaml application/xaml+xml base64
|
data/lib/mini_mime.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require "mini_mime/version"
|
2
3
|
require "thread"
|
3
4
|
|
@@ -129,7 +130,7 @@ module MiniMime
|
|
129
130
|
result = nil
|
130
131
|
|
131
132
|
while from <= to do
|
132
|
-
midpoint = from + (to-from).div(2)
|
133
|
+
midpoint = from + (to - from).div(2)
|
133
134
|
current = resolve(midpoint)
|
134
135
|
data = current[@sort_order]
|
135
136
|
if data > val
|
@@ -145,7 +146,7 @@ module MiniMime
|
|
145
146
|
end
|
146
147
|
|
147
148
|
def resolve(row)
|
148
|
-
@file.seek(row
|
149
|
+
@file.seek(row * @row_length)
|
149
150
|
Info.new(@file.readline)
|
150
151
|
end
|
151
152
|
end
|
data/lib/mini_mime/version.rb
CHANGED
data/mini_mime.gemspec
CHANGED
@@ -25,4 +25,6 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_development_dependency "bundler", ">= 1.13"
|
26
26
|
spec.add_development_dependency "rake", "~> 10.0"
|
27
27
|
spec.add_development_dependency "minitest", "~> 5.0"
|
28
|
+
spec.add_development_dependency "rubocop"
|
29
|
+
spec.add_development_dependency "rubocop-discourse"
|
28
30
|
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: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Saffron
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,6 +52,34 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '5.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop-discourse
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
55
83
|
description: A lightweight mime type lookup toy
|
56
84
|
email:
|
57
85
|
- sam.saffron@gmail.com
|
@@ -59,8 +87,10 @@ executables: []
|
|
59
87
|
extensions: []
|
60
88
|
extra_rdoc_files: []
|
61
89
|
files:
|
90
|
+
- ".github/workflows/ci.yml"
|
91
|
+
- ".github/workflows/db.yml"
|
62
92
|
- ".gitignore"
|
63
|
-
- ".
|
93
|
+
- ".rubocop.yml"
|
64
94
|
- CHANGELOG
|
65
95
|
- CODE_OF_CONDUCT.md
|
66
96
|
- Gemfile
|
@@ -69,6 +99,7 @@ files:
|
|
69
99
|
- Rakefile
|
70
100
|
- bench/bench.rb
|
71
101
|
- bin/console
|
102
|
+
- bin/db_pull_request
|
72
103
|
- bin/setup
|
73
104
|
- lib/db/content_type_mime.db
|
74
105
|
- lib/db/ext_mime.db
|
@@ -79,7 +110,7 @@ homepage: https://github.com/discourse/mini_mime
|
|
79
110
|
licenses:
|
80
111
|
- MIT
|
81
112
|
metadata: {}
|
82
|
-
post_install_message:
|
113
|
+
post_install_message:
|
83
114
|
rdoc_options: []
|
84
115
|
require_paths:
|
85
116
|
- lib
|
@@ -94,8 +125,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
125
|
- !ruby/object:Gem::Version
|
95
126
|
version: '0'
|
96
127
|
requirements: []
|
97
|
-
rubygems_version: 3.
|
98
|
-
signing_key:
|
128
|
+
rubygems_version: 3.2.2
|
129
|
+
signing_key:
|
99
130
|
specification_version: 4
|
100
131
|
summary: A lightweight mime type lookup toy
|
101
132
|
test_files: []
|
data/.travis.yml
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
|
3
|
-
rvm:
|
4
|
-
- 2.3
|
5
|
-
- 2.4
|
6
|
-
- 2.5
|
7
|
-
- 2.6
|
8
|
-
- ruby-head
|
9
|
-
- jruby
|
10
|
-
- jruby-9.0.5.0
|
11
|
-
- jruby-9.1.6.0
|
12
|
-
- jruby-head
|
13
|
-
|
14
|
-
matrix:
|
15
|
-
allow_failures:
|
16
|
-
- rvm: ruby-head
|
17
|
-
- rvm: jruby-9.0.5.0
|
18
|
-
- rvm: jruby-9.1.6.0
|
19
|
-
- rvm: jruby-head
|
20
|
-
fast_finish: true
|