diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-09-21 15:05:00 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-09-21 15:05:00 -0700 |
commit | 1fe0a1b5ebebb1372968606b85ce08b93bc145c8 (patch) | |
tree | a1cca6eafe1cbfba5c1881ce84781979f05119c4 | |
parent | d74c8e53b86b2b163bef86143e2fa191b1f64ff4 (diff) | |
download | rails-1fe0a1b5ebebb1372968606b85ce08b93bc145c8.tar.gz rails-1fe0a1b5ebebb1372968606b85ce08b93bc145c8.tar.bz2 rails-1fe0a1b5ebebb1372968606b85ce08b93bc145c8.zip |
remove html_types set
Now that `all` has it's own object, we don't need the html_types Set.
-rw-r--r-- | actionpack/lib/action_dispatch/http/mime_type.rb | 8 | ||||
-rw-r--r-- | actionpack/test/dispatch/mime_type_test.rb | 2 |
2 files changed, 3 insertions, 7 deletions
diff --git a/actionpack/lib/action_dispatch/http/mime_type.rb b/actionpack/lib/action_dispatch/http/mime_type.rb index 553f19b5bc..7f0b525f6f 100644 --- a/actionpack/lib/action_dispatch/http/mime_type.rb +++ b/actionpack/lib/action_dispatch/http/mime_type.rb @@ -1,4 +1,3 @@ -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 @@ to: # end # end class Type - @@html_types = Set.new [:html, :all] - cattr_reader :html_types - attr_reader :symbol @register_callbacks = [] @@ -301,7 +297,7 @@ to: end def ref - to_sym || to_s + symbol || to_s end def ===(list) @@ -328,7 +324,7 @@ to: end def html? - @@html_types.include?(to_sym) || @string =~ /html/ + symbol == :html || @string =~ /html/ end def all?; false; end diff --git a/actionpack/test/dispatch/mime_type_test.rb b/actionpack/test/dispatch/mime_type_test.rb index 791c6ff625..d9fb44f06d 100644 --- a/actionpack/test/dispatch/mime_type_test.rb +++ b/actionpack/test/dispatch/mime_type_test.rb @@ -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}?" } |