提交 1fe0a1b5 编写于 作者: A Aaron Patterson

remove html_types set

Now that `all` has it's own object, we don't need the html_types Set.
上级 d74c8e53
require 'set'
require 'singleton'
require 'active_support/core_ext/module/attribute_accessors'
require 'active_support/core_ext/string/starts_ends_with'
......@@ -95,9 +94,6 @@ def const_defined?(sym, inherit = true)
# end
# end
class Type
@@html_types = Set.new [:html, :all]
cattr_reader :html_types
attr_reader :symbol
@register_callbacks = []
......@@ -301,7 +297,7 @@ def to_sym
end
def ref
to_sym || to_s
symbol || to_s
end
def ===(list)
......@@ -328,7 +324,7 @@ def =~(mime_type)
end
def html?
@@html_types.include?(to_sym) || @string =~ /html/
symbol == :html || @string =~ /html/
end
def all?; false; end
......
......@@ -165,7 +165,7 @@ class MimeTypeTest < ActiveSupport::TestCase
assert mime.respond_to?("#{type}?"), "#{mime.inspect} does not respond to #{type}?"
assert_equal type, mime.symbol, "#{mime.inspect} is not #{type}?"
invalid_types = types - [type]
invalid_types.delete(:html) if Mime::Type.html_types.include?(type)
invalid_types.delete(:html)
invalid_types.each { |other_type|
assert_not_equal mime.symbol, other_type, "#{mime.inspect} is #{other_type}?"
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册