checkoff 0.201.0 → 0.203.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +130 -28
  3. data/.git-hooks/pre_commit/solargraph_typecheck.rb +12 -11
  4. data/.overcommit.yml +27 -2
  5. data/.rubocop.yml +20 -2
  6. data/.rubocop_todo.yml +90 -0
  7. data/.solargraph.yml +10 -1
  8. data/DEVELOPMENT.md +1 -1
  9. data/Gemfile +11 -8
  10. data/Gemfile.lock +66 -42
  11. data/LICENSE +1 -1
  12. data/Makefile +14 -12
  13. data/bin/brakeman +27 -0
  14. data/bin/overcommit_branch +117 -0
  15. data/bin/spoom +27 -0
  16. data/bin/srb +27 -0
  17. data/bin/srb-rbi +27 -0
  18. data/bin/tapioca +27 -0
  19. data/config/annotations_misc.rb +35 -0
  20. data/docs/cookiecutter_input.json +1 -0
  21. data/fix.sh +14 -6
  22. data/lib/checkoff/internal/search_url/simple_param_converter.rb +11 -0
  23. data/lib/checkoff/version.rb +1 -1
  24. data/requirements_dev.txt +1 -1
  25. data/sorbet/config +4 -0
  26. data/sorbet/rbi/annotations/.gitattributes +1 -0
  27. data/sorbet/rbi/annotations/activesupport.rbi +453 -0
  28. data/sorbet/rbi/annotations/faraday.rbi +17 -0
  29. data/sorbet/rbi/annotations/minitest.rbi +119 -0
  30. data/sorbet/rbi/annotations/mocha.rbi +34 -0
  31. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  32. data/sorbet/rbi/annotations/webmock.rbi +9 -0
  33. data/sorbet/rbi/dsl/.gitattributes +1 -0
  34. data/sorbet/rbi/dsl/active_support/callbacks.rbi +23 -0
  35. data/sorbet/rbi/gems/.gitattributes +1 -0
  36. data/sorbet/rbi/gems/activesupport@7.1.3.rbi +18749 -0
  37. data/sorbet/rbi/gems/addressable@2.8.6.rbi +1994 -0
  38. data/sorbet/rbi/gems/ansi@1.5.0.rbi +688 -0
  39. data/sorbet/rbi/gems/asana@0.10.6-ab9393136d9ca59b75e42a661fdddc1c65c8f7c3.rbi +6142 -0
  40. data/sorbet/rbi/gems/ast@2.4.2.rbi +585 -0
  41. data/sorbet/rbi/gems/backport@1.2.0.rbi +523 -0
  42. data/sorbet/rbi/gems/base64@0.2.0.rbi +509 -0
  43. data/sorbet/rbi/gems/benchmark@0.4.0.rbi +618 -0
  44. data/sorbet/rbi/gems/bigdecimal@3.1.5.rbi +78 -0
  45. data/sorbet/rbi/gems/builder@3.2.4.rbi +505 -0
  46. data/sorbet/rbi/gems/bump@0.10.0.rbi +169 -0
  47. data/sorbet/rbi/gems/cache@0.4.1.rbi +211 -0
  48. data/sorbet/rbi/gems/cache_method@0.2.7.rbi +293 -0
  49. data/sorbet/rbi/gems/chef-utils@18.3.0.rbi +9 -0
  50. data/sorbet/rbi/gems/childprocess@5.1.0.rbi +383 -0
  51. data/sorbet/rbi/gems/coderay@1.1.3.rbi +3427 -0
  52. data/sorbet/rbi/gems/concurrent-ruby@1.2.3.rbi +11591 -0
  53. data/sorbet/rbi/gems/connection_pool@2.4.1.rbi +9 -0
  54. data/sorbet/rbi/gems/crack@0.4.5.rbi +145 -0
  55. data/sorbet/rbi/gems/diff-lcs@1.5.1.rbi +969 -0
  56. data/sorbet/rbi/gems/docile@1.4.0.rbi +377 -0
  57. data/sorbet/rbi/gems/drb@2.2.0.rbi +1347 -0
  58. data/sorbet/rbi/gems/e2mmap@0.1.0.rbi +9 -0
  59. data/sorbet/rbi/gems/erubi@1.13.0.rbi +152 -0
  60. data/sorbet/rbi/gems/faraday-em_http@1.0.0.rbi +222 -0
  61. data/sorbet/rbi/gems/faraday-em_synchrony@1.0.0.rbi +126 -0
  62. data/sorbet/rbi/gems/faraday-excon@1.1.0.rbi +136 -0
  63. data/sorbet/rbi/gems/faraday-httpclient@1.0.1.rbi +145 -0
  64. data/sorbet/rbi/gems/faraday-multipart@1.0.4.rbi +259 -0
  65. data/sorbet/rbi/gems/faraday-net_http@1.0.1.rbi +142 -0
  66. data/sorbet/rbi/gems/faraday-net_http_persistent@1.2.0.rbi +118 -0
  67. data/sorbet/rbi/gems/faraday-patron@1.0.0.rbi +125 -0
  68. data/sorbet/rbi/gems/faraday-rack@1.0.0.rbi +133 -0
  69. data/sorbet/rbi/gems/faraday-retry@1.0.3.rbi +198 -0
  70. data/sorbet/rbi/gems/faraday@1.10.3.rbi +2729 -0
  71. data/sorbet/rbi/gems/faraday_middleware-multi_json@0.0.6.rbi +29 -0
  72. data/sorbet/rbi/gems/faraday_middleware@1.2.0.rbi +1004 -0
  73. data/sorbet/rbi/gems/gli@2.21.1.rbi +9 -0
  74. data/sorbet/rbi/gems/hashdiff@1.0.1.rbi +351 -0
  75. data/sorbet/rbi/gems/i18n@1.14.1.rbi +2326 -0
  76. data/sorbet/rbi/gems/imagen@0.1.8.rbi +340 -0
  77. data/sorbet/rbi/gems/iniparse@1.5.0.rbi +899 -0
  78. data/sorbet/rbi/gems/jaro_winkler@1.6.0.rbi +22 -0
  79. data/sorbet/rbi/gems/json@2.7.1.rbi +1562 -0
  80. data/sorbet/rbi/gems/jwt@2.7.1.rbi +1405 -0
  81. data/sorbet/rbi/gems/kramdown-parser-gfm@1.1.0.rbi +128 -0
  82. data/sorbet/rbi/gems/kramdown@2.4.0.rbi +3272 -0
  83. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14238 -0
  84. data/sorbet/rbi/gems/logger@1.6.1.rbi +920 -0
  85. data/sorbet/rbi/gems/mdl@0.13.0.rbi +445 -0
  86. data/sorbet/rbi/gems/method_source@1.0.0.rbi +273 -0
  87. data/sorbet/rbi/gems/mime-types-data@3.2023.1205.rbi +127 -0
  88. data/sorbet/rbi/gems/mime-types@3.5.1.rbi +1252 -0
  89. data/sorbet/rbi/gems/minitest-profile@0.0.2.rbi +136 -0
  90. data/sorbet/rbi/gems/minitest-reporters@1.6.1.rbi +1014 -0
  91. data/sorbet/rbi/gems/minitest@5.21.1.rbi +1539 -0
  92. data/sorbet/rbi/gems/mixlib-cli@2.1.8.rbi +314 -0
  93. data/sorbet/rbi/gems/mixlib-config@3.0.27.rbi +581 -0
  94. data/sorbet/rbi/gems/mixlib-shellout@3.2.7.rbi +629 -0
  95. data/sorbet/rbi/gems/mocha@2.1.0.rbi +12 -0
  96. data/sorbet/rbi/gems/multi_json@1.15.0.rbi +268 -0
  97. data/sorbet/rbi/gems/multi_xml@0.6.0.rbi +102 -0
  98. data/sorbet/rbi/gems/multipart-post@2.3.0.rbi +234 -0
  99. data/sorbet/rbi/gems/mutex_m@0.2.0.rbi +94 -0
  100. data/sorbet/rbi/gems/netrc@0.11.0.rbi +159 -0
  101. data/sorbet/rbi/gems/nokogiri@1.16.7.rbi +7311 -0
  102. data/sorbet/rbi/gems/oauth2@1.4.11.rbi +833 -0
  103. data/sorbet/rbi/gems/ostruct@0.6.1.rbi +354 -0
  104. data/sorbet/rbi/gems/overcommit@0.64.0.rbi +2400 -0
  105. data/sorbet/rbi/gems/parallel@1.23.0.rbi +274 -0
  106. data/sorbet/rbi/gems/parser@3.2.2.4.rbi +7253 -0
  107. data/sorbet/rbi/gems/prism@1.2.0.rbi +39085 -0
  108. data/sorbet/rbi/gems/pry@0.14.2.rbi +10070 -0
  109. data/sorbet/rbi/gems/public_suffix@5.0.4.rbi +936 -0
  110. data/sorbet/rbi/gems/punchlist@1.3.2.rbi +173 -0
  111. data/sorbet/rbi/gems/racc@1.7.3.rbi +162 -0
  112. data/sorbet/rbi/gems/rack@3.0.8.rbi +5184 -0
  113. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +403 -0
  114. data/sorbet/rbi/gems/rake@13.1.0.rbi +3022 -0
  115. data/sorbet/rbi/gems/rbi@0.2.1.rbi +4535 -0
  116. data/sorbet/rbi/gems/rbs@2.8.4.rbi +5613 -0
  117. data/sorbet/rbi/gems/regexp_parser@2.8.3.rbi +3750 -0
  118. data/sorbet/rbi/gems/reverse_markdown@2.1.1.rbi +390 -0
  119. data/sorbet/rbi/gems/rexml@3.2.6.rbi +4888 -0
  120. data/sorbet/rbi/gems/rubocop-ast@1.30.0.rbi +7061 -0
  121. data/sorbet/rbi/gems/rubocop-minitest@0.34.5.rbi +2577 -0
  122. data/sorbet/rbi/gems/rubocop-performance@1.20.2.rbi +3262 -0
  123. data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +329 -0
  124. data/sorbet/rbi/gems/rubocop@1.59.0.rbi +57238 -0
  125. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
  126. data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +9 -0
  127. data/sorbet/rbi/gems/rugged@1.6.3.rbi +1577 -0
  128. data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +217 -0
  129. data/sorbet/rbi/gems/simplecov-lcov@0.8.0.rbi +256 -0
  130. data/sorbet/rbi/gems/simplecov@0.22.0.rbi +2149 -0
  131. data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +9 -0
  132. data/sorbet/rbi/gems/solargraph@0.50.1-904b9304770a59fac393c5cc3cad481e5bdf0fd8.rbi +9396 -0
  133. data/sorbet/rbi/gems/source_finder@3.2.1.rbi +317 -0
  134. data/sorbet/rbi/gems/spoom@1.5.0.rbi +4932 -0
  135. data/sorbet/rbi/gems/tapioca@0.16.4.rbi +3604 -0
  136. data/sorbet/rbi/gems/thor@1.3.2.rbi +4378 -0
  137. data/sorbet/rbi/gems/tilt@2.4.0.rbi +933 -0
  138. data/sorbet/rbi/gems/tomlrb@2.0.3.rbi +9 -0
  139. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5918 -0
  140. data/sorbet/rbi/gems/undercover@0.5.0.rbi +433 -0
  141. data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +66 -0
  142. data/sorbet/rbi/gems/webmock@3.19.1.rbi +1769 -0
  143. data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +435 -0
  144. data/sorbet/rbi/gems/yard@0.9.34.rbi +18247 -0
  145. data/sorbet/rbi/todo.rbi +11 -0
  146. data/sorbet/tapioca/config.yml +13 -0
  147. data/sorbet/tapioca/require.rb +4 -0
  148. metadata +134 -3
