marcel 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/lib/marcel/mime_type.rb +1 -1
  3. data/lib/marcel/version.rb +1 -1
  4. metadata +9 -217
  5. data/.gitignore +0 -1
  6. data/.travis.yml +0 -7
  7. data/Gemfile +0 -4
  8. data/Gemfile.lock +0 -26
  9. data/Rakefile +0 -33
  10. data/marcel.gemspec +0 -28
  11. data/test/declared_type_test.rb +0 -17
  12. data/test/extension_test.rb +0 -25
  13. data/test/fixtures/image.gif +0 -0
  14. data/test/fixtures/magic/application/msword/msword.doc +0 -0
  15. data/test/fixtures/magic/application/pdf/illustrator-seen-as-pdf.ai +22 -6302
  16. data/test/fixtures/magic/application/pdf/pdf.pdf +0 -0
  17. data/test/fixtures/magic/application/rtf/rtf.rtf +0 -1
  18. data/test/fixtures/magic/application/vnd.adobe.flash.movie/flash.swf +0 -0
  19. data/test/fixtures/magic/application/vnd.openxmlformats-officedocument.presentationml.presentation/vnd.openxmlformats-officedocument.presentationml.presentation.pptx +0 -0
  20. data/test/fixtures/magic/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet/vnd.openxmlformats-officedocument.spreadsheetml.sheet.xlsx +0 -0
  21. data/test/fixtures/magic/application/vnd.openxmlformats-officedocument.wordprocessingml.document/vnd.openxmlformats-officedocument.wordprocessingml.document.docx +0 -0
  22. data/test/fixtures/magic/application/x-font-ttf.ttf +0 -0
  23. data/test/fixtures/magic/application/xml/xml.xml +0 -1
  24. data/test/fixtures/magic/application/zip/sketch.sketch +0 -0
  25. data/test/fixtures/magic/application/zip/zip.zip +0 -0
  26. data/test/fixtures/magic/audio/flac/flac.flac +0 -0
  27. data/test/fixtures/magic/audio/mp4/m4a.m4a +0 -0
  28. data/test/fixtures/magic/audio/mp4/mp4.m4a +0 -0
  29. data/test/fixtures/magic/audio/mpeg/mpeg.mp3 +0 -0
  30. data/test/fixtures/magic/audio/x-wav/wav.wav +0 -0
  31. data/test/fixtures/magic/audio/x-wav/x-wav.wav +0 -0
  32. data/test/fixtures/magic/image/bmp/bmp.bmp +0 -0
  33. data/test/fixtures/magic/image/gif/gif.gif +0 -0
  34. data/test/fixtures/magic/image/jpeg/jpeg.jpg +0 -0
  35. data/test/fixtures/magic/image/png/png.png +0 -0
  36. data/test/fixtures/magic/image/svg+xml/svg.svg +0 -1
  37. data/test/fixtures/magic/image/tiff/tiff.tif +0 -0
  38. data/test/fixtures/magic/image/vnd.adobe.photoshop/photoshop-large-document-format.psb +0 -0
  39. data/test/fixtures/magic/image/vnd.adobe.photoshop/vnd.adobe.photoshop.psd +0 -0
  40. data/test/fixtures/magic/image/vnd.dwg/x-dwg.dwg +0 -0
  41. data/test/fixtures/magic/image/vnd.microsoft.icon/ico.ico +0 -0
  42. data/test/fixtures/magic/image/webp/webp.webp +0 -0
  43. data/test/fixtures/magic/image/x-eps/postscript/postscript.eps +0 -0
  44. data/test/fixtures/magic/image/x-eps/x-eps.eps +0 -0
  45. data/test/fixtures/magic/text/html/html.html +0 -3
  46. data/test/fixtures/magic/video/mp4/m4v.m4v +0 -0
  47. data/test/fixtures/magic/video/mp4/mp4.mp4 +0 -0
  48. data/test/fixtures/magic/video/quicktime/quicktime.mov +0 -0
  49. data/test/fixtures/magic/video/webm/webm.mkv +0 -0
  50. data/test/fixtures/name/application/illustrator/illustrator.ai +27 -6301
  51. data/test/fixtures/name/application/javascript/javascript.js +0 -3
  52. data/test/fixtures/name/application/json/json.json +0 -3
  53. data/test/fixtures/name/application/msword/msword.doc +0 -0
  54. data/test/fixtures/name/application/pdf/pdf.pdf +0 -0
  55. data/test/fixtures/name/application/rtf/rtf.rtf +0 -1
  56. data/test/fixtures/name/application/sql/sql.sql +0 -0
  57. data/test/fixtures/name/application/vnd.adobe.flash.movie/flash.swf +0 -0
  58. data/test/fixtures/name/application/vnd.android.package-archive/vnd.android.package-archive.apk +0 -0
  59. data/test/fixtures/name/application/vnd.apple.keynote/vnd.apple.keynote.key +0 -0
  60. data/test/fixtures/name/application/vnd.apple.numbers/vnd.apple.numbers.numbers +0 -0
  61. data/test/fixtures/name/application/vnd.apple.pages/vnd.apple.pages.pages +0 -0
  62. data/test/fixtures/name/application/vnd.ms-excel.sheet.binary.macroenabled.12/vnd.ms-excel.sheet.binary.macroenabled.12.xlsb +0 -0
  63. data/test/fixtures/name/application/vnd.ms-excel.sheet.macroenabled.12/vnd.ms-excel.sheet.macroenabled.12.xlsm +0 -0
  64. data/test/fixtures/name/application/vnd.ms-excel.template.macroenabled.12/vnd.ms-excel.template.macroenabled.12.xltm +0 -0
  65. data/test/fixtures/name/application/vnd.ms-excel/vnd.ms-excel.xls +0 -0
  66. data/test/fixtures/name/application/vnd.ms-powerpoint.presentation.macroenabled.12/vnd.ms-powerpoint.presentation.macroenabled.12.pptm +0 -0
  67. data/test/fixtures/name/application/vnd.ms-powerpoint.slideshow.macroenabled.12/vnd.ms-powerpoint.slideshow.macroenabled.12.ppsm +0 -0
  68. data/test/fixtures/name/application/vnd.ms-powerpoint.template.macroenabled.12/vnd.ms-powerpoint.template.macroenabled.12.potm +0 -0
  69. data/test/fixtures/name/application/vnd.ms-powerpoint/vnd.ms-powerpoint.ppt +0 -0
  70. data/test/fixtures/name/application/vnd.ms-word.document.macroenabled.12/vnd.ms-word.document.macroenabled.12.docm +0 -0
  71. data/test/fixtures/name/application/vnd.ms-word.template.macroenabled.12/vnd.ms-word.template.macroenabled.12.dotm +0 -0
  72. data/test/fixtures/name/application/vnd.openxmlformats-officedocument.presentationml.presentation/vnd.openxmlformats-officedocument.presentationml.presentation.pptx +0 -0
  73. data/test/fixtures/name/application/vnd.openxmlformats-officedocument.presentationml.slideshow/vnd.openxmlformats-officedocument.presentationml.slideshow.ppsx +0 -0
  74. data/test/fixtures/name/application/vnd.openxmlformats-officedocument.presentationml.template/vnd.openxmlformats-officedocument.presentationml.template.potx +0 -0
  75. data/test/fixtures/name/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet/downloaded-from-google-docs.xlsx +0 -0
  76. data/test/fixtures/name/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet/vnd.openxmlformats-officedocument.spreadsheetml.sheet.xlsx +0 -0
  77. data/test/fixtures/name/application/vnd.openxmlformats-officedocument.wordprocessingml.document/vnd.openxmlformats-officedocument.wordprocessingml.document.docx +0 -0
  78. data/test/fixtures/name/application/vnd.openxmlformats-officedocument.wordprocessingml.template/vnd.openxmlformats-officedocument.wordprocessingml.template.dotx +0 -0
  79. data/test/fixtures/name/application/x-font-ttf.ttf +0 -0
  80. data/test/fixtures/name/application/zip/zip.zip +0 -0
  81. data/test/fixtures/name/audio/flac/flac.flac +0 -0
  82. data/test/fixtures/name/audio/mp4/mp4.m4a +0 -0
  83. data/test/fixtures/name/audio/mpeg/mpeg.mp3 +0 -0
  84. data/test/fixtures/name/audio/x-wav/x-wav.wav +0 -0
  85. data/test/fixtures/name/image/bmp/bmp.bmp +0 -0
  86. data/test/fixtures/name/image/gif/gif.gif +0 -0
  87. data/test/fixtures/name/image/heic.heic +0 -0
  88. data/test/fixtures/name/image/heif.heif +0 -0
  89. data/test/fixtures/name/image/jpeg/jpeg.jpg +0 -0
  90. data/test/fixtures/name/image/png/png.png +0 -0
  91. data/test/fixtures/name/image/svg+xml/svg.svg +0 -1
  92. data/test/fixtures/name/image/tiff/tiff.tif +0 -0
  93. data/test/fixtures/name/image/tiff/tiff.tiff +0 -0
  94. data/test/fixtures/name/image/vnd.adobe.photoshop/saved-as-large-document-format.psb +0 -0
  95. data/test/fixtures/name/image/vnd.adobe.photoshop/vnd.adobe.photoshop.psd +0 -0
  96. data/test/fixtures/name/image/x-eps/postscript/postscript.eps +0 -0
  97. data/test/fixtures/name/image/x-eps/x-eps.eps +0 -0
  98. data/test/fixtures/name/message/rfc822/rfc822.eml +0 -34
  99. data/test/fixtures/name/text/csv/csv.csv +0 -2
  100. data/test/fixtures/name/text/html/html.html +0 -3
  101. data/test/fixtures/name/text/plain/plain.asc +0 -1
  102. data/test/fixtures/name/text/plain/plain.txt +0 -1
  103. data/test/fixtures/name/text/x-log/x-log.log +0 -1
  104. data/test/fixtures/name/video/mp4/mp4.mp4 +0 -0
  105. data/test/fixtures/name/video/quicktime/quicktime.mov +0 -0
  106. data/test/magic_and_declared_type_test.rb +0 -10
  107. data/test/magic_and_name_test.rb +0 -13
  108. data/test/magic_test.rb +0 -13
  109. data/test/mime_type_test.rb +0 -47
  110. data/test/name_test.rb +0 -10
  111. data/test/test_helper.rb +0 -49
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 57f17eae54469b574b2c7ce541bf2c6cf82f180456f6d1f133dd99c13585fbb0
4
- data.tar.gz: b73e492f9d3b2b58abc751ea29a9c5da7fe5c7ef372da6c472c16c3708edd579
3
+ metadata.gz: 685037b13ae2c5bc3f6ad275d8e059508c7e09ff911812a308dfa0421db4208b
4
+ data.tar.gz: 04d9d2738d571016976ad4b6ae9adfac131d5f821aa938db2b4dd9e44c905527
5
5
  SHA512:
