diff options
author | Austin Ziegler <austin@zieglers.ca> | 2021-12-17 11:41:28 -0500 |
---|---|---|
committer | Austin Ziegler <austin@zieglers.ca> | 2023-02-16 22:06:37 -0500 |
commit | cc5cc34b8c31a002f5b68666b04338185bfff927 (patch) | |
tree | c91960f631d18375924e9768685b6174db244a07 | |
parent | e0a9901a7ea627eef143e6d2dd6db3f1ff63b905 (diff) | |
download | mime-types-cc5cc34b8c31a002f5b68666b04338185bfff927.tar.gz |
Apply standard formatting to the Ruby code in comments
-rw-r--r-- | lib/mime/type.rb | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/lib/mime/type.rb b/lib/mime/type.rb index 29d7e1e..f9ae664 100644 --- a/lib/mime/type.rb +++ b/lib/mime/type.rb @@ -9,17 +9,17 @@ require "mime/types/deprecations" # The definition of one MIME content-type. # # == Usage -# require 'mime/types' +# require "mime/types" # -# plaintext = MIME::Types['text/plain'] # => [ text/plain ] +# plaintext = MIME::Types["text/plain"] # => [ text/plain ] # text = plaintext.first -# puts text.media_type # => 'text' -# puts text.sub_type # => 'plain' +# puts text.media_type # => "text" +# puts text.sub_type # => "plain" # -# puts text.extensions.join(' ') # => 'txt asc c cc h hh cpp hpp dat hlp' -# puts text.preferred_extension # => 'txt' -# puts text.friendly # => 'Text Document' -# puts text.i18n_key # => 'text.plain' +# puts text.extensions.join(" ") # => "txt asc c cc h hh cpp hpp dat hlp" +# puts text.preferred_extension # => "txt" +# puts text.friendly # => "Text Document" +# puts text.i18n_key # => "text.plain" # # puts text.encoding # => quoted-printable # puts text.default_encoding # => quoted-printable @@ -30,42 +30,42 @@ require "mime/types/deprecations" # puts text.provisional? # => false # puts text.complete? # => true # -# puts text # => 'text/plain' +# puts text # => "text/plain" # -# puts text == 'text/plain' # => true -# puts 'text/plain' == text # => true -# puts text == 'text/x-plain' # => false -# puts 'text/x-plain' == text # => false +# puts text == "text/plain" # => true +# puts "text/plain" == text # => true +# puts text == "text/x-plain" # => false +# puts "text/x-plain" == text # => false # -# puts MIME::Type.simplified('x-appl/x-zip') # => 'x-appl/x-zip' -# puts MIME::Type.i18n_key('x-appl/x-zip') # => 'x-appl.x-zip' +# puts MIME::Type.simplified("x-appl/x-zip") # => "x-appl/x-zip" +# puts MIME::Type.i18n_key("x-appl/x-zip") # => "x-appl.x-zip" # -# puts text.like?('text/x-plain') # => true -# puts text.like?(MIME::Type.new('x-text/x-plain')) # => true +# puts text.like?("text/x-plain") # => true +# puts text.like?(MIME::Type.new("content-type" => "x-text/x-plain")) # => true # # puts text.xrefs.inspect # => { "rfc" => [ "rfc2046", "rfc3676", "rfc5147" ] } # puts text.xref_urls # => [ "http://www.iana.org/go/rfc2046", # # "http://www.iana.org/go/rfc3676", # # "http://www.iana.org/go/rfc5147" ] # -# xtext = MIME::Type.new('x-text/x-plain') -# puts xtext.media_type # => 'text' -# puts xtext.raw_media_type # => 'x-text' -# puts xtext.sub_type # => 'plain' -# puts xtext.raw_sub_type # => 'x-plain' +# xtext = MIME::Type.new("x-text/x-plain") +# puts xtext.media_type # => "text" +# puts xtext.raw_media_type # => "x-text" +# puts xtext.sub_type # => "plain" +# puts xtext.raw_sub_type # => "x-plain" # puts xtext.complete? # => false # -# puts MIME::Types.any? { |type| type.content_type == 'text/plain' } # => true +# puts MIME::Types.any? { |type| type.content_type == "text/plain" } # => true # puts MIME::Types.all?(&:registered?) # => false # # # Various string representations of MIME types -# qcelp = MIME::Types['audio/QCELP'].first # => audio/QCELP -# puts qcelp.content_type # => 'audio/QCELP' -# puts qcelp.simplified # => 'audio/qcelp' +# qcelp = MIME::Types["audio/QCELP"].first # => audio/QCELP +# puts qcelp.content_type # => "audio/QCELP" +# puts qcelp.simplified # => "audio/qcelp" # -# xwingz = MIME::Types['application/x-Wingz'].first # => application/x-Wingz -# puts xwingz.content_type # => 'application/x-Wingz' -# puts xwingz.simplified # => 'application/x-wingz' +# xwingz = MIME::Types["application/x-Wingz"].first # => application/x-Wingz +# puts xwingz.content_type # => "application/x-Wingz" +# puts xwingz.simplified # => "application/x-wingz" class MIME::Type # Reflects a MIME content-type specification that is not correctly # formatted (it isn't +type+/+subtype+). @@ -112,7 +112,7 @@ class MIME::Type :ASCII_ENCODINGS # Builds a MIME::Type object from the +content_type+, a MIME Content Type - # value (e.g., 'text/plain' or 'application/x-eruby'). The constructed object + # value (e.g., "text/plain" or "application/x-eruby"). The constructed object # is yielded to an optional block for additional configuration, such as # associating extensions and encoding information. # @@ -336,7 +336,7 @@ class MIME::Type # provided is invalid. # # If the encoding is not provided on construction, this will be either - # 'quoted-printable' (for text/* media types) and 'base64' for eveything + # "quoted-printable" (for text/* media types) and "base64" for eveything # else. # # :attr_accessor: encoding @@ -394,7 +394,7 @@ class MIME::Type # # call-seq: # text_plain.friendly # => "Text File" - # text_plain.friendly('en') # => "Text File" + # text_plain.friendly("en") # => "Text File" def friendly(lang = "en") @friendly ||= {} @@ -503,7 +503,7 @@ class MIME::Type # Returns the MIME::Type as a string for implicit conversions. This allows # MIME::Type objects to appear on either side of a comparison. # - # 'text/plain' == MIME::Type.new('text/plain') + # "text/plain" == MIME::Type.new("content-type" => "text/plain") def to_str content_type end |