@@ -0,0 +1,1252 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `mime-types` gem.
5
+ # Please instead update this file by running `bin/tapioca gem mime-types`.
6
+
7
+
8
+ # The namespace for MIME applications, tools, and libraries.
9
+ #
10
+ # source://mime-types//lib/mime/types.rb#4
11
+ module MIME; end
12
+
13
+ # The definition of one MIME content-type.
14
+ #
15
+ # == Usage
16
+ # require 'mime/types'
17
+ #
18
+ # plaintext = MIME::Types['text/plain'] # => [ text/plain ]
19
+ # text = plaintext.first
20
+ # puts text.media_type # => 'text'
21
+ # puts text.sub_type # => 'plain'
22
+ #
23
+ # puts text.extensions.join(' ') # => 'txt asc c cc h hh cpp hpp dat hlp'
24
+ # puts text.preferred_extension # => 'txt'
25
+ # puts text.friendly # => 'Text Document'
26
+ # puts text.i18n_key # => 'text.plain'
27
+ #
28
+ # puts text.encoding # => quoted-printable
29
+ # puts text.default_encoding # => quoted-printable
30
+ # puts text.binary? # => false
31
+ # puts text.ascii? # => true
32
+ # puts text.obsolete? # => false
33
+ # puts text.registered? # => true
34
+ # puts text.provisional? # => false
35
+ # puts text.complete? # => true
36
+ #
37
+ # puts text # => 'text/plain'
38
+ #
39
+ # puts text == 'text/plain' # => true
40
+ # puts 'text/plain' == text # => true
41
+ # puts text == 'text/x-plain' # => false
42
+ # puts 'text/x-plain' == text # => false
43
+ #
44
+ # puts MIME::Type.simplified('x-appl/x-zip') # => 'x-appl/x-zip'
45
+ # puts MIME::Type.i18n_key('x-appl/x-zip') # => 'x-appl.x-zip'
46
+ #
47
+ # puts text.like?('text/x-plain') # => true
48
+ # puts text.like?(MIME::Type.new('x-text/x-plain')) # => true
49
+ #
50
+ # puts text.xrefs.inspect # => { "rfc" => [ "rfc2046", "rfc3676", "rfc5147" ] }
51
+ # puts text.xref_urls # => [ "http://www.iana.org/go/rfc2046",
52
+ # # "http://www.iana.org/go/rfc3676",
53
+ # # "http://www.iana.org/go/rfc5147" ]
54
+ #
55
+ # xtext = MIME::Type.new('x-text/x-plain')
56
+ # puts xtext.media_type # => 'text'
57
+ # puts xtext.raw_media_type # => 'x-text'
58
+ # puts xtext.sub_type # => 'plain'
59
+ # puts xtext.raw_sub_type # => 'x-plain'
60
+ # puts xtext.complete? # => false
61
+ #
62
+ # puts MIME::Types.any? { |type| type.content_type == 'text/plain' } # => true
63
+ # puts MIME::Types.all?(&:registered?) # => false
64
+ #
65
+ # # Various string representations of MIME types
66
+ # qcelp = MIME::Types['audio/QCELP'].first # => audio/QCELP
67
+ # puts qcelp.content_type # => 'audio/QCELP'
68
+ # puts qcelp.simplified # => 'audio/qcelp'
69
+ #
70
+ # xwingz = MIME::Types['application/x-Wingz'].first # => application/x-Wingz
71
+ # puts xwingz.content_type # => 'application/x-Wingz'
72
+ # puts xwingz.simplified # => 'application/x-wingz'
73
+ #
74
+ # source://mime-types//lib/mime/type.rb#67
75
+ class MIME::Type
76
+ include ::Comparable
77
+
78
+ # Builds a MIME::Type object from the +content_type+, a MIME Content Type
79
+ # value (e.g., 'text/plain' or 'application/x-eruby'). The constructed object
80
+ # is yielded to an optional block for additional configuration, such as
81
+ # associating extensions and encoding information.
82
+ #
83
+ # * When provided a Hash or a MIME::Type, the MIME::Type will be
84
+ # constructed with #init_with.
85
+ # * When provided an Array, the MIME::Type will be constructed using
86
+ # the first element as the content type and the remaining flattened
87
+ # elements as extensions.
88
+ # * Otherwise, the content_type will be used as a string.
89
+ #
90
+ # Yields the newly constructed +self+ object.
91
+ #
92
+ # @return [Type] a new instance of Type
93
+ # @yield [_self]
94
+ # @yieldparam _self [MIME::Type] the object that the method was called on
95
+ #
96
+ # source://mime-types//lib/mime/type.rb#125
97
+ def initialize(content_type); end
98
+
99
+ # Compares the +other+ MIME::Type against the exact content type or the
100
+ # simplified type (the simplified type will be used if comparing against
101
+ # something that can be treated as a String with #to_s). In comparisons, this
102
+ # is done against the lowercase version of the MIME::Type.
103
+ #
104
+ # source://mime-types//lib/mime/type.rb#165
105
+ def <=>(other); end
106
+
107
+ # Merge the +extensions+ provided into this MIME::Type. The extensions added
108
+ # will be merged uniquely.
109
+ #
110
+ # source://mime-types//lib/mime/type.rb#313
111
+ def add_extensions(*extensions); end
112
+
113
+ # MIME types can be specified to be sent across a network in particular
114
+ # formats. This method returns +false+ when the MIME::Type encoding is
115
+ # set to <tt>base64</tt>.
116
+ #
117
+ # @return [Boolean]
118
+ #
119
+ # source://mime-types//lib/mime/type.rb#467
120
+ def ascii?; end
121
+
122
+ # MIME types can be specified to be sent across a network in particular
123
+ # formats. This method returns +true+ when the MIME::Type encoding is set
124
+ # to <tt>base64</tt>.
125
+ #
126
+ # @return [Boolean]
127
+ #
128
+ # source://mime-types//lib/mime/type.rb#460
129
+ def binary?; end
130
+
131
+ # Returns +true+ if the MIME::Type specifies an extension list,
132
+ # indicating that it is a complete MIME::Type.
133
+ #
134
+ # @return [Boolean]
135
+ #
136
+ # source://mime-types//lib/mime/type.rb#477
137
+ def complete?; end
138
+
139
+ # Returns the whole MIME content-type string.
140
+ #
141
+ # The content type is a presentation value from the MIME type registry and
142
+ # should not be used for comparison. The case of the content type is
143
+ # preserved, and extension markers (<tt>x-</tt>) are kept.
144
+ #
145
+ # text/plain => text/plain
146
+ # x-chemical/x-pdb => x-chemical/x-pdb
147
+ # audio/QCELP => audio/QCELP
148
+ #
149
+ # source://mime-types//lib/mime/type.rb#262
150
+ def content_type; end
151
+
152
+ # Returns the default encoding for the MIME::Type based on the media type.
153
+ #
154
+ # source://mime-types//lib/mime/type.rb#366
155
+ def default_encoding; end
156
+
157
+ # The documentation for this MIME::Type.
158
+ #
159
+ # source://mime-types//lib/mime/type.rb#390
160
+ def docs; end
161
+
162
+ # The documentation for this MIME::Type.
163
+ #
164
+ # source://mime-types//lib/mime/type.rb#390
165
+ def docs=(_arg0); end
166
+
167
+ # Populates the +coder+ with attributes about this record for
168
+ # serialization. The structure of +coder+ should match the structure used
169
+ # with #init_with.
170
+ #
171
+ # This method should be considered a private implementation detail.
172
+ #
173
+ # source://mime-types//lib/mime/type.rb#511
174
+ def encode_with(coder); end
175
+
176
+ # Returns the value of attribute encoding.
177
+ #
178
+ # source://mime-types//lib/mime/type.rb#352
179
+ def encoding; end
180
+
181
+ # source://mime-types//lib/mime/type.rb#355
182
+ def encoding=(enc); end
183
+
184
+ # Returns +true+ if the +other+ object is a MIME::Type and the content types
185
+ # match.
186
+ #
187
+ # @return [Boolean]
188
+ #
189
+ # source://mime-types//lib/mime/type.rb#223
190
+ def eql?(other); end
191
+
192
+ # The list of extensions which are known to be used for this MIME::Type.
193
+ # Non-array values will be coerced into an array with #to_a. Array values
194
+ # will be flattened, +nil+ values removed, and made unique.
195
+ #
196
+ # :attr_accessor: extensions
197
+ #
198
+ # source://mime-types//lib/mime/type.rb#301
199
+ def extensions; end
200
+
201
+ # source://mime-types//lib/mime/type.rb#306
202
+ def extensions=(value); end
203
+
204
+ # A friendly short description for this MIME::Type.
205
+ #
206
+ # call-seq:
207
+ # text_plain.friendly # => "Text File"
208
+ # text_plain.friendly('en') # => "Text File"
209
+ #
210
+ # source://mime-types//lib/mime/type.rb#397
211
+ def friendly(lang = T.unsafe(nil)); end
212
+
213
+ # Returns a hash based on the #simplified value.
214
+ #
215
+ # This maintains the invariant that two #eql? instances must have the same
216
+ # #hash (although having the same #hash does *not* imply that the objects are
217
+ # #eql?).
218
+ #
219
+ # To see why, suppose a MIME::Type instance +a+ is compared to another object
220
+ # +b+, and that <code>a.eql?(b)</code> is true. By the definition of #eql?,
221
+ # we know the following:
222
+ #
223
+ # 1. +b+ is a MIME::Type instance itself.
224
+ # 2. <code>a == b</code> is true.
225
+ #
226
+ # Due to the first point, we know that +b+ should respond to the #simplified
227
+ # method. Thus, per the definition of #<=>, we know that +a.simplified+ must
228
+ # be equal to +b.simplified+, as compared by the <=> method corresponding to
229
+ # +a.simplified+.
230
+ #
231
+ # Presumably, if <code>a.simplified <=> b.simplified</code> is +0+, then
232
+ # +a.simplified+ has the same hash as +b.simplified+. So we assume it's
233
+ # suitable for #hash to delegate to #simplified in service of the #eql?
234
+ # invariant.
235
+ #
236
+ # source://mime-types//lib/mime/type.rb#249
237
+ def hash; end
238
+
239
+ # A key suitable for use as a lookup key for translations, such as with
240
+ # the I18n library.
241
+ #
242
+ # call-seq:
243
+ # text_plain.i18n_key # => "text.plain"
244
+ # 3gpp_xml.i18n_key # => "application.vnd-3gpp-bsf-xml"
245
+ # # from application/vnd.3gpp.bsf+xml
246
+ # x_msword.i18n_key # => "application.word"
247
+ # # from application/x-msword
248
+ #
249
+ # source://mime-types//lib/mime/type.rb#422
250
+ def i18n_key; end
251
+
252
+ # Initialize an empty object from +coder+, which must contain the
253
+ # attributes necessary for initializing an empty object.
254
+ #
255
+ # This method should be considered a private implementation detail.
256
+ #
257
+ # source://mime-types//lib/mime/type.rb#540
258
+ def init_with(coder); end
259
+
260
+ # source://mime-types//lib/mime/type.rb#556
261
+ def inspect; end
262
+
263
+ # Indicates that a MIME type is like another type. This differs from
264
+ # <tt>==</tt> because <tt>x-</tt> prefixes are removed for this comparison.
265
+ #
266
+ # @return [Boolean]
267
+ #
268
+ # source://mime-types//lib/mime/type.rb#151
269
+ def like?(other); end
270
+
271
+ # Returns the media type of the simplified MIME::Type.
272
+ #
273
+ # text/plain => text
274
+ # x-chemical/x-pdb => x-chemical
275
+ # audio/QCELP => audio
276
+ #
277
+ # source://mime-types//lib/mime/type.rb#275
278
+ def media_type; end
279
+
280
+ # Returns +true+ if the media type is obsolete.
281
+ #
282
+ # source://mime-types//lib/mime/type.rb#386
283
+ def obsolete; end
284
+
285
+ # Returns +true+ if the media type is obsolete.
286
+ #
287
+ # source://mime-types//lib/mime/type.rb#386
288
+ def obsolete=(_arg0); end
289
+
290
+ # Returns +true+ if the media type is obsolete.
291
+ #
292
+ # source://mime-types//lib/mime/type.rb#386
293
+ def obsolete?; end
294
+
295
+ # source://mime-types//lib/mime/type.rb#327
296
+ def preferred_extension; end
297
+
298
+ # source://mime-types//lib/mime/type.rb#332
299
+ def preferred_extension=(value); end
300
+
301
+ # Compares the +other+ MIME::Type based on how reliable it is before doing a
302
+ # normal <=> comparison. Used by MIME::Types#[] to sort types. The
303
+ # comparisons involved are:
304
+ #
305
+ # 1. self.simplified <=> other.simplified (ensures that we
306
+ # don't try to compare different types)
307
+ # 2. IANA-registered definitions < other definitions.
308
+ # 3. Complete definitions < incomplete definitions.
309
+ # 4. Current definitions < obsolete definitions.
310
+ # 5. Obselete with use-instead names < obsolete without.
311
+ # 6. Obsolete use-instead definitions are compared.
312
+ #
313
+ # While this method is public, its use is strongly discouraged by consumers
314
+ # of mime-types. In mime-types 3, this method is likely to see substantial
315
+ # revision and simplification to ensure current registered content types sort
316
+ # before unregistered or obsolete content types.
317
+ #
318
+ # source://mime-types//lib/mime/type.rb#195
319
+ def priority_compare(other); end
320
+
321
+ # Indicates whether the MIME type's registration with IANA is provisional.
322
+ #
323
+ # source://mime-types//lib/mime/type.rb#450
324
+ def provisional; end
325
+
326
+ # Indicates whether the MIME type's registration with IANA is provisional.
327
+ #
328
+ # source://mime-types//lib/mime/type.rb#450
329
+ def provisional=(_arg0); end
330
+
331
+ # Indicates whether the MIME type's registration with IANA is provisional.
332
+ #
333
+ # @return [Boolean]
334
+ #
335
+ # source://mime-types//lib/mime/type.rb#453
336
+ def provisional?; end
337
+
338
+ # Returns the media type of the unmodified MIME::Type.
339
+ #
340
+ # text/plain => text
341
+ # x-chemical/x-pdb => x-chemical
342
+ # audio/QCELP => audio
343
+ #
344
+ # source://mime-types//lib/mime/type.rb#281
345
+ def raw_media_type; end
346
+
347
+ # Returns the media type of the unmodified MIME::Type.
348
+ #
349
+ # text/plain => plain
350
+ # x-chemical/x-pdb => x-pdb
351
+ # audio/QCELP => qcelp
352
+ #
353
+ # source://mime-types//lib/mime/type.rb#293
354
+ def raw_sub_type; end
355
+
356
+ # Indicates whether the MIME type has been registered with IANA.
357
+ #
358
+ # source://mime-types//lib/mime/type.rb#446
359
+ def registered; end
360
+
361
+ # Indicates whether the MIME type has been registered with IANA.
362
+ #
363
+ # source://mime-types//lib/mime/type.rb#446
364
+ def registered=(_arg0); end
365
+
366
+ # Indicates whether the MIME type has been registered with IANA.
367
+ #
368
+ # source://mime-types//lib/mime/type.rb#446
369
+ def registered?; end
370
+
371
+ # Indicateswhether the MIME type is declared as a signature type.
372
+ #
373
+ # source://mime-types//lib/mime/type.rb#472
374
+ def signature; end
375
+
376
+ # Indicateswhether the MIME type is declared as a signature type.
377
+ #
378
+ # source://mime-types//lib/mime/type.rb#472
379
+ def signature=(_arg0); end
380
+
381
+ # Indicateswhether the MIME type is declared as a signature type.
382
+ #
383
+ # source://mime-types//lib/mime/type.rb#472
384
+ def signature?; end
385
+
386
+ # A simplified form of the MIME content-type string, suitable for
387
+ # case-insensitive comparison, with the content_type converted to lowercase.
388
+ #
389
+ # text/plain => text/plain
390
+ # x-chemical/x-pdb => x-chemical/x-pdb
391
+ # audio/QCELP => audio/qcelp
392
+ #
393
+ # source://mime-types//lib/mime/type.rb#269
394
+ def simplified; end
395
+
396
+ # Returns the sub-type of the simplified MIME::Type.
397
+ #
398
+ # text/plain => plain
399
+ # x-chemical/x-pdb => pdb
400
+ # audio/QCELP => QCELP
401
+ #
402
+ # source://mime-types//lib/mime/type.rb#287
403
+ def sub_type; end
404
+
405
+ # Converts the MIME::Type to a hash. The output of this method can also be
406
+ # used to initialize a MIME::Type.
407
+ #
408
+ # source://mime-types//lib/mime/type.rb#502
409
+ def to_h; end
410
+
411
+ # Converts the MIME::Type to a JSON string.
412
+ #
413
+ # source://mime-types//lib/mime/type.rb#495
414
+ def to_json(*args); end
415
+
416
+ # Returns the MIME::Type as a string.
417
+ #
418
+ # source://mime-types//lib/mime/type.rb#482
419
+ def to_s; end
420
+
421
+ # Returns the MIME::Type as a string for implicit conversions. This allows
422
+ # MIME::Type objects to appear on either side of a comparison.
423
+ #
424
+ # 'text/plain' == MIME::Type.new('text/plain')
425
+ #
426
+ # source://mime-types//lib/mime/type.rb#490
427
+ def to_str; end
428
+
429
+ # source://mime-types//lib/mime/type.rb#378
430
+ def use_instead; end
431
+
432
+ # Sets the attribute use_instead
433
+ #
434
+ # @param value the value to set the attribute use_instead to.
435
+ #
436
+ # source://mime-types//lib/mime/type.rb#383
437
+ def use_instead=(_arg0); end
438
+
439
+ # The decoded cross-reference URL list for this MIME::Type.
440
+ #
441
+ # source://mime-types//lib/mime/type.rb#438
442
+ def xref_urls; end
443
+
444
+ # Returns the value of attribute xrefs.
445
+ #
446
+ # source://mime-types//lib/mime/type.rb#430
447
+ def xrefs; end
448
+
449
+ # source://mime-types//lib/mime/type.rb#433
450
+ def xrefs=(xrefs); end
451
+
452
+ private
453
+
454
+ # source://mime-types//lib/mime/type.rb#609
455
+ def content_type=(type_string); end
456
+
457
+ # MRI 2.2 and older don't have a method for string interning,
458
+ # so we simply freeze them for keeping a similar interface
459
+ #
460
+ # source://mime-types//lib/mime/type.rb#626
461
+ def intern_string(string); end
462
+
463
+ # source://mime-types//lib/mime/type.rb#637
464
+ def xref_map(values, helper); end
465
+
466
+ # source://mime-types//lib/mime/type.rb#645
467
+ def xref_url_for_draft(value); end
468
+
469
+ # source://mime-types//lib/mime/type.rb#653
470
+ def xref_url_for_person(value); end
471
+
472
+ # source://mime-types//lib/mime/type.rb#641
473
+ def xref_url_for_rfc(value); end
474
+
475
+ # source://mime-types//lib/mime/type.rb#649
476
+ def xref_url_for_rfc_errata(value); end
477
+
478
+ # source://mime-types//lib/mime/type.rb#657
479
+ def xref_url_for_template(value); end
480
+
481
+ class << self
482
+ # Converts a provided +content_type+ into a translation key suitable for
483
+ # use with the I18n library.
484
+ #
485
+ # source://mime-types//lib/mime/type.rb#576
486
+ def i18n_key(content_type); end
487
+
488
+ # Return a +MatchData+ object of the +content_type+ against pattern of
489
+ # media types.
490
+ #
491
+ # source://mime-types//lib/mime/type.rb#584
492
+ def match(content_type); end
493
+
494
+ # MIME media types are case-insensitive, but are typically presented in a
495
+ # case-preserving format in the type registry. This method converts
496
+ # +content_type+ to lowercase.
497
+ #
498
+ # In previous versions of mime-types, this would also remove any extension
499
+ # prefix (<tt>x-</tt>). This is no longer default behaviour, but may be
500
+ # provided by providing a truth value to +remove_x_prefix+.
501
+ #
502
+ # source://mime-types//lib/mime/type.rb#570
503
+ def simplified(content_type, remove_x_prefix: T.unsafe(nil)); end
504
+
505
+ private
506
+
507
+ # source://mime-types//lib/mime/type.rb#595
508
+ def simplify_matchdata(matchdata, remove_x = T.unsafe(nil), joiner: T.unsafe(nil)); end
509
+ end
510
+ end
511
+
512
+ # source://mime-types//lib/mime/type.rb#106
513
+ MIME::Type::ASCII_ENCODINGS = T.let(T.unsafe(nil), Array)
514
+
515
+ # source://mime-types//lib/mime/type.rb#105
516
+ MIME::Type::BINARY_ENCODINGS = T.let(T.unsafe(nil), Array)
517
+
518
+ # A version of MIME::Type that works hand-in-hand with a MIME::Types::Columnar
519
+ # container to load data by columns.
520
+ #
521
+ # When a field is has not yet been loaded, that data will be loaded for all
522
+ # types in the container before forwarding the message to MIME::Type.
523
+ #
524
+ # More information can be found in MIME::Types::Columnar.
525
+ #
526
+ # MIME::Type::Columnar is *not* intended to be created except by
527
+ # MIME::Types::Columnar containers.
528
+ #
529
+ # source://mime-types//lib/mime/type/columnar.rb#15
530
+ class MIME::Type::Columnar < ::MIME::Type
531
+ # @return [Columnar] a new instance of Columnar
532
+ #
533
+ # source://mime-types//lib/mime/type/columnar.rb#16
534
+ def initialize(container, content_type, extensions); end
535
+
536
+ # source://mime-types//lib/mime/type/columnar.rb#27
537
+ def docs(*args); end
538
+
539
+ # source://mime-types//lib/mime/type/columnar.rb#27
540
+ def docs=(*args); end
541
+
542
+ # source://mime-types//lib/mime/type/columnar.rb#43
543
+ def encode_with(coder); end
544
+
545
+ # source://mime-types//lib/mime/type/columnar.rb#27
546
+ def encoding(*args); end
547
+
548
+ # source://mime-types//lib/mime/type/columnar.rb#27
549
+ def encoding=(*args); end
550
+
551
+ # source://mime-types//lib/mime/type/columnar.rb#27
552
+ def friendly(*args); end
553
+
554
+ # source://mime-types//lib/mime/type/columnar.rb#27
555
+ def obsolete(*args); end
556
+
557
+ # source://mime-types//lib/mime/type/columnar.rb#27
558
+ def obsolete=(*args); end
559
+
560
+ # source://mime-types//lib/mime/type/columnar.rb#27
561
+ def obsolete?(*args); end
562
+
563
+ # source://mime-types//lib/mime/type/columnar.rb#27
564
+ def preferred_extension(*args); end
565
+
566
+ # source://mime-types//lib/mime/type/columnar.rb#27
567
+ def preferred_extension=(*args); end
568
+
569
+ # source://mime-types//lib/mime/type/columnar.rb#27
570
+ def provisional(*args); end
571
+
572
+ # source://mime-types//lib/mime/type/columnar.rb#27
573
+ def provisional=(*args); end
574
+
575
+ # source://mime-types//lib/mime/type/columnar.rb#27
576
+ def provisional?(*args); end
577
+
578
+ # source://mime-types//lib/mime/type/columnar.rb#27
579
+ def registered(*args); end
580
+
581
+ # source://mime-types//lib/mime/type/columnar.rb#27
582
+ def registered=(*args); end
583
+
584
+ # source://mime-types//lib/mime/type/columnar.rb#27
585
+ def registered?(*args); end
586
+
587
+ # source://mime-types//lib/mime/type/columnar.rb#27
588
+ def signature(*args); end
589
+
590
+ # source://mime-types//lib/mime/type/columnar.rb#27
591
+ def signature=(*args); end
592
+
593
+ # source://mime-types//lib/mime/type/columnar.rb#27
594
+ def signature?(*args); end
595
+
596
+ # source://mime-types//lib/mime/type/columnar.rb#27
597
+ def use_instead(*args); end
598
+
599
+ # source://mime-types//lib/mime/type/columnar.rb#27
600
+ def use_instead=(*args); end
601
+
602
+ # source://mime-types//lib/mime/type/columnar.rb#27
603
+ def xref_urls(*args); end
604
+
605
+ # source://mime-types//lib/mime/type/columnar.rb#27
606
+ def xrefs(*args); end
607
+
608
+ # source://mime-types//lib/mime/type/columnar.rb#27
609
+ def xrefs=(*args); end
610
+ end
611
+
612
+ # source://mime-types//lib/mime/type.rb#104
613
+ MIME::Type::I18N_RE = T.let(T.unsafe(nil), Regexp)
614
+
615
+ # Reflects a MIME content-type specification that is not correctly
616
+ # formatted (it isn't +type+/+subtype+).
617
+ #
618
+ # source://mime-types//lib/mime/type.rb#71
619
+ class MIME::Type::InvalidContentType < ::ArgumentError
620
+ # :stopdoc:
621
+ #
622
+ # @return [InvalidContentType] a new instance of InvalidContentType
623
+ #
624
+ # source://mime-types//lib/mime/type.rb#72
625
+ def initialize(type_string); end
626
+
627
+ # source://mime-types//lib/mime/type.rb#76
628
+ def to_s; end
629
+ end
630
+
631
+ # Reflects an unsupported MIME encoding.
632
+ #
633
+ # source://mime-types//lib/mime/type.rb#84
634
+ class MIME::Type::InvalidEncoding < ::ArgumentError
635
+ # :stopdoc:
636
+ #
637
+ # @return [InvalidEncoding] a new instance of InvalidEncoding
638
+ #
639
+ # source://mime-types//lib/mime/type.rb#85
640
+ def initialize(encoding); end
641
+
642
+ # source://mime-types//lib/mime/type.rb#89
643
+ def to_s; end
644
+ end
645
+
646
+ # :stopdoc:
647
+ # TODO verify mime-type character restrictions; I am pretty sure that this is
648
+ # too wide open.
649
+ #
650
+ # source://mime-types//lib/mime/type.rb#103
651
+ MIME::Type::MEDIA_TYPE_RE = T.let(T.unsafe(nil), Regexp)
652
+
653
+ # The released version of the mime-types library.
654
+ #
655
+ # source://mime-types//lib/mime/type.rb#96
656
+ MIME::Type::VERSION = T.let(T.unsafe(nil), String)
657
+
658
+ # MIME::Types is a registry of MIME types. It is both a class (created with
659
+ # MIME::Types.new) and a default registry (loaded automatically or through
660
+ # interactions with MIME::Types.[] and MIME::Types.type_for).
661
+ #
662
+ # == The Default mime-types Registry
663
+ #
664
+ # The default mime-types registry is loaded automatically when the library
665
+ # is required (<tt>require 'mime/types'</tt>), but it may be lazily loaded
666
+ # (loaded on first use) with the use of the environment variable
667
+ # +RUBY_MIME_TYPES_LAZY_LOAD+ having any value other than +false+. The
668
+ # initial startup is about 14× faster (~10 ms vs ~140 ms), but the
669
+ # registry will be loaded at some point in the future.
670
+ #
671
+ # The default mime-types registry can also be loaded from a Marshal cache
672
+ # file specific to the version of MIME::Types being loaded. This will be
673
+ # handled automatically with the use of a file referred to in the
674
+ # environment variable +RUBY_MIME_TYPES_CACHE+. MIME::Types will attempt to
675
+ # load the registry from this cache file (MIME::Type::Cache.load); if it
676
+ # cannot be loaded (because the file does not exist, there is an error, or
677
+ # the data is for a different version of mime-types), the default registry
678
+ # will be loaded from the normal JSON version and then the cache file will
679
+ # be *written* to the location indicated by +RUBY_MIME_TYPES_CACHE+. Cache
680
+ # file loads just over 4½× faster (~30 ms vs ~140 ms).
681
+ # loads.
682
+ #
683
+ # Notes:
684
+ # * The loading of the default registry is *not* atomic; when using a
685
+ # multi-threaded environment, it is recommended that lazy loading is not
686
+ # used and mime-types is loaded as early as possible.
687
+ # * Cache files should be specified per application in a multiprocess
688
+ # environment and should be initialized during deployment or before
689
+ # forking to minimize the chance that the multiple processes will be
690
+ # trying to write to the same cache file at the same time, or that two
691
+ # applications that are on different versions of mime-types would be
692
+ # thrashing the cache.
693
+ # * Unless cache files are preinitialized, the application using the
694
+ # mime-types cache file must have read/write permission to the cache file.
695
+ #
696
+ # == Usage
697
+ # require 'mime/types'
698
+ #
699
+ # plaintext = MIME::Types['text/plain']
700
+ # print plaintext.media_type # => 'text'
701
+ # print plaintext.sub_type # => 'plain'
702
+ #
703
+ # puts plaintext.extensions.join(" ") # => 'asc txt c cc h hh cpp'
704
+ #
705
+ # puts plaintext.encoding # => 8bit
706
+ # puts plaintext.binary? # => false
707
+ # puts plaintext.ascii? # => true
708
+ # puts plaintext.obsolete? # => false
709
+ # puts plaintext.registered? # => true
710
+ # puts plaintext.provisional? # => false
711
+ # puts plaintext == 'text/plain' # => true
712
+ # puts MIME::Type.simplified('x-appl/x-zip') # => 'appl/zip'
713
+ #
714
+ # source://mime-types//lib/mime/types.rb#6
715
+ class MIME::Types
716
+ include ::Enumerable
717
+ extend ::Enumerable
718
+
719
+ # Creates a new MIME::Types registry.
720
+ #
721
+ # @return [Types] a new instance of Types
722
+ #
723
+ # source://mime-types//lib/mime/types.rb#75
724
+ def initialize; end
725
+
726
+ # Returns a list of MIME::Type objects, which may be empty. The optional
727
+ # flag parameters are <tt>:complete</tt> (finds only complete MIME::Type
728
+ # objects) and <tt>:registered</tt> (finds only MIME::Types that are
729
+ # registered). It is possible for multiple matches to be returned for
730
+ # either type (in the example below, 'text/plain' returns two values --
731
+ # one for the general case, and one for VMS systems).
732
+ #
733
+ # puts "\nMIME::Types['text/plain']"
734
+ # MIME::Types['text/plain'].each { |t| puts t.to_a.join(", ") }
735
+ #
736
+ # puts "\nMIME::Types[/^image/, complete: true]"
737
+ # MIME::Types[/^image/, :complete => true].each do |t|
738
+ # puts t.to_a.join(", ")
739
+ # end
740
+ #
741
+ # If multiple type definitions are returned, returns them sorted as
742
+ # follows:
743
+ # 1. Complete definitions sort before incomplete ones;
744
+ # 2. IANA-registered definitions sort before LTSW-recorded
745
+ # definitions.
746
+ # 3. Current definitions sort before obsolete ones;
747
+ # 4. Obsolete definitions with use-instead clauses sort before those
748
+ # without;
749
+ # 5. Obsolete definitions use-instead clauses are compared.
750
+ # 6. Sort on name.
751
+ #
752
+ # source://mime-types//lib/mime/types.rb#125
753
+ def [](type_id, complete: T.unsafe(nil), registered: T.unsafe(nil)); end
754
+
755
+ # Add one or more MIME::Type objects to the set of known types. If the
756
+ # type is already known, a warning will be displayed.
757
+ #
758
+ # The last parameter may be the value <tt>:silent</tt> or +true+ which
759
+ # will suppress duplicate MIME type warnings.
760
+ #
761
+ # source://mime-types//lib/mime/types.rb#167
762
+ def add(*types); end
763
+
764
+ # Add a single MIME::Type object to the set of known types. If the +type+ is
765
+ # already known, a warning will be displayed. The +quiet+ parameter may be a
766
+ # truthy value to suppress that warning.
767
+ #
768
+ # source://mime-types//lib/mime/types.rb#188
769
+ def add_type(type, quiet = T.unsafe(nil)); end
770
+
771
+ # Returns the number of known type variants.
772
+ #
773
+ # source://mime-types//lib/mime/types.rb#81
774
+ def count; end
775
+
776
+ # Iterates through the type variants.
777
+ #
778
+ # source://mime-types//lib/mime/types.rb#90
779
+ def each; end
780
+
781
+ # source://mime-types//lib/mime/types.rb#85
782
+ def inspect; end
783
+
784
+ # Return the list of MIME::Types which belongs to the file based on its
785
+ # filename extension. If there is no extension, the filename will be used
786
+ # as the matching criteria on its own.
787
+ #
788
+ # This will always return a merged, flatten, priority sorted, unique array.
789
+ #
790
+ # puts MIME::Types.type_for('citydesk.xml')
791
+ # => [application/xml, text/xml]
792
+ # puts MIME::Types.type_for('citydesk.gif')
793
+ # => [image/gif]
794
+ # puts MIME::Types.type_for(%w(citydesk.xml citydesk.gif))
795
+ # => [application/xml, image/gif, text/xml]
796
+ #
797
+ # source://mime-types//lib/mime/types.rb#153
798
+ def of(filename); end
799
+
800
+ # Return the list of MIME::Types which belongs to the file based on its
801
+ # filename extension. If there is no extension, the filename will be used
802
+ # as the matching criteria on its own.
803
+ #
804
+ # This will always return a merged, flatten, priority sorted, unique array.
805
+ #
806
+ # puts MIME::Types.type_for('citydesk.xml')
807
+ # => [application/xml, text/xml]
808
+ # puts MIME::Types.type_for('citydesk.gif')
809
+ # => [image/gif]
810
+ # puts MIME::Types.type_for(%w(citydesk.xml citydesk.gif))
811
+ # => [application/xml, image/gif, text/xml]
812
+ #
813
+ # source://mime-types//lib/mime/types.rb#153
814
+ def type_for(filename); end
815
+
816
+ private
817
+
818
+ # source://mime-types//lib/mime/types.rb#201
819
+ def add_type_variant!(mime_type); end
820
+
821
+ # source://mime-types//lib/mime/types.rb#211
822
+ def index_extensions!(mime_type); end
823
+
824
+ # source://mime-types//lib/mime/types.rb#221
825
+ def match(pattern); end
826
+
827
+ # source://mime-types//lib/mime/types.rb#215
828
+ def prune_matches(matches, complete, registered); end
829
+
830
+ # source://mime-types//lib/mime/types.rb#205
831
+ def reindex_extensions!(mime_type); end
832
+
833
+ class << self
834
+ # MIME::Types#[] against the default MIME::Types registry.
835
+ #
836
+ # source://mime-types//lib/mime/types/registry.rb#14
837
+ def [](type_id, complete: T.unsafe(nil), registered: T.unsafe(nil)); end
838
+
839
+ # MIME::Types#add against the default MIME::Types registry.
840
+ #
841
+ # source://mime-types//lib/mime/types/registry.rb#39
842
+ def add(*types); end
843
+
844
+ # MIME::Types#count against the default MIME::Types registry.
845
+ #
846
+ # source://mime-types//lib/mime/types/registry.rb#19
847
+ def count; end
848
+
849
+ # MIME::Types#each against the default MIME::Types registry.
850
+ #
851
+ # source://mime-types//lib/mime/types/registry.rb#24
852
+ def each; end
853
+
854
+ # Configure the MIME::Types logger. This defaults to an instance of a
855
+ # logger that passes messages (unformatted) through to Kernel#warn.
856
+ #
857
+ # source://mime-types//lib/mime/types/logger.rb#12
858
+ def logger; end
859
+
860
+ # Configure the MIME::Types logger. This defaults to an instance of a
861
+ # logger that passes messages (unformatted) through to Kernel#warn.
862
+ #
863
+ # source://mime-types//lib/mime/types/logger.rb#12
864
+ def logger=(_arg0); end
865
+
866
+ # source://mime-types//lib/mime/types/registry.rb#7
867
+ def new(*_arg0); end
868
+
869
+ # MIME::Types#type_for against the default MIME::Types registry.
870
+ #
871
+ # source://mime-types//lib/mime/types/registry.rb#33
872
+ def of(filename); end
873
+
874
+ # MIME::Types#type_for against the default MIME::Types registry.
875
+ #
876
+ # source://mime-types//lib/mime/types/registry.rb#33
877
+ def type_for(filename); end
878
+
879
+ private
880
+
881
+ # source://mime-types//lib/mime/types/registry.rb#75
882
+ def __instances__; end
883
+
884
+ # source://mime-types//lib/mime/types/registry.rb#55
885
+ def __types__; end
886
+
887
+ # @return [Boolean]
888
+ #
889
+ # source://mime-types//lib/mime/types/registry.rb#45
890
+ def lazy_load?; end
891
+
892
+ # source://mime-types//lib/mime/types/registry.rb#65
893
+ def load_default_mime_types(mode = T.unsafe(nil)); end
894
+
895
+ # source://mime-types//lib/mime/types/registry.rb#60
896
+ def load_mode; end
897
+
898
+ # source://mime-types//lib/mime/types/registry.rb#79
899
+ def reindex_extensions(type); end
900
+ end
901
+ end
902
+
903
+ # Caching of MIME::Types registries is advisable if you will be loading
904
+ # the default registry relatively frequently. With the class methods on
905
+ # MIME::Types::Cache, any MIME::Types registry can be marshaled quickly
906
+ # and easily.
907
+ #
908
+ # The cache is invalidated on a per-data-version basis; a cache file for
909
+ # version 3.2015.1118 will not be reused with version 3.2015.1201.
910
+ #
911
+ # source://mime-types//lib/mime/types/cache.rb#3
912
+ class MIME::Types::Cache < ::Struct
913
+ def data; end
914
+ def data=(_); end
915
+ def version; end
916
+ def version=(_); end
917
+
918
+ class << self
919
+ def [](*_arg0); end
920
+ def inspect; end
921
+ def keyword_init?; end
922
+
923
+ # Attempts to load the cache from the file provided as a parameter or in
924
+ # the environment variable +RUBY_MIME_TYPES_CACHE+. Returns +nil+ if the
925
+ # file does not exist, if the file cannot be loaded, or if the data in
926
+ # the cache version is different than this version.
927
+ #
928
+ # source://mime-types//lib/mime/types/cache.rb#17
929
+ def load(cache_file = T.unsafe(nil)); end
930
+
931
+ def members; end
932
+ def new(*_arg0); end
933
+
934
+ # Attempts to save the types provided to the cache file provided.
935
+ #
936
+ # If +types+ is not provided or is +nil+, the cache will contain the
937
+ # current MIME::Types default registry.
938
+ #
939
+ # If +cache_file+ is not provided or is +nil+, the cache will be written
940
+ # to the file specified in the environment variable
941
+ # +RUBY_MIME_TYPES_CACHE+. If there is no cache file specified either
942
+ # directly or through the environment, this method will return +nil+
943
+ #
944
+ # source://mime-types//lib/mime/types/cache.rb#46
945
+ def save(types = T.unsafe(nil), cache_file = T.unsafe(nil)); end
946
+ end
947
+ end
948
+
949
+ # MIME::Types::Columnar is used to extend a MIME::Types container to load data
950
+ # by columns instead of from JSON or YAML. Column loads of MIME types loaded
951
+ # through the columnar store are synchronized with a Mutex.
952
+ #
953
+ # MIME::Types::Columnar is not intended to be used directly, but will be added
954
+ # to an instance of MIME::Types when it is loaded with
955
+ # MIME::Types::Loader#load_columnar.
956
+ #
957
+ # source://mime-types//lib/mime/types/_columnar.rb#12
958
+ module MIME::Types::Columnar
959
+ # Load the first column data file (type and extensions).
960
+ #
961
+ # source://mime-types//lib/mime/types/_columnar.rb#22
962
+ def load_base_data(path); end
963
+
964
+ private
965
+
966
+ # source://mime-types//lib/mime/types/_columnar.rb#122
967
+ def arr(line); end
968
+
969
+ # source://mime-types//lib/mime/types/_columnar.rb#110
970
+ def dict(line, array: T.unsafe(nil)); end
971
+
972
+ # source://mime-types//lib/mime/types/_columnar.rb#41
973
+ def each_file_line(name, lookup = T.unsafe(nil)); end
974
+
975
+ # source://mime-types//lib/mime/types/_columnar.rb#134
976
+ def flag(line); end
977
+
978
+ # source://mime-types//lib/mime/types/_columnar.rb#70
979
+ def load_docs; end
980
+
981
+ # source://mime-types//lib/mime/types/_columnar.rb#63
982
+ def load_encoding; end
983
+
984
+ # source://mime-types//lib/mime/types/_columnar.rb#82
985
+ def load_flags; end
986
+
987
+ # source://mime-types//lib/mime/types/_columnar.rb#98
988
+ def load_friendly; end
989
+
990
+ # source://mime-types//lib/mime/types/_columnar.rb#76
991
+ def load_preferred_extension; end
992
+
993
+ # source://mime-types//lib/mime/types/_columnar.rb#104
994
+ def load_use_instead; end
995
+
996
+ # source://mime-types//lib/mime/types/_columnar.rb#92
997
+ def load_xrefs; end
998
+
999
+ # source://mime-types//lib/mime/types/_columnar.rb#130
1000
+ def opt(line); end
1001
+
1002
+ class << self
1003
+ # source://mime-types//lib/mime/types/_columnar.rb#15
1004
+ def extended(obj); end
1005
+ end
1006
+ end
1007
+
1008
+ # source://mime-types//lib/mime/types/_columnar.rb#13
1009
+ MIME::Types::Columnar::LOAD_MUTEX = T.let(T.unsafe(nil), Thread::Mutex)
1010
+
1011
+ # MIME::Types requires a serializable keyed container that returns an empty Set
1012
+ # on a key miss. Hash#default_value cannot be used because, while it traverses
1013
+ # the Marshal format correctly, it won't survive any other serialization
1014
+ # format (plus, a default of a mutable object resuls in a shared mess).
1015
+ # Hash#default_proc cannot be used without a wrapper because it prevents
1016
+ # Marshal serialization (and doesn't survive the round-trip).
1017
+ #
1018
+ # source://mime-types//lib/mime/types/container.rb#12
1019
+ class MIME::Types::Container
1020
+ extend ::Forwardable
1021
+
1022
+ # @return [Container] a new instance of Container
1023
+ #
1024
+ # source://mime-types//lib/mime/types/container.rb#15
1025
+ def initialize(hash = T.unsafe(nil)); end
1026
+
1027
+ # source://forwardable/1.3.2/forwardable.rb#229
1028
+ def ==(*args, **_arg1, &block); end
1029
+
1030
+ # source://mime-types//lib/mime/types/container.rb#20
1031
+ def [](key); end
1032
+
1033
+ # source://mime-types//lib/mime/types/container.rb#24
1034
+ def []=(key, value); end
1035
+
1036
+ # source://mime-types//lib/mime/types/container.rb#61
1037
+ def add(key, value); end
1038
+
1039
+ # source://forwardable/1.3.2/forwardable.rb#229
1040
+ def count(*args, **_arg1, &block); end
1041
+
1042
+ # source://forwardable/1.3.2/forwardable.rb#229
1043
+ def each(*args, **_arg1, &block); end
1044
+
1045
+ # source://forwardable/1.3.2/forwardable.rb#229
1046
+ def each_value(*args, **_arg1, &block); end
1047
+
1048
+ # source://forwardable/1.3.2/forwardable.rb#229
1049
+ def empty?(*args, **_arg1, &block); end
1050
+
1051
+ # source://mime-types//lib/mime/types/container.rb#73
1052
+ def encode_with(coder); end
1053
+
1054
+ # source://forwardable/1.3.2/forwardable.rb#229
1055
+ def flat_map(*args, **_arg1, &block); end
1056
+
1057
+ # source://mime-types//lib/mime/types/container.rb#77
1058
+ def init_with(coder); end
1059
+
1060
+ # source://forwardable/1.3.2/forwardable.rb#229
1061
+ def keys(*args, **_arg1, &block); end
1062
+
1063
+ # source://mime-types//lib/mime/types/container.rb#65
1064
+ def marshal_dump; end
1065
+
1066
+ # source://mime-types//lib/mime/types/container.rb#69
1067
+ def marshal_load(hash); end
1068
+
1069
+ # source://mime-types//lib/mime/types/container.rb#34
1070
+ def merge(other); end
1071
+
1072
+ # source://mime-types//lib/mime/types/container.rb#38
1073
+ def merge!(other); end
1074
+
1075
+ # source://forwardable/1.3.2/forwardable.rb#229
1076
+ def select(*args, **_arg1, &block); end
1077
+
1078
+ # source://mime-types//lib/mime/types/container.rb#46
1079
+ def to_hash; end
1080
+
1081
+ # source://forwardable/1.3.2/forwardable.rb#229
1082
+ def values(*args, **_arg1, &block); end
1083
+
1084
+ protected
1085
+
1086
+ # Returns the value of attribute container.
1087
+ #
1088
+ # source://mime-types//lib/mime/types/container.rb#84
1089
+ def container; end
1090
+
1091
+ # Sets the attribute container
1092
+ #
1093
+ # @param value the value to set the attribute container to.
1094
+ #
1095
+ # source://mime-types//lib/mime/types/container.rb#84
1096
+ def container=(_arg0); end
1097
+
1098
+ # source://mime-types//lib/mime/types/container.rb#86
1099
+ def normalize; end
1100
+ end
1101
+
1102
+ # source://mime-types//lib/mime/types/container.rb#94
1103
+ MIME::Types::Container::EMPTY_SET = T.let(T.unsafe(nil), Set)
1104
+
1105
+ # This class is responsible for initializing the MIME::Types registry from
1106
+ # the data files supplied with the mime-types library.
1107
+ #
1108
+ # The Loader will use one of the following paths:
1109
+ # 1. The +path+ provided in its constructor argument;
1110
+ # 2. The value of ENV['RUBY_MIME_TYPES_DATA']; or
1111
+ # 3. The value of MIME::Types::Data::PATH.
1112
+ #
1113
+ # When #load is called, the +path+ will be searched recursively for all YAML
1114
+ # (.yml or .yaml) files. By convention, there is one file for each media
1115
+ # type (application.yml, audio.yml, etc.), but this is not required.
1116
+ #
1117
+ # source://mime-types//lib/mime/types/loader.rb#22
1118
+ class MIME::Types::Loader
1119
+ # Creates a Loader object that can be used to load MIME::Types registries
1120
+ # into memory, using YAML, JSON, or Columnar registry format loaders.
1121
+ #
1122
+ # @return [Loader] a new instance of Loader
1123
+ #
1124
+ # source://mime-types//lib/mime/types/loader.rb#31
1125
+ def initialize(path = T.unsafe(nil), container = T.unsafe(nil)); end
1126
+
1127
+ # The MIME::Types container instance that will be loaded. If not provided
1128
+ # at initialization, a new MIME::Types instance will be constructed.
1129
+ #
1130
+ # source://mime-types//lib/mime/types/loader.rb#27
1131
+ def container; end
1132
+
1133
+ # Loads a MIME::Types registry. Loads from JSON files by default
1134
+ # (#load_json).
1135
+ #
1136
+ # This will load from columnar files (#load_columnar) if <tt>columnar:
1137
+ # true</tt> is provided in +options+ and there are columnar files in +path+.
1138
+ #
1139
+ # source://mime-types//lib/mime/types/loader.rb#82
1140
+ def load(options = T.unsafe(nil)); end
1141
+
1142
+ # Loads a MIME::Types registry from columnar files recursively found in
1143
+ # +path+.
1144
+ #
1145
+ # source://mime-types//lib/mime/types/loader.rb#69
1146
+ def load_columnar; end
1147
+
1148
+ # Loads a MIME::Types registry from JSON files (<tt>*.json</tt>)
1149
+ # recursively found in +path+.
1150
+ #
1151
+ # It is expected that the JSON objects will be an array of hash objects.
1152
+ # The JSON format is the registry format for the MIME types registry
1153
+ # shipped with the mime-types library.
1154
+ #
1155
+ # source://mime-types//lib/mime/types/loader.rb#59
1156
+ def load_json; end
1157
+
1158
+ # Loads a MIME::Types registry from YAML files (<tt>*.yml</tt> or
1159
+ # <tt>*.yaml</tt>) recursively found in +path+.
1160
+ #
1161
+ # It is expected that the YAML objects contained within the registry array
1162
+ # will be tagged as <tt>!ruby/object:MIME::Type</tt>.
1163
+ #
1164
+ # Note that the YAML format is about 2½ times *slower* than the JSON format.
1165
+ #
1166
+ # NOTE: The purpose of this format is purely for maintenance reasons.
1167
+ #
1168
+ # source://mime-types//lib/mime/types/loader.rb#46
1169
+ def load_yaml; end
1170
+
1171
+ # The path that will be read for the MIME::Types files.
1172
+ #
1173
+ # source://mime-types//lib/mime/types/loader.rb#24
1174
+ def path; end
1175
+
1176
+ private
1177
+
1178
+ # source://mime-types//lib/mime/types/loader.rb#156
1179
+ def columnar_path; end
1180
+
1181
+ # source://mime-types//lib/mime/types/loader.rb#152
1182
+ def json_path; end
1183
+
1184
+ # source://mime-types//lib/mime/types/loader.rb#148
1185
+ def yaml_path; end
1186
+
1187
+ class << self
1188
+ # Loads the default MIME::Type registry.
1189
+ #
1190
+ # source://mime-types//lib/mime/types/loader.rb#92
1191
+ def load(options = T.unsafe(nil)); end
1192
+
1193
+ # Loads MIME::Types from a single JSON file.
1194
+ #
1195
+ # It is expected that the JSON objects will be an array of hash objects.
1196
+ # The JSON format is the registry format for the MIME types registry
1197
+ # shipped with the mime-types library.
1198
+ #
1199
+ # source://mime-types//lib/mime/types/loader.rb#126
1200
+ def load_from_json(filename); end
1201
+
1202
+ # Loads MIME::Types from a single YAML file.
1203
+ #
1204
+ # It is expected that the YAML objects contained within the registry
1205
+ # array will be tagged as <tt>!ruby/object:MIME::Type</tt>.
1206
+ #
1207
+ # Note that the YAML format is about 2½ times *slower* than the JSON
1208
+ # format.
1209
+ #
1210
+ # NOTE: The purpose of this format is purely for maintenance reasons.
1211
+ #
1212
+ # source://mime-types//lib/mime/types/loader.rb#105
1213
+ def load_from_yaml(filename); end
1214
+
1215
+ private
1216
+
1217
+ # @return [Boolean]
1218
+ #
1219
+ # source://mime-types//lib/mime/types/loader.rb#137
1220
+ def old_yaml?; end
1221
+
1222
+ # source://mime-types//lib/mime/types/loader.rb#133
1223
+ def read_file(filename); end
1224
+ end
1225
+ end
1226
+
1227
+ # The release version of Ruby MIME::Types
1228
+ #
1229
+ # source://mime-types//lib/mime/types.rb#70
1230
+ MIME::Types::VERSION = T.let(T.unsafe(nil), String)
1231
+
1232
+ # source://mime-types//lib/mime/types/logger.rb#15
1233
+ class MIME::Types::WarnLogger < ::Logger
1234
+ # @return [WarnLogger] a new instance of WarnLogger
1235
+ #
1236
+ # source://mime-types//lib/mime/types/logger.rb#28
1237
+ def initialize(_one, _two = T.unsafe(nil), _three = T.unsafe(nil)); end
1238
+ end
1239
+
1240
+ # source://mime-types//lib/mime/types/logger.rb#16
1241
+ class MIME::Types::WarnLogger::WarnLogDevice < ::Logger::LogDevice
1242
+ # @return [WarnLogDevice] a new instance of WarnLogDevice
1243
+ #
1244
+ # source://mime-types//lib/mime/types/logger.rb#17
1245
+ def initialize(*_arg0); end
1246
+
1247
+ # source://mime-types//lib/mime/types/logger.rb#24
1248
+ def close; end
1249
+
1250
+ # source://mime-types//lib/mime/types/logger.rb#20
1251
+ def write(m); end
1252
+ end