6
- metadata.gz: 140466ed263e260c2936d619d27b584af4b377f02c05acb508a0246cc55730a371023ebc93a183152b593529aac6071a374def41b686d523b85f37818c26b6b9
7
- data.tar.gz: 95f8f724211e266bf3a3ccedfed7c78fd7e35376d74d28e63ceabf538a5945fc01319115391f060bc84cd91ec18e7ed64aa0f607edff83a1026c2fe48a5bfbb5
6
+ metadata.gz: a9d892f1beb8a63c3b0642d6746fe48a0497574a5761c19e1a983217a6158bf395a36c5a727c461e518bbf47791b9e60a5f8a95f0b0f99172c9c042433418af5
7
+ data.tar.gz: 2c04e16ffa4eb9bf01d7a2a34aed483503fa5578d1da7842e62375cd5c45e4b1f73a530f02f043cebaad20fc71fe0785bb2e73b5a8a93f3368c3185bf22812b3
@@ -61,7 +61,7 @@ class Marcel::MimeType
61
61
  def with_io(pathname_or_io, &block)
62
62
  case pathname_or_io
63
63
  when Pathname
64
- pathname_or_io.open &block
64
+ pathname_or_io.open(&block)
65
65
  else
66
66
  yield pathname_or_io
67
67
  end
