Skip to content

Commit

Permalink
Add chemical as a known primary Content-Type in CYI#to_s.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
okeeblow committed Sep 3, 2021
1 parent 4002552 commit 2d8d51e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions CHECKING-YOU-OUT/lib/checking-you-out/auslandsgesprach.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,18 @@ def from_ietf_media_type(ietf_string)

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

0 comments on commit 2d8d51e

Please sign in to comment.