summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Ziegler <austin@zieglers.ca>2014-10-07 13:33:53 -0400
committerAustin Ziegler <austin@zieglers.ca>2014-10-07 13:33:53 -0400
commit93ebfdb48fe4e888b851fe74b511d02cf1b45f50 (patch)
tree372d7296ba5eefad95739e31b5fc41d09b889747
parentdc89943a692ada680767c16428a99ce59745613a (diff)
downloadmime-types-2.4.1.tar.gz
Release mime-types 2.4.1 on test pass.v2.4.1
-rw-r--r--Manifest.txt1
-rw-r--r--README.rdoc33
-rw-r--r--lib/mime/type.rb2
-rw-r--r--mime-types.gemspec8
4 files changed, 30 insertions, 14 deletions
diff --git a/Manifest.txt b/Manifest.txt
index aa8c2f4..e5bbc93 100644
--- a/Manifest.txt
+++ b/Manifest.txt
@@ -26,6 +26,7 @@ support/apache_mime_types.rb
support/benchmarks/load.rb
support/convert.rb
support/iana_registry.rb
+test/bad-fixtures/malformed
test/fixture/json.json
test/fixture/old-data
test/fixture/yaml.yaml
diff --git a/README.rdoc b/README.rdoc
index 130ac1b..7da7e75 100644
--- a/README.rdoc
+++ b/README.rdoc
@@ -24,12 +24,25 @@ add additional type definitions (see Contributing.rdoc). The primary sources
for MIME type definitions found in mime-types is the IANA collection of
registrations (see below for the link), RFCs, and W3C recommendations.
-This is release 2.2, mostly changing how the MIME type registry is updated from
-the IANA registry (the format of which was incompatibly changed shortly before
-this release) and taking advantage of the extra data available from IANA
-registry in the form of MIME::Type#xrefs. In addition, the {LTSW
-list}[http://www.ltsw.se/knbase/internet/mime.htp] has been dropped as a
-supported list.
+This is release 2.4.1 (2.4 was pulled), fixing a bug in observed use of the
+mime-types library where extensions were not previously sorted, such that
+
+ MIME::Types.of('image.jpg').first.extensions.first
+
+returned a value of +jpeg+ in mime-types 1, but +jpe+ in mime-types 2. This was
+introduced because extensions were sorted during assignment
+(MIME::Type#extensions=). This behaviour has been reverted to protect clients
+that work as noted above. The preferred way to express this is the new method:
+
+ MIME::Type.of('image.jpg').first.preferred_extension
+
+Łukasz Śliwa created the
+{friendly_mime}[https://github.com/lukaszsliwa/friendly_mime] gem, which offers
+friendly descriptive names for MIME types. This functionality and
+English-language data has been added to mime-types as MIME::Type#friendly. To
+make it easy for internationalization, MIME::Type#i18n_key has been added,
+which will return a key suitable for use with the
+{I18n}[https://github.com/svenfuchs/i18n] library.
As a reminder, mime-types 2.x is no longer compatible with Ruby 1.8 and
mime-types 1.x is only being maintained for security issues. No new MIME types
@@ -49,13 +62,14 @@ files). A MIME::Type stores the known information about one MIME type.
require 'mime/types'
- plaintext = MIME::Types['text/plain']
- # returns [text/plain, text/plain]
- text = plaintext.first
+ plaintext = MIME::Types['text/plain'] # => [ text/plain ]
+ text = plaintext.first
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.friendly # => 'Text Document'
+ puts text.i18n_key # => 'text.plain'
puts text.encoding # => quoted-printable
puts text.binary? # => false
@@ -63,6 +77,7 @@ files). A MIME::Type stores the known information about one MIME type.
puts text.obsolete? # => false
puts text.registered? # => true
puts text == 'text/plain' # => true
+ puts 'text/plain' == text # => true
puts MIME::Type.simplified('x-appl/x-zip')
# => 'appl/zip'
diff --git a/lib/mime/type.rb b/lib/mime/type.rb
index d392e50..5314f74 100644
--- a/lib/mime/type.rb
+++ b/lib/mime/type.rb
@@ -57,7 +57,7 @@ class MIME::Type
end
# The released version of the mime-types library.
- VERSION = '2.4'
+ VERSION = '2.4.1'
include Comparable
diff --git a/mime-types.gemspec b/mime-types.gemspec
index 3cf40d9..e04ff16 100644
--- a/mime-types.gemspec
+++ b/mime-types.gemspec
@@ -1,18 +1,18 @@
# -*- encoding: utf-8 -*-
-# stub: mime-types 2.4 ruby lib
+# stub: mime-types 2.4.1 ruby lib
Gem::Specification.new do |s|
s.name = "mime-types"
- s.version = "2.4"
+ s.version = "2.4.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib"]
s.authors = ["Austin Ziegler"]
s.date = "2014-10-07"
- s.description = "The mime-types library provides a library and registry for information about\nMIME content type definitions. It can be used to determine defined filename\nextensions for MIME types, or to use filename extensions to look up the likely\nMIME type definitions.\n\nMIME content types are used in MIME-compliant communications, as in e-mail or\nHTTP traffic, to indicate the type of content which is transmitted. The\nmime-types library provides the ability for detailed information about MIME\nentities (provided as an enumerable collection of MIME::Type objects) to be\ndetermined and used programmatically. There are many types defined by RFCs and\nvendors, so the list is long but by definition incomplete; don't hesitate to to\nadd additional type definitions (see Contributing.rdoc). The primary sources\nfor MIME type definitions found in mime-types is the IANA collection of\nregistrations (see below for the link), RFCs, and W3C recommendations.\n\nThis is release 2.2, mostly changing how the MIME type registry is updated from\nthe IANA registry (the format of which was incompatibly changed shortly before\nthis release) and taking advantage of the extra data available from IANA\nregistry in the form of MIME::Type#xrefs. In addition, the {LTSW\nlist}[http://www.ltsw.se/knbase/internet/mime.htp] has been dropped as a\nsupported list.\n\nAs a reminder, mime-types 2.x is no longer compatible with Ruby 1.8 and\nmime-types 1.x is only being maintained for security issues. No new MIME types\nor features will be added.\n\nmime-types (previously called MIME::Types for Ruby) was originally based on\nMIME::Types for Perl by Mark Overmeer, copyright 2001 - 2009. It is built to\nconform to the MIME types of RFCs 2045 and 2231. It tracks the {IANA Media\nTypes registry}[https://www.iana.org/assignments/media-types/media-types.xhtml]\nwith some types added by the users of mime-types."
+ s.description = "The mime-types library provides a library and registry for information about\nMIME content type definitions. It can be used to determine defined filename\nextensions for MIME types, or to use filename extensions to look up the likely\nMIME type definitions.\n\nMIME content types are used in MIME-compliant communications, as in e-mail or\nHTTP traffic, to indicate the type of content which is transmitted. The\nmime-types library provides the ability for detailed information about MIME\nentities (provided as an enumerable collection of MIME::Type objects) to be\ndetermined and used programmatically. There are many types defined by RFCs and\nvendors, so the list is long but by definition incomplete; don't hesitate to to\nadd additional type definitions (see Contributing.rdoc). The primary sources\nfor MIME type definitions found in mime-types is the IANA collection of\nregistrations (see below for the link), RFCs, and W3C recommendations.\n\nThis is release 2.4.1 (2.4 was pulled), fixing a bug in observed use of the\nmime-types library where extensions were not previously sorted, such that\n\n MIME::Types.of('image.jpg').first.extensions.first\n\nreturned a value of +jpeg+ in mime-types 1, but +jpe+ in mime-types 2. This was\nintroduced because extensions were sorted during assignment\n(MIME::Type#extensions=). This behaviour has been reverted to protect clients\nthat work as noted above. The preferred way to express this is the new method:\n\n MIME::Type.of('image.jpg').first.preferred_extension\n\n\u{141}ukasz \u{15a}liwa created the\n{friendly_mime}[https://github.com/lukaszsliwa/friendly_mime] gem, which offers\nfriendly descriptive names for MIME types. This functionality and\nEnglish-language data has been added to mime-types as MIME::Type#friendly. To\nmake it easy for internationalization, MIME::Type#i18n_key has been added,\nwhich will return a key suitable for use with the\n{I18n}[https://github.com/svenfuchs/i18n] library.\n\nAs a reminder, mime-types 2.x is no longer compatible with Ruby 1.8 and\nmime-types 1.x is only being maintained for security issues. No new MIME types\nor features will be added.\n\nmime-types (previously called MIME::Types for Ruby) was originally based on\nMIME::Types for Perl by Mark Overmeer, copyright 2001 - 2009. It is built to\nconform to the MIME types of RFCs 2045 and 2231. It tracks the {IANA Media\nTypes registry}[https://www.iana.org/assignments/media-types/media-types.xhtml]\nwith some types added by the users of mime-types."
s.email = ["halostatue@gmail.com"]
s.extra_rdoc_files = ["Contributing.rdoc", "History-Types.rdoc", "History.rdoc", "Licence.rdoc", "Manifest.txt", "README.rdoc", "docs/COPYING.txt", "docs/artistic.txt", "Contributing.rdoc", "History-Types.rdoc", "History.rdoc", "Licence.rdoc", "README.rdoc"]
- s.files = [".autotest", ".coveralls.yml", ".gemtest", ".hoerc", ".minitest.rb", ".travis.yml", "Contributing.rdoc", "Gemfile", "History-Types.rdoc", "History.rdoc", "Licence.rdoc", "Manifest.txt", "README.rdoc", "Rakefile", "data/mime-types.json", "docs/COPYING.txt", "docs/artistic.txt", "lib/mime-types.rb", "lib/mime.rb", "lib/mime/type.rb", "lib/mime/types.rb", "lib/mime/types/cache.rb", "lib/mime/types/loader.rb", "lib/mime/types/loader_path.rb", "support/apache_mime_types.rb", "support/benchmarks/load.rb", "support/convert.rb", "support/iana_registry.rb", "test/fixture/json.json", "test/fixture/old-data", "test/fixture/yaml.yaml", "test/minitest_helper.rb", "test/test_mime_type.rb", "test/test_mime_types.rb", "test/test_mime_types_cache.rb", "test/test_mime_types_class.rb", "test/test_mime_types_lazy.rb", "test/test_mime_types_loader.rb"]
+ s.files = [".autotest", ".coveralls.yml", ".gemtest", ".hoerc", ".minitest.rb", ".travis.yml", "Contributing.rdoc", "Gemfile", "History-Types.rdoc", "History.rdoc", "Licence.rdoc", "Manifest.txt", "README.rdoc", "Rakefile", "data/mime-types.json", "docs/COPYING.txt", "docs/artistic.txt", "lib/mime-types.rb", "lib/mime.rb", "lib/mime/type.rb", "lib/mime/types.rb", "lib/mime/types/cache.rb", "lib/mime/types/loader.rb", "lib/mime/types/loader_path.rb", "support/apache_mime_types.rb", "support/benchmarks/load.rb", "support/convert.rb", "support/iana_registry.rb", "test/bad-fixtures/malformed", "test/fixture/json.json", "test/fixture/old-data", "test/fixture/yaml.yaml", "test/minitest_helper.rb", "test/test_mime_type.rb", "test/test_mime_types.rb", "test/test_mime_types_cache.rb", "test/test_mime_types_class.rb", "test/test_mime_types_lazy.rb", "test/test_mime_types_loader.rb"]
s.homepage = "https://github.com/halostatue/mime-types/"
s.licenses = ["MIT", "Artistic 2.0", "GPL-2"]
s.rdoc_options = ["--main", "README.rdoc"]