@@ -1,3 +1,3 @@
1
1
  module Marcel
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marcel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Ward
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-26 00:00:00.000000000 Z
11
+ date: 2018-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mimemagic
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: minitest
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '5.11'
34
34
  type: :development
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: '5.11'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 2.0.1
75
+ version: '2.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 2.0.1
82
+ version: '2.0'
83
83
  description:
84
84
  email:
85
85
  - tom@basecamp.com
@@ -87,119 +87,12 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
- - ".gitignore"
91
- - ".travis.yml"
92
- - Gemfile
93
- - Gemfile.lock
94
90
  - MIT-LICENSE
95
91
  - README.md
96
- - Rakefile
97
92
  - lib/marcel.rb
98
93
  - lib/marcel/mime_type.rb
99
94
  - lib/marcel/mime_type/definitions.rb
100
95
  - lib/marcel/version.rb
101
- - marcel.gemspec
102
- - test/declared_type_test.rb
103
- - test/extension_test.rb
104
- - test/fixtures/image.gif
105
- - test/fixtures/magic/application/msword/msword.doc
106
- - test/fixtures/magic/application/pdf/illustrator-seen-as-pdf.ai
107
- - test/fixtures/magic/application/pdf/pdf.pdf
108
- - test/fixtures/magic/application/rtf/rtf.rtf
109
- - test/fixtures/magic/application/vnd.adobe.flash.movie/flash.swf
110
- - test/fixtures/magic/application/vnd.openxmlformats-officedocument.presentationml.presentation/vnd.openxmlformats-officedocument.presentationml.presentation.pptx
111
- - test/fixtures/magic/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet/vnd.openxmlformats-officedocument.spreadsheetml.sheet.xlsx
112
- - test/fixtures/magic/application/vnd.openxmlformats-officedocument.wordprocessingml.document/vnd.openxmlformats-officedocument.wordprocessingml.document.docx
113
- - test/fixtures/magic/application/x-font-ttf.ttf
114
- - test/fixtures/magic/application/xml/xml.xml
115
- - test/fixtures/magic/application/zip/sketch.sketch
116
- - test/fixtures/magic/application/zip/zip.zip
117
- - test/fixtures/magic/audio/flac/flac.flac
118
- - test/fixtures/magic/audio/mp4/m4a.m4a
119
- - test/fixtures/magic/audio/mp4/mp4.m4a
120
- - test/fixtures/magic/audio/mpeg/mpeg.mp3
121
- - test/fixtures/magic/audio/x-wav/wav.wav
122
- - test/fixtures/magic/audio/x-wav/x-wav.wav
123
- - test/fixtures/magic/image/bmp/bmp.bmp
124
- - test/fixtures/magic/image/gif/gif.gif
125
- - test/fixtures/magic/image/jpeg/jpeg.jpg
126
- - test/fixtures/magic/image/png/png.png
127
- - test/fixtures/magic/image/svg+xml/svg.svg
128
- - test/fixtures/magic/image/tiff/tiff.tif
129
- - test/fixtures/magic/image/vnd.adobe.photoshop/photoshop-large-document-format.psb
130
- - test/fixtures/magic/image/vnd.adobe.photoshop/vnd.adobe.photoshop.psd
131
- - test/fixtures/magic/image/vnd.dwg/x-dwg.dwg
132
- - test/fixtures/magic/image/vnd.microsoft.icon/ico.ico
133
- - test/fixtures/magic/image/webp/webp.webp
134
- - test/fixtures/magic/image/x-eps/postscript/postscript.eps
135
- - test/fixtures/magic/image/x-eps/x-eps.eps
136
- - test/fixtures/magic/text/html/html.html
137
- - test/fixtures/magic/video/mp4/m4v.m4v
138
- - test/fixtures/magic/video/mp4/mp4.mp4
139
- - test/fixtures/magic/video/quicktime/quicktime.mov
140
- - test/fixtures/magic/video/webm/webm.mkv
141
- - test/fixtures/name/application/illustrator/illustrator.ai
142
- - test/fixtures/name/application/javascript/javascript.js
143
- - test/fixtures/name/application/json/json.json
144
- - test/fixtures/name/application/msword/msword.doc
145
- - test/fixtures/name/application/pdf/pdf.pdf
146
- - test/fixtures/name/application/rtf/rtf.rtf
147
- - test/fixtures/name/application/sql/sql.sql
148
- - test/fixtures/name/application/vnd.adobe.flash.movie/flash.swf
149
- - test/fixtures/name/application/vnd.android.package-archive/vnd.android.package-archive.apk
150
- - test/fixtures/name/application/vnd.apple.keynote/vnd.apple.keynote.key
151
- - test/fixtures/name/application/vnd.apple.numbers/vnd.apple.numbers.numbers
152
- - test/fixtures/name/application/vnd.apple.pages/vnd.apple.pages.pages
153
- - test/fixtures/name/application/vnd.ms-excel.sheet.binary.macroenabled.12/vnd.ms-excel.sheet.binary.macroenabled.12.xlsb
154
- - test/fixtures/name/application/vnd.ms-excel.sheet.macroenabled.12/vnd.ms-excel.sheet.macroenabled.12.xlsm
155
- - test/fixtures/name/application/vnd.ms-excel.template.macroenabled.12/vnd.ms-excel.template.macroenabled.12.xltm
156
- - test/fixtures/name/application/vnd.ms-excel/vnd.ms-excel.xls
157
- - test/fixtures/name/application/vnd.ms-powerpoint.presentation.macroenabled.12/vnd.ms-powerpoint.presentation.macroenabled.12.pptm
158
- - test/fixtures/name/application/vnd.ms-powerpoint.slideshow.macroenabled.12/vnd.ms-powerpoint.slideshow.macroenabled.12.ppsm
159
- - test/fixtures/name/application/vnd.ms-powerpoint.template.macroenabled.12/vnd.ms-powerpoint.template.macroenabled.12.potm
160
- - test/fixtures/name/application/vnd.ms-powerpoint/vnd.ms-powerpoint.ppt
161
- - test/fixtures/name/application/vnd.ms-word.document.macroenabled.12/vnd.ms-word.document.macroenabled.12.docm
162
- - test/fixtures/name/application/vnd.ms-word.template.macroenabled.12/vnd.ms-word.template.macroenabled.12.dotm
163
- - test/fixtures/name/application/vnd.openxmlformats-officedocument.presentationml.presentation/vnd.openxmlformats-officedocument.presentationml.presentation.pptx
164
- - test/fixtures/name/application/vnd.openxmlformats-officedocument.presentationml.slideshow/vnd.openxmlformats-officedocument.presentationml.slideshow.ppsx
165
- - test/fixtures/name/application/vnd.openxmlformats-officedocument.presentationml.template/vnd.openxmlformats-officedocument.presentationml.template.potx
166
- - test/fixtures/name/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet/downloaded-from-google-docs.xlsx
167
- - test/fixtures/name/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet/vnd.openxmlformats-officedocument.spreadsheetml.sheet.xlsx
168
- - test/fixtures/name/application/vnd.openxmlformats-officedocument.wordprocessingml.document/vnd.openxmlformats-officedocument.wordprocessingml.document.docx
169
- - test/fixtures/name/application/vnd.openxmlformats-officedocument.wordprocessingml.template/vnd.openxmlformats-officedocument.wordprocessingml.template.dotx
170
- - test/fixtures/name/application/x-font-ttf.ttf
171
- - test/fixtures/name/application/zip/zip.zip
172
- - test/fixtures/name/audio/flac/flac.flac
173
- - test/fixtures/name/audio/mp4/mp4.m4a
174
- - test/fixtures/name/audio/mpeg/mpeg.mp3
175
- - test/fixtures/name/audio/x-wav/x-wav.wav
176
- - test/fixtures/name/image/bmp/bmp.bmp
177
- - test/fixtures/name/image/gif/gif.gif
178
- - test/fixtures/name/image/heic.heic
179
- - test/fixtures/name/image/heif.heif
180
- - test/fixtures/name/image/jpeg/jpeg.jpg
181
- - test/fixtures/name/image/png/png.png
182
- - test/fixtures/name/image/svg+xml/svg.svg
183
- - test/fixtures/name/image/tiff/tiff.tif
184
- - test/fixtures/name/image/tiff/tiff.tiff
185
- - test/fixtures/name/image/vnd.adobe.photoshop/saved-as-large-document-format.psb
186
- - test/fixtures/name/image/vnd.adobe.photoshop/vnd.adobe.photoshop.psd
187
- - test/fixtures/name/image/x-eps/postscript/postscript.eps
188
- - test/fixtures/name/image/x-eps/x-eps.eps
189
- - test/fixtures/name/message/rfc822/rfc822.eml
190
- - test/fixtures/name/text/csv/csv.csv
191
- - test/fixtures/name/text/html/html.html
192
- - test/fixtures/name/text/plain/plain.asc
193
- - test/fixtures/name/text/plain/plain.txt
194
- - test/fixtures/name/text/x-log/x-log.log
195
- - test/fixtures/name/video/mp4/mp4.mp4
196
- - test/fixtures/name/video/quicktime/quicktime.mov
197
- - test/magic_and_declared_type_test.rb
198
- - test/magic_and_name_test.rb
199
- - test/magic_test.rb
200
- - test/mime_type_test.rb
201
- - test/name_test.rb
202
- - test/test_helper.rb
203
96
  homepage: https://github.com/basecamp/marcel
