summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--History.rdoc4
-rw-r--r--README.rdoc2
-rw-r--r--lib/mime/types.rb15
-rw-r--r--mime-types.gemspec6
4 files changed, 18 insertions, 9 deletions
diff --git a/History.rdoc b/History.rdoc
index 0d3ca9ab75..693a41876d 100644
--- a/History.rdoc
+++ b/History.rdoc
@@ -1,3 +1,7 @@
+== MIME::Types 1.17.2 / 2011-10-25
+* Bug Fixes:
+ * Fixed an issue with Ruby 1.9 and file encoding.
+
== MIME::Types 1.17.1 / 2011-10-23
* Minor Enhancements:
* Implemented modern 'hoe' semantics.
diff --git a/README.rdoc b/README.rdoc
index 74975a1495..392587eaaf 100644
--- a/README.rdoc
+++ b/README.rdoc
@@ -3,7 +3,7 @@
== Description
This library allows for the identification of a file's likely MIME content
-type. This is release 1.17.1. The identification of MIME content type is based
+type. This is release 1.17.2. The identification of MIME content type is based
on a file's filename extensions.
MIME::Types for Ruby originally based on and synchronized with MIME::Types for
diff --git a/lib/mime/types.rb b/lib/mime/types.rb
index 6b925769c8..330aded5f6 100644
--- a/lib/mime/types.rb
+++ b/lib/mime/types.rb
@@ -1,4 +1,4 @@
-# -*- ruby encoding: utf-8
+# -*- ruby encoding: utf-8 -*-
# The namespace for MIME applications, tools, and libraries.
module MIME
@@ -24,7 +24,7 @@ module MIME
# puts MIME::Type.simplified('x-appl/x-zip') # => 'appl/zip'
#
class Type
- VERSION = '1.17.1'
+ VERSION = '1.17.2'
include Comparable
@@ -566,7 +566,7 @@ module MIME
# = Author
# Copyright:: Copyright (c) 2002 - 2009 by Austin Ziegler
# <austin@rubyforge.org>
- # Version:: 1.17.1
+ # Version:: 1.17.2
# Based On:: Perl
# MIME::Types[http://search.cpan.org/author/MARKOV/MIME-Types-1.27/MIME/Types.pm],
# Copyright (c) 2001 - 2009 by Mark Overmeer
@@ -577,7 +577,7 @@ module MIME
#
class Types
# The released version of Ruby MIME::Types
- VERSION = '1.17.1'
+ VERSION = '1.17.2'
# The data version.
attr_reader :data_version
@@ -752,7 +752,12 @@ module MIME
# more information that's available, though, the richer the values that can
# be provided.
def load_from_file(filename) #:nodoc:
- data = File.open(filename) { |f| f.read }.split($/)
+ if defined? ::Encoding
+ data = File.open(filename, 'r:UTF-8') { |f| f.read }
+ else
+ data = File.open(filename) { |f| f.read }
+ end
+ data = data.split($/)
mime = MIME::Types.new
data.each_with_index { |line, index|
item = line.chomp.strip.gsub(%r{#.*}o, '')
diff --git a/mime-types.gemspec b/mime-types.gemspec
index 9c19cb82b4..1b659c4ecd 100644
--- a/mime-types.gemspec
+++ b/mime-types.gemspec
@@ -2,12 +2,12 @@
Gem::Specification.new do |s|
s.name = "mime-types"
- s.version = "1.17.1"
+ s.version = "1.17.2"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Austin Ziegler"]
- s.date = "2011-10-24"
- s.description = "This library allows for the identification of a file's likely MIME content\ntype. This is release 1.17.1. The identification of MIME content type is based\non a file's filename extensions.\n\nMIME::Types for Ruby originally based on and synchronized with MIME::Types for\nPerl by Mark Overmeer, copyright 2001 - 2009. As of version 1.15, the data\nformat for the MIME::Type list has changed and the synchronization will no\nlonger happen.\n\nHomepage:: http://mime-types.rubyforge.org/\nGitHub:: http://github.com/halostatue/mime-types/\nCopyright:: 2002 - 2011, Austin Ziegler\n Based in part on prior work copyright Mark Overmeer\n\n:include: License.rdoc"
+ s.date = "2011-10-25"
+ s.description = "This library allows for the identification of a file's likely MIME content\ntype. This is release 1.17.2. The identification of MIME content type is based\non a file's filename extensions.\n\nMIME::Types for Ruby originally based on and synchronized with MIME::Types for\nPerl by Mark Overmeer, copyright 2001 - 2009. As of version 1.15, the data\nformat for the MIME::Type list has changed and the synchronization will no\nlonger happen.\n\nHomepage:: http://mime-types.rubyforge.org/\nGitHub:: http://github.com/halostatue/mime-types/\nCopyright:: 2002 - 2011, Austin Ziegler\n Based in part on prior work copyright Mark Overmeer\n\n:include: License.rdoc"
s.email = ["austin@rubyforge.org"]
s.extra_rdoc_files = ["Manifest.txt", "type-lists/application.txt", "type-lists/audio.txt", "type-lists/image.txt", "type-lists/message.txt", "type-lists/model.txt", "type-lists/multipart.txt", "type-lists/text.txt", "type-lists/video.txt", "History.rdoc", "License.rdoc", "README.rdoc"]
s.files = [".hoerc", "History.rdoc", "Licence.rdoc", "Manifest.txt", "README.rdoc", "Rakefile", "lib/mime/types.rb", "lib/mime/types/application", "lib/mime/types/application.mac", "lib/mime/types/application.nonstandard", "lib/mime/types/application.obsolete", "lib/mime/types/audio", "lib/mime/types/audio.nonstandard", "lib/mime/types/audio.obsolete", "lib/mime/types/image", "lib/mime/types/image.nonstandard", "lib/mime/types/image.obsolete", "lib/mime/types/message", "lib/mime/types/message.obsolete", "lib/mime/types/model", "lib/mime/types/multipart", "lib/mime/types/multipart.nonstandard", "lib/mime/types/multipart.obsolete", "lib/mime/types/other.nonstandard", "lib/mime/types/text", "lib/mime/types/text.nonstandard", "lib/mime/types/text.obsolete", "lib/mime/types/text.vms", "lib/mime/types/video", "lib/mime/types/video.nonstandard", "lib/mime/types/video.obsolete", "mime-types.gemspec", "test/test_mime_type.rb", "test/test_mime_types.rb", "type-lists/application.txt", "type-lists/audio.txt", "type-lists/image.txt", "type-lists/message.txt", "type-lists/model.txt", "type-lists/multipart.txt", "type-lists/text.txt", "type-lists/video.txt", "License.rdoc", ".gemtest"]