Skip to content

Commit 18b6b5e

Browse files
committed
Add chemical as a known primary Content-Type in CYI#to_s.
Preparation for importing the Chemical MIME project's `shared-mime-info` package pending ohler55/ox#280 (totally no rush lol) Minor re-wording to reflect the fact that not all primary types are IANA-approved.
1 parent e5f9f84 commit 18b6b5e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

CHECKING-YOU-OUT/lib/checking-you-out/auslandsgesprach.rb

+8-8
Original file line numberDiff line numberDiff line change
@@ -186,18 +186,18 @@ def from_ietf_media_type(ietf_string)
186186

187187
# CYI instance-level components.
188188
module ::CHECKING::YOU::IN::INLANDGESPRÄCH
189-
# Non-IETF-tree as a CY(I|O)'s `kingdom` signifies the need for a leading `vnd.` facet
190-
# when reconstructing the Media-Type String.
191-
IETF_TREES = [
192-
# Current top-level registries are shown here: https://www.iana.org/assignments/media-types/media-types.xhtml
193-
# The latest addition reflected here is `font` from RFC 8081: https://datatracker.ietf.org/doc/html/rfc8081
189+
# An unknown primary-type as a `CY(I|O)`'s `:kingdom` signifies the need for
190+
# a leading `vnd.` facet when reconstructing the Media-Type `String`.
191+
PRIMARY_CONTENT_TYPES = [
192+
# Current top-level IANA registries are shown here: https://www.iana.org/assignments/media-types/media-types.xhtml
194193
-'application',
195194
-'audio',
195+
-'chemical', # Non-IANA Chemical MIME project: https://www.ch.ic.ac.uk/chemime/
196196
-'example',
197-
-'font',
197+
-'font', # RFC 8081: https://datatracker.ietf.org/doc/html/rfc8081
198198
-'image',
199199
-'message',
200-
-'model',
200+
-'model', # RFC 2077: https://datatracker.ietf.org/doc/html/rfc2077
201201
-'multipart',
202202
-'text',
203203
-'video',
@@ -213,7 +213,7 @@ def to_s
213213
when self.kingdom == -'prs' then -'prs.'
214214
when self.kingdom == -'vnd' then -'vnd.'
215215
when self.kingdom == -'possum' then nil.to_s
216-
when !IETF_TREES.include?(self.kingdom.to_s) then 'vnd.' << self.kingdom.to_s << -'.'
216+
when !PRIMARY_CONTENT_TYPES.include?(self.kingdom.to_s) then 'vnd.' << self.kingdom.to_s << -'.'
217217
else self.kingdom.to_s << -'.'
218218
end << self.genus.to_s)
219219
end

0 commit comments

Comments
 (0)