Hello community,
here is the log from the commit of package rubygem-mime-types for
openSUSE:Factory checked in at 2015-02-10 20:22:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-mime-types (Old)
and /work/SRC/openSUSE:Factory/.rubygem-mime-types.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-mime-types"
Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-mime-types/rubygem-mime-types.changes
2014-10-18 09:09:55.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.rubygem-mime-types.new/rubygem-mime-types.changes
2015-02-10 20:22:29.000000000 +0100
@@ -1,0 +2,23 @@
+Mon Feb 9 06:58:25 UTC 2015 - [email protected]
+
+- updated to version 2.4.3
+ * Bugs:
+ * Restored Ruby 1.9.2 support by using +private_constant+ conditionally.
+ Fixes {#77}[https://github.com/halostatue/mime-types/issues/77] found by
+ Kris Leech (@krisleech). The conditional use of +private_constant+ here
+ will be removed for mime-types 3.0, when Ruby 1.9.2 support will be
+ unconditionally removed.
+
+ == 2.4.2 / 2014-10-15
+
+ * Bugs:
+ * Aaron Patterson (@tenderlove) found a loading bug and provided a fix that
+ nearly doubled registry load performance
+ ({#74}[https://github.com/halostatue/mime-types/pull/74]).
+ * Godfrey Chan (@chancancode) provided a prophylactic security fix to use
+ <tt>JSON.parse</tt> instead of <tt>JSON.load</tt> in
+ {#75}[https://github.com/halostatue/mime-types/pull/75]. This provides a
+ 20% improvement over the already improved result, resulting in a total 55%
+ performance boost.
+
+-------------------------------------------------------------------
Old:
----
mime-types-2.4.1.gem
New:
----
mime-types-2.4.3.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-mime-types.spec ++++++
--- /var/tmp/diff_new_pack.v5OrYo/_old 2015-02-10 20:22:30.000000000 +0100
+++ /var/tmp/diff_new_pack.v5OrYo/_new 2015-02-10 20:22:30.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package rubygem-mime-types
#
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -24,7 +24,7 @@
#
Name: rubygem-mime-types
-Version: 2.4.1
+Version: 2.4.3
Release: 0
%define mod_name mime-types
%define mod_full_name %{mod_name}-%{version}
@@ -55,8 +55,12 @@
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.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
+This is release 2.4.3, restoring full compatibility with Ruby 1.9.2 (which
+will
+be dropped in mime-types 3.0). It also includes the performance improvements
+from mime-types 2.4.2 (since yanked because of the broken Ruby 1.9.2 support)
+and the 2.4.1 fix of 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
++++++ mime-types-2.4.1.gem -> mime-types-2.4.3.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Contributing.rdoc new/Contributing.rdoc
--- old/Contributing.rdoc 2014-10-07 19:49:23.000000000 +0200
+++ new/Contributing.rdoc 2014-10-21 16:36:25.000000000 +0200
@@ -109,3 +109,5 @@
* Greg Brockman
* Łukasz Śliwa (for the friendly names)
* Keerthi Siva
+* Aaron Patterson
+* Godfrey Chan
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/History-Types.rdoc new/History-Types.rdoc
--- old/History-Types.rdoc 2014-10-07 19:49:23.000000000 +0200
+++ new/History-Types.rdoc 2014-10-21 16:36:25.000000000 +0200
@@ -1,6 +1,11 @@
= MIME Types Changes by Version
-== 2.4 / 2014-10-07
+== 2.4.2 / 2014-10-15
+* Added application/vnd.ms-outlook as an unregistered MIME type with the
+ extension +msg+. Provided by @keerthisiv in
+ {#72}[https://github.com/halostatue/mime-types/pull/72].
+
+== 2.4.1 / 2014-10-07
* Changed the sort order of many of the extensions to restore behaviour
from mime-types 1.25.1.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/History.rdoc new/History.rdoc
--- old/History.rdoc 2014-10-07 19:49:23.000000000 +0200
+++ new/History.rdoc 2014-10-21 16:36:25.000000000 +0200
@@ -1,4 +1,27 @@
-== 2.4 / 2014-10-07
+== 2.4.3 / 2014-10-21
+
+* Bugs:
+ * Restored Ruby 1.9.2 support by using +private_constant+ conditionally.
+ Fixes {#77}[https://github.com/halostatue/mime-types/issues/77] found by
+ Kris Leech (@krisleech). The conditional use of +private_constant+ here
+ will be removed for mime-types 3.0, when Ruby 1.9.2 support will be
+ unconditionally removed.
+
+== 2.4.2 / 2014-10-15
+
+* Bugs:
+ * Aaron Patterson (@tenderlove) found a loading bug and provided a fix that
+ nearly doubled registry load performance
+ ({#74}[https://github.com/halostatue/mime-types/pull/74]).
+ * Godfrey Chan (@chancancode) provided a prophylactic security fix to use
+ <tt>JSON.parse</tt> instead of <tt>JSON.load</tt> in
+ {#75}[https://github.com/halostatue/mime-types/pull/75]. This provides a
+ 20% improvement over the already improved result, resulting in a total 55%
+ performance boost.
+
+== 2.4.1 / 2014-10-07
+
+mime-types 2.4 was pulled.
* Bugs:
* Restored the extension sort order from mime-types 1.25.1 and modified
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/README.rdoc new/README.rdoc
--- old/README.rdoc 2014-10-07 19:49:23.000000000 +0200
+++ new/README.rdoc 2014-10-21 16:36:25.000000000 +0200
@@ -24,8 +24,11 @@
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.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
+This is release 2.4.3, restoring full compatibility with Ruby 1.9.2 (which will
+be dropped in mime-types 3.0). It also includes the performance improvements
+from mime-types 2.4.2 (since yanked because of the broken Ruby 1.9.2 support)
+and the 2.4.1 fix of 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
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Rakefile new/Rakefile
--- old/Rakefile 2014-10-07 19:49:23.000000000 +0200
+++ new/Rakefile 2014-10-21 16:36:25.000000000 +0200
@@ -109,6 +109,24 @@
end
namespace :convert do
+ namespace :docs do
+ task :setup do
+ gem 'rdoc'
+ require 'rdoc/rdoc'
+ @doc_converter ||= RDoc::Markup::ToMarkdown.new
+ end
+
+ %w(README History History-Types).each do |name|
+ file "#{name}.md" => [ "#{name}.rdoc", :setup ] do |t|
+ File.open(t.name, 'wb') { |target|
+ target.write @doc_converter.convert(IO.read(t.prerequisites.first))
+ }
+ end
+
+ task docs: [ name ]
+ end
+ end
+
namespace :yaml do
desc "Convert from YAML to JSON"
task :json, [ :source, :destination, :multiple_files ] => :support do |t,
args|
Files old/checksums.yaml.gz and new/checksums.yaml.gz differ
Files old/checksums.yaml.gz.sig and new/checksums.yaml.gz.sig differ
Files old/data.tar.gz.sig and new/data.tar.gz.sig differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/mime/type.rb new/lib/mime/type.rb
--- old/lib/mime/type.rb 2014-10-07 19:49:23.000000000 +0200
+++ new/lib/mime/type.rb 2014-10-21 16:36:25.000000000 +0200
@@ -50,18 +50,16 @@
end
def to_s
- "Invalid Encoding #{@encoding.inspect} (valid values are " +
- "#{MIME::Type::VALID_ENCODINGS.inspect})."
+ "Invalid Encoding #{@encoding.inspect} (valid values:
#{VALID_ENCODINGS.inspect})."
end
# :startdoc:
end
# The released version of the mime-types library.
- VERSION = '2.4.1'
+ VERSION = '2.4.3'
include Comparable
- # :stopdoc:
MEDIA_TYPE_RE = %r{([-\w.+]+)/([-\w.+]*)}o
UNREGISTERED_RE = %r{[Xx]-}o
I18N_RE = %r{[^[:alnum:]]}o
@@ -76,7 +74,12 @@
RFC_URL = "http://rfc-editor.org/rfc/rfc%s.txt"
DRAFT_URL =
"http://datatracker.ietf.org/public/idindex.cgi?command=id_details&filename=%s"
CONTACT_URL = "http://www.iana.org/assignments/contact-people.htm#%s"
- # :startdoc:
+
+ if respond_to? :private_constant
+ private_constant :MEDIA_TYPE_RE, :UNREGISTERED_RE, :I18N_RE, :PLATFORM_RE,
+ :DEFAULT_ENCODINGS, :BINARY_ENCODINGS, :TEXT_ENCODINGS, :VALID_ENCODINGS,
+ :IANA_URL, :RFC_URL, :DRAFT_URL, :CONTACT_URL
+ end
# Builds a MIME::Type object from the provided MIME Content Type value
# (e.g., 'text/plain' or 'applicaton/x-eruby'). The constructed object is
@@ -157,13 +160,13 @@
def priority_compare(other)
pc = simplified <=> other.simplified
if pc.zero?
- pc = if ((reg = registered?) != other.registered?)
+ pc = if (reg = registered?) != other.registered?
reg ? -1 : 1 # registered < unregistered
- elsif ((plat = platform?(true)) != other.platform?(true))
+ elsif (plat = platform?(true)) != other.platform?(true)
plat ? 1 : -1 # generic < platform
- elsif ((comp = complete?) != other.complete?)
+ elsif (comp = complete?) != other.complete?
comp ? -1 : 1 # complete < incomplete
- elsif ((obs = obsolete?) != other.obsolete?)
+ elsif (obs = obsolete?) != other.obsolete?
obs ? 1 : -1 # current < obsolete
elsif obs and ((ui = use_instead) != (oui = other.use_instead))
if ui.nil?
@@ -275,6 +278,7 @@
MIME.deprecated(self, __method__)
@system
end
+
def system=(os) # :nodoc:
if os.nil? or os.kind_of?(Regexp)
@system = os
@@ -302,6 +306,7 @@
def obsolete?
!!@obsolete
end
+
def obsolete=(v) # :nodoc:
@obsolete = !!v
end
@@ -324,6 +329,8 @@
@friendly.merge!(Hash[*lang])
when Hash
@friendly.merge!(lang)
+ else
+ raise ArgumentError
end
end
@@ -352,6 +359,7 @@
MIME.deprecated(self, __method__, "and has been renamed to #references")
references
end
+
def url=(r) # :nodoc:
MIME.deprecated(self, __method__)
self.references = r
@@ -425,7 +433,7 @@
values.map { |data|
"http://www.iana.org/assignments/media-types/#{data}"
}
- when 'uri', 'text'
+ else # 'uri', 'text', etc.
values
end
}.flatten
@@ -449,6 +457,7 @@
!!@registered
end
end
+
def registered=(v) # :nodoc:
@registered = v.nil? ? v : !!v
end
@@ -472,6 +481,7 @@
def signature?
!!@signature
end
+
def signature=(v) # :nodoc:
@signature = !!v
end
@@ -550,7 +560,9 @@
encode_with({})
end
- # :stopdoc:
+ # Populates the +coder+ with attributes about this record for
+ # serialization. The structure of +coder+ should match the structure used
+ # with #init_with.
def encode_with(coder)
coder['content-type'] = @content_type
coder['docs'] = @docs unless @docs.nil? or @docs.empty?
@@ -569,6 +581,8 @@
coder
end
+ # Initialize an empty object from +coder+, which must contain the
+ # attributes necessary for initializing an empty object.
def init_with(coder)
self.content_type = coder['content-type']
self.docs = coder['docs'] || []
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/mime/types/loader.rb new/lib/mime/types/loader.rb
--- old/lib/mime/types/loader.rb 2014-10-07 19:49:23.000000000 +0200
+++ new/lib/mime/types/loader.rb 2014-10-21 16:36:25.000000000 +0200
@@ -56,9 +56,7 @@
# This method is aliased to #load.
def load_json
Dir[json_path].sort.each do |f|
- types = self.class.load_from_json(f).map { |type|
- MIME::Type.new(type)
- }
+ types = self.class.load_from_json(f)
container.add(*types, :silent)
end
container
@@ -79,6 +77,7 @@
container
end
+ # Raised when a V1 format file is discovered.
BadV1Format = Class.new(Exception)
class << self
@@ -131,7 +130,7 @@
item = line.chomp.strip
next if item.empty?
- m = MIME::Types::Loader::V1_FORMAT.match(item)
+ m = V1_FORMAT.match(item)
unless m
warn <<-EOS
@@ -142,7 +141,7 @@
end
unregistered, obsolete, platform, mediatype, subtype, extensions,
- encoding, urls, docs, comment = *m.captures
+ encoding, urls, docs, _ = *m.captures
next if mediatype.nil?
@@ -198,7 +197,7 @@
# shipped with the mime-types library.
def load_from_json(filename)
require 'json'
- JSON.load(read_file(filename)).map { |type| MIME::Type.new(type) }
+ JSON.parse(read_file(filename)).map { |type| MIME::Type.new(type) }
end
private
@@ -222,18 +221,20 @@
# The regular expression used to match a v1-format file-based MIME type
# definition.
- MIME::Types::Loader::V1_FORMAT = # :nodoc:
+ V1_FORMAT = # :nodoc:
%r{\A\s*
- ([*])? # 0: Unregistered?
- (!)? # 1: Obsolete?
- (?:(\w+):)? # 2: Platform marker
- #{MIME::Type::MEDIA_TYPE_RE}? # 3,4: Media type
- (?:\s+@(\S+))? # 5: Extensions
- (?:\s+:(base64|7bit|8bit|quoted\-printable))? # 6: Encoding
- (?:\s+'(\S+))? # 7: URL list
- (?:\s+=(.+))? # 8: Documentation
- (?:\s*([#].*)?)?
+ ([*])? # 0: Unregistered?
+ (!)? # 1: Obsolete?
+ (?:(\w+):)? # 2: Platform marker
+ ([-\w.+]+)/([-\w.+]*) # 3, 4: Media Type
+ (?:\s+@(\S+))? # 5: Extensions
+ (?:\s+:(base64|7bit|8bit|quoted\-printable))? # 6: Encoding
+ (?:\s+'(\S+))? # 7: URL list
+ (?:\s+=(.+))? # 8: Documentation
+ (?:\s*([#].*)?)? # Comments
\s*
\z
}x
+
+ private_constant :V1_FORMAT if respond_to? :private_constant
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2014-10-07 19:49:23.000000000 +0200
+++ new/metadata 2014-10-21 16:36:25.000000000 +0200
@@ -1,7 +1,7 @@
--- !ruby/object:Gem::Specification
name: mime-types
version: !ruby/object:Gem::Version
- version: 2.4.1
+ version: 2.4.3
platform: ruby
authors:
- Austin Ziegler
@@ -36,7 +36,7 @@
SHkzay9FVEZoaSs3cElVV2xGbzBpbXJkeUxoZCtKdzNib1ZqM0NtdnloY3dt
cG9NMEs5bApBT21yVWlFbFVxTE9aQT09Ci0tLS0tRU5EIENFUlRJRklDQVRF
LS0tLS0K
-date: 2014-10-07 00:00:00.000000000 Z
+date: 2014-10-21 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: minitest
@@ -203,8 +203,11 @@
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
+ is release 2.4.3, restoring full compatibility with Ruby 1.9.2 (which
will\nbe dropped
+ in mime-types 3.0). It also includes the performance improvements\nfrom
mime-types
+ 2.4.2 (since yanked because of the broken Ruby 1.9.2 support)\nand the 2.4.1
fix
+ of a bug in observed use of the mime-types library where\nextensions 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
Files old/metadata.gz.sig and new/metadata.gz.sig differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/support/convert.rb new/support/convert.rb
--- old/support/convert.rb 2014-10-07 19:49:23.000000000 +0200
+++ new/support/convert.rb 2014-10-21 16:36:25.000000000 +0200
@@ -75,8 +75,6 @@
raise ArgumentError, ':from is required'
end
- path = options[:path]
-
@loader = MIME::Types::Loader.new(options[:path])
load_from(options[:from])
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/support/iana_registry.rb new/support/iana_registry.rb
--- old/support/iana_registry.rb 2014-10-07 19:49:23.000000000 +0200
+++ new/support/iana_registry.rb 2014-10-21 16:36:25.000000000 +0200
@@ -52,62 +52,8 @@
def parse
@registry.css('record').each do |record|
- subtype = record.at_css('name').text
- refs = record.css('xref').map do |xref|
- case xref["type"]
- when 'person'
- "[#{xref["data"]}]"
- when 'rfc'
- xref["data"].upcase
- when 'draft'
- "DRAFT:#{xref["data"].sub(/^RFC-/, 'draft-')}"
- when 'rfc-errata'
- "{RFC Errata
#{xref["data"]}=http://www.rfc-editor.org/errata_search.php?eid=#{xref["data"]}}"
- when 'uri'
- # Fix a couple of known-broken links:
- case xref["data"]
- when /contact-people.htmll#Dolan\z/
- "[Dolan]"
- when /contact-people.htmll#Rottmann?\z/
- "[Frank_Rottman]"
- else
- "{#{xref["data"]}}"
- end
- when 'text'
- xref["data"]
- end
- end
-
- xrefs = MIME::Types::Container.new
- record.css('xref').map do |xref|
- type, data = xref["type"], xref["data"]
-
- case type
- when 'uri'
- case data
- when /contact-people.htmll#Dolan\z/
- type, data = "person", "Dolan"
- when /contact-people.htmll#Rottmann?\z/
- type, data = "person", "Frank_Rottman"
- end
- end
-
- xrefs[type] << data
- end
-
- record.css('file').each do |file|
- file_name = if file.text == subtype
- [ @type, subtype ].join('/')
- else
- file.text
- end
-
- if file["type"] == "template"
- refs << (ASSIGNMENT_FILE_REF % [ file_name, file_name ])
- end
-
- xrefs[file["type"]] << file_name
- end
+ subtype = record.at_css('name').text
+ refs, xrefs = parse_refs_and_files(record.css('xref'),
record.css('file'))
content_type = [ @type, subtype ].join('/')
obsolete = record.at_css('obsolete')
@@ -151,4 +97,62 @@
MIME::Types.new
end
end
+
+ def parse_refs_and_files(refs, files)
+ xr = MIME::Types::Container.new
+ r = []
+
+ refs.each do |xref|
+ type, data = xref["type"], xref["data"]
+
+ # Fix some known-broken links that are actually people.
+ if type == 'uri'
+ case data
+ when /contact-people.htmll#Dolan\z/
+ type, data = "person", "Dolan"
+ when /contact-people.htmll#Rottmann?\z/
+ type, data = "person", "Frank_Rottman"
+ else
+ nil # There’s no error with this URI.
+ end
+ end
+
+ r << xref_to_ref(type, data)
+
+ xrefs[type] << data
+ end
+
+ files.each do |file|
+ file_name = if file.text == subtype
+ [ @type, subtype ].join('/')
+ else
+ file.text
+ end
+
+ if file["type"] == "template"
+ refs << (ASSIGNMENT_FILE_REF % [ file_name, file_name ])
+ end
+
+ xrefs[file["type"]] << file_name
+ end
+
+ r, xr
+ end
+
+ def ref_from_type(type, data)
+ case type
+ when 'person'
+ "[#{data}]"
+ when 'rfc'
+ data.upcase
+ when 'draft'
+ "DRAFT:#{data.sub(/^RFC-/, 'draft-')}"
+ when 'rfc-errata'
+ "{RFC Errata
#{data}=http://www.rfc-editor.org/errata_search.php?eid=#{data}}"
+ when 'uri'
+ "{#{data}}"
+ else # 'text' or something else
+ data
+ end
+ end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/test/test_mime_type.rb new/test/test_mime_type.rb
--- old/test/test_mime_type.rb 2014-10-07 19:49:23.000000000 +0200
+++ new/test/test_mime_type.rb 2014-10-21 16:36:25.000000000 +0200
@@ -101,7 +101,7 @@
assert_nil(MIME::Type.i18n_key('text'))
end
- def test_CMP # '<=>'
+ def test_spaceship_compare # '<=>'
assert(MIME::Type.new('text/plain') == MIME::Type.new('text/plain'))
assert(MIME::Type.new('text/plain') != MIME::Type.new('image/jpeg'))
assert(MIME::Type.new('text/plain') == 'text/plain')
@@ -167,11 +167,9 @@
assert_equal('base64', yaml.encoding)
yaml.encoding = :default
assert_equal('quoted-printable', yaml.encoding)
- begin
+ assert_raises(MIME::Type::InvalidEncoding) {
yaml.encoding = 'binary'
- rescue MIME::Type::InvalidEncoding => ex
- assert_equal('Invalid Encoding "binary" (valid values are [nil,
:default, "base64", "8bit", "7bit", "quoted-printable"]).', ex.message)
- end
+ }
end
def test_default_encoding
@@ -417,15 +415,18 @@
def test_to_hash
yaml = make_yaml_mime_type
assert_deprecated("MIME::Type#to_hash") do
- assert_equal({'Content-Type' => 'text/x-yaml',
- 'Content-Transfer-Encoding' => '8bit',
- 'Extensions' => %w(yaml yml),
- 'System' => /d9d172f608/,
- 'Registered' => false,
- 'URL' => [],
- 'Obsolete' => false,
- 'Docs' => nil },
- yaml.to_hash)
+ assert_equal(
+ {
+ 'Content-Type' => 'text/x-yaml',
+ 'Content-Transfer-Encoding' => '8bit',
+ 'Extensions' => %w(yaml yml),
+ 'System' => /d9d172f608/,
+ 'Registered' => false,
+ 'URL' => [],
+ 'Obsolete' => false,
+ 'Docs' => nil
+ },
+ yaml.to_hash)
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/test/test_mime_types.rb new/test/test_mime_types.rb
--- old/test/test_mime_types.rb 2014-10-07 19:49:23.000000000 +0200
+++ new/test/test_mime_types.rb 2014-10-21 16:36:25.000000000 +0200
@@ -15,7 +15,7 @@
end
def test_enumerable
- assert(@mime_types.any? {|type| type.content_type == 'text/plain'})
+ assert(@mime_types.any? { |type| type.content_type == 'text/plain' })
assert_kind_of(Enumerator, @mime_types.each)
assert_equal(6, @mime_types.each.count)
end
@@ -56,6 +56,7 @@
assert_empty(MIME::Types['text/plain', platform: true])
end
end
+
def test_add
eruby = MIME::Type.new("application/x-eruby") do |t|
t.extensions = "rhtml"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/test/test_mime_types_class.rb
new/test/test_mime_types_class.rb
--- old/test/test_mime_types_class.rb 2014-10-07 19:49:23.000000000 +0200
+++ new/test/test_mime_types_class.rb 2014-10-21 16:36:25.000000000 +0200
@@ -9,7 +9,7 @@
end
def test_enumerable
- assert(MIME::Types.any? {|type| type.content_type == 'text/plain'})
+ assert(MIME::Types.any? { |type| type.content_type == 'text/plain' })
assert_kind_of(Enumerator, MIME::Types.each)
assert(MIME::Types.each.count > 999)
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/test/test_mime_types_loader.rb
new/test/test_mime_types_loader.rb
--- old/test/test_mime_types_loader.rb 2014-10-07 19:49:23.000000000 +0200
+++ new/test/test_mime_types_loader.rb 2014-10-21 16:36:25.000000000 +0200
@@ -18,7 +18,7 @@
assert_equal(%w(webm), types['audio/webm'].first.extensions)
refute(types['audio/webm'].first.registered?)
- assert_equal("Fixes a bug with IE6 and progressive JPEGs",
+ assert_equal('Fixes a bug with IE6 and progressive JPEGs',
types['image/pjpeg'].first.docs)
assert(types['application/x-apple-diskimage'].first.system?)
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]