204
97
  licenses:
205
98
  - MIT
@@ -224,105 +117,4 @@ rubygems_version: 2.7.3
224
117
  signing_key:
225
118
  specification_version: 4
226
119
  summary: Simple mime type detection using magic numbers, filenames, and extensions
227
- test_files:
228
- - test/declared_type_test.rb
229
- - test/extension_test.rb
230
- - test/fixtures/image.gif
231
- - test/fixtures/magic/application/msword/msword.doc
232
- - test/fixtures/magic/application/pdf/illustrator-seen-as-pdf.ai
233
- - test/fixtures/magic/application/pdf/pdf.pdf
234
- - test/fixtures/magic/application/rtf/rtf.rtf
235
- - test/fixtures/magic/application/vnd.adobe.flash.movie/flash.swf
236
- - test/fixtures/magic/application/vnd.openxmlformats-officedocument.presentationml.presentation/vnd.openxmlformats-officedocument.presentationml.presentation.pptx
237
- - test/fixtures/magic/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet/vnd.openxmlformats-officedocument.spreadsheetml.sheet.xlsx
238
- - test/fixtures/magic/application/vnd.openxmlformats-officedocument.wordprocessingml.document/vnd.openxmlformats-officedocument.wordprocessingml.document.docx
239
- - test/fixtures/magic/application/x-font-ttf.ttf
240
- - test/fixtures/magic/application/xml/xml.xml
241
- - test/fixtures/magic/application/zip/sketch.sketch
242
- - test/fixtures/magic/application/zip/zip.zip
243
- - test/fixtures/magic/audio/flac/flac.flac
244
- - test/fixtures/magic/audio/mp4/m4a.m4a
245
- - test/fixtures/magic/audio/mp4/mp4.m4a
246
- - test/fixtures/magic/audio/mpeg/mpeg.mp3
247
- - test/fixtures/magic/audio/x-wav/wav.wav
248
- - test/fixtures/magic/audio/x-wav/x-wav.wav
249
- - test/fixtures/magic/image/bmp/bmp.bmp
250
- - test/fixtures/magic/image/gif/gif.gif
251
- - test/fixtures/magic/image/jpeg/jpeg.jpg
252
- - test/fixtures/magic/image/png/png.png
253
- - test/fixtures/magic/image/svg+xml/svg.svg
254
- - test/fixtures/magic/image/tiff/tiff.tif
255
- - test/fixtures/magic/image/vnd.adobe.photoshop/photoshop-large-document-format.psb
256
- - test/fixtures/magic/image/vnd.adobe.photoshop/vnd.adobe.photoshop.psd
257
- - test/fixtures/magic/image/vnd.dwg/x-dwg.dwg
258
- - test/fixtures/magic/image/vnd.microsoft.icon/ico.ico
259
- - test/fixtures/magic/image/webp/webp.webp
260
- - test/fixtures/magic/image/x-eps/postscript/postscript.eps
261
- - test/fixtures/magic/image/x-eps/x-eps.eps
262
- - test/fixtures/magic/text/html/html.html
263
- - test/fixtures/magic/video/mp4/m4v.m4v
264
- - test/fixtures/magic/video/mp4/mp4.mp4
265
- - test/fixtures/magic/video/quicktime/quicktime.mov
266
- - test/fixtures/magic/video/webm/webm.mkv
267
- - test/fixtures/name/application/illustrator/illustrator.ai
268
- - test/fixtures/name/application/javascript/javascript.js
269
- - test/fixtures/name/application/json/json.json
270
- - test/fixtures/name/application/msword/msword.doc
271
- - test/fixtures/name/application/pdf/pdf.pdf
272
- - test/fixtures/name/application/rtf/rtf.rtf
273
- - test/fixtures/name/application/sql/sql.sql
274
- - test/fixtures/name/application/vnd.adobe.flash.movie/flash.swf
275
- - test/fixtures/name/application/vnd.android.package-archive/vnd.android.package-archive.apk
276
- - test/fixtures/name/application/vnd.apple.keynote/vnd.apple.keynote.key
277
- - test/fixtures/name/application/vnd.apple.numbers/vnd.apple.numbers.numbers
278
- - test/fixtures/name/application/vnd.apple.pages/vnd.apple.pages.pages
279
- - test/fixtures/name/application/vnd.ms-excel.sheet.binary.macroenabled.12/vnd.ms-excel.sheet.binary.macroenabled.12.xlsb
280
- - test/fixtures/name/application/vnd.ms-excel.sheet.macroenabled.12/vnd.ms-excel.sheet.macroenabled.12.xlsm
281
- - test/fixtures/name/application/vnd.ms-excel.template.macroenabled.12/vnd.ms-excel.template.macroenabled.12.xltm
282
- - test/fixtures/name/application/vnd.ms-excel/vnd.ms-excel.xls
283
- - test/fixtures/name/application/vnd.ms-powerpoint.presentation.macroenabled.12/vnd.ms-powerpoint.presentation.macroenabled.12.pptm
284
- - test/fixtures/name/application/vnd.ms-powerpoint.slideshow.macroenabled.12/vnd.ms-powerpoint.slideshow.macroenabled.12.ppsm
285
- - test/fixtures/name/application/vnd.ms-powerpoint.template.macroenabled.12/vnd.ms-powerpoint.template.macroenabled.12.potm
286
- - test/fixtures/name/application/vnd.ms-powerpoint/vnd.ms-powerpoint.ppt
287
- - test/fixtures/name/application/vnd.ms-word.document.macroenabled.12/vnd.ms-word.document.macroenabled.12.docm
288
- - test/fixtures/name/application/vnd.ms-word.template.macroenabled.12/vnd.ms-word.template.macroenabled.12.dotm
289
- - test/fixtures/name/application/vnd.openxmlformats-officedocument.presentationml.presentation/vnd.openxmlformats-officedocument.presentationml.presentation.pptx
290
- - test/fixtures/name/application/vnd.openxmlformats-officedocument.presentationml.slideshow/vnd.openxmlformats-officedocument.presentationml.slideshow.ppsx
291
- - test/fixtures/name/application/vnd.openxmlformats-officedocument.presentationml.template/vnd.openxmlformats-officedocument.presentationml.template.potx
292
- - test/fixtures/name/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet/downloaded-from-google-docs.xlsx
293
- - test/fixtures/name/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet/vnd.openxmlformats-officedocument.spreadsheetml.sheet.xlsx
294
- - test/fixtures/name/application/vnd.openxmlformats-officedocument.wordprocessingml.document/vnd.openxmlformats-officedocument.wordprocessingml.document.docx
295
- - test/fixtures/name/application/vnd.openxmlformats-officedocument.wordprocessingml.template/vnd.openxmlformats-officedocument.wordprocessingml.template.dotx
296
- - test/fixtures/name/application/x-font-ttf.ttf
297
- - test/fixtures/name/application/zip/zip.zip
298
- - test/fixtures/name/audio/flac/flac.flac
299
- - test/fixtures/name/audio/mp4/mp4.m4a
300
- - test/fixtures/name/audio/mpeg/mpeg.mp3
301
- - test/fixtures/name/audio/x-wav/x-wav.wav
302
- - test/fixtures/name/image/bmp/bmp.bmp
303
- - test/fixtures/name/image/gif/gif.gif
304
- - test/fixtures/name/image/heic.heic
305
- - test/fixtures/name/image/heif.heif
306
- - test/fixtures/name/image/jpeg/jpeg.jpg
307
- - test/fixtures/name/image/png/png.png
308
- - test/fixtures/name/image/svg+xml/svg.svg
309
- - test/fixtures/name/image/tiff/tiff.tif
310
- - test/fixtures/name/image/tiff/tiff.tiff
311
- - test/fixtures/name/image/vnd.adobe.photoshop/saved-as-large-document-format.psb
312
- - test/fixtures/name/image/vnd.adobe.photoshop/vnd.adobe.photoshop.psd
313
- - test/fixtures/name/image/x-eps/postscript/postscript.eps
314
- - test/fixtures/name/image/x-eps/x-eps.eps
315
- - test/fixtures/name/message/rfc822/rfc822.eml
316
- - test/fixtures/name/text/csv/csv.csv
317
- - test/fixtures/name/text/html/html.html
318
- - test/fixtures/name/text/plain/plain.asc
319
- - test/fixtures/name/text/plain/plain.txt
320
- - test/fixtures/name/text/x-log/x-log.log
321
- - test/fixtures/name/video/mp4/mp4.mp4
322
- - test/fixtures/name/video/quicktime/quicktime.mov
323
- - test/magic_and_declared_type_test.rb
324
- - test/magic_and_name_test.rb
325
- - test/magic_test.rb
326
- - test/mime_type_test.rb
327
- - test/name_test.rb
328
- - test/test_helper.rb
120
+ test_files: []
data/.gitignore DELETED
@@ -1 +0,0 @@
1
- *.gem
@@ -1,7 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.2
4
- - 2.3
5
- - 2.4
6
- - 2.5
7
- before_install: gem update --system
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in letter_knife.gemspec
4
- gemspec
@@ -1,26 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- marcel (0.3.2)
5
- mimemagic (~> 0.3.2)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- mimemagic (0.3.2)
11
- minitest (5.10.2)
12
- rack (2.0.3)
13
- rake (10.5.0)
14
-
15
- PLATFORMS
16
- ruby
17
-
18
- DEPENDENCIES
19
- bundler (~> 1.7)
20
- marcel!
21
- minitest
22
- rack (~> 2.0.1)
23
- rake (~> 10.0)
24
-
25
- BUNDLED WITH
26
- 1.16.1
data/Rakefile DELETED
@@ -1,33 +0,0 @@
1
- require 'bundler/gem_tasks'
2
- require 'rake/testtask'
3
-
4
- Rake::TestTask.new do |t|
5
- t.libs << "test"
6
- t.test_files = FileList['test/**/*_test.rb']
7
- end
8
-
9
- task default: :test
10
-
11
- task :types do
12
- fixture_path = File.expand_path("../test/fixtures", __FILE__)
13
-
14
- tested_by_data = Dir["#{fixture_path}/magic/*/*"].map do |path|
15
- type = path.split("#{fixture_path}/magic/").last
16
- end
17
-
18
- tested_by_filename = Dir["#{fixture_path}/name/*/*"].sort.map do |path|
19
- type = path.split("#{fixture_path}/name/").last
20
- extensions = Dir["#{path}/*.*"].map { |file| File.extname(file) }
21
- [type, extensions]
22
- end
23
-
24
- puts "Test fixtures exist for the following types: "
25
-
26
- tested_by_filename.each do |(type, extensions)|
27
- if tested_by_data.include?(type)
28
- puts " #{type} by (#{extensions.join(", ")}) and by file data"
29
- else
30
- puts " #{type} by (#{extensions.join(", ")})"
31
- end
32
- end
33
- end
@@ -1,28 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'marcel/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = 'marcel'
8
- spec.version = Marcel::VERSION
9
- spec.authors = ['Tom Ward']
10
- spec.email = ['tom@basecamp.com']
11
- spec.summary = %q{Simple mime type detection using magic numbers, filenames, and extensions}
12
- spec.homepage = 'https://github.com/basecamp/marcel'
13
- spec.license = 'MIT'
14
-
15
- spec.files = `git ls-files -z`.split("\x0")
16
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
- spec.require_paths = ['lib']
19
-
20
- spec.required_ruby_version = '>= 2.2'
21
-
22
- spec.add_dependency 'mimemagic', '~> 0.3.2'
23
-
24
- spec.add_development_dependency 'minitest'
25
- spec.add_development_dependency 'bundler', '~> 1.7'
26
- spec.add_development_dependency 'rake', '~> 10.0'
27
- spec.add_development_dependency 'rack', '~> 2.0.1'
28
- end
@@ -1,17 +0,0 @@
1
- require 'test_helper'
2
- require 'rack'
3
-
4
- class Marcel::MimeType::DeclaredTypeTest < Marcel::TestCase
5
- test "returns declared type as last resort" do
6
- assert_equal "text/html", Marcel::MimeType.for(name: "unrecognisable", declared_type: "text/html")
7
- end
8
-
9
- test "returns application/octet-stream if declared type empty or unrecognised" do
10
- assert_equal "application/octet-stream", Marcel::MimeType.for(declared_type: "")
11
- assert_equal "application/octet-stream", Marcel::MimeType.for(declared_type: "unrecognised")
12
- end
13
-
14
- test "ignores charset declarations" do
15
- assert_equal "text/html", Marcel::MimeType.for(declared_type: "text/html; charset=utf-8")
16
- end
17
- end
@@ -1,25 +0,0 @@
1
- require 'test_helper'
2
- require 'rack'
3
-
4
- class Marcel::MimeType::ExtensionTest < Marcel::TestCase
5
- test "ignores case and any preceding dot" do
6
- assert_equal "application/pdf", Marcel::MimeType.for(extension: "PDF")
7
- assert_equal "application/pdf", Marcel::MimeType.for(extension: ".PDF")
8
- assert_equal "application/pdf", Marcel::MimeType.for(extension: "pdf")
9
- assert_equal "application/pdf", Marcel::MimeType.for(extension: ".pdf")
10
- end
11
-
12
- extensions = []
13
-
14
- each_content_type_fixture('name') do |file, name, content_type|
15
- extension = File.extname(name)
16
-
17
- unless extensions.include?(extension)
18
- test "gets type for #{content_type} given file extension #{extension}" do
19
- assert_equal content_type, Marcel::MimeType.for(extension: extension)
20
- end
21
-
22
- extensions << extension
23
- end
24
- end
25
- end