From 98076af2ef1774863635191b3d4ea19575b5f832 Mon Sep 17 00:00:00 2001 From: Jon Moss Date: Sat, 16 Jan 2016 13:17:59 -0500 Subject: [PATCH] Remove ActionView dependence on ActionPack's Mime implementation --- actionview/lib/action_view/helpers/asset_tag_helper.rb | 2 +- actionview/lib/action_view/lookup_context.rb | 2 +- actionview/lib/action_view/rendering.rb | 2 +- actionview/lib/action_view/template/types.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/actionview/lib/action_view/helpers/asset_tag_helper.rb b/actionview/lib/action_view/helpers/asset_tag_helper.rb index 91e934cd64..cc54faa778 100644 --- a/actionview/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionview/lib/action_view/helpers/asset_tag_helper.rb @@ -136,7 +136,7 @@ def auto_discovery_link_tag(type = :rss, url_options = {}, tag_options = {}) tag( "link", "rel" => tag_options[:rel] || "alternate", - "type" => tag_options[:type] || Mime[type].to_s, + "type" => tag_options[:type] || Template::Types[type].to_s, "title" => tag_options[:title] || type.to_s.upcase, "href" => url_options.is_a?(Hash) ? url_for(url_options.merge(:only_path => false)) : url_options ) diff --git a/actionview/lib/action_view/lookup_context.rb b/actionview/lib/action_view/lookup_context.rb index d3935788ef..63a3c4ea5e 100644 --- a/actionview/lib/action_view/lookup_context.rb +++ b/actionview/lib/action_view/lookup_context.rb @@ -67,7 +67,7 @@ class DetailsKey #:nodoc: def self.get(details) if details[:formats] details = details.dup - details[:formats] &= Mime::SET.symbols + details[:formats] &= Template::Types.symbols end @details_keys[details] ||= new end diff --git a/actionview/lib/action_view/rendering.rb b/actionview/lib/action_view/rendering.rb index 8604637da2..3ca7f9d220 100644 --- a/actionview/lib/action_view/rendering.rb +++ b/actionview/lib/action_view/rendering.rb @@ -84,7 +84,7 @@ def render_to_body(options = {}) end def rendered_format - Mime[lookup_context.rendered_format] + Template::Types[lookup_context.rendered_format] end private diff --git a/actionview/lib/action_view/template/types.rb b/actionview/lib/action_view/template/types.rb index ddc5b25831..c233d06ccb 100644 --- a/actionview/lib/action_view/template/types.rb +++ b/actionview/lib/action_view/template/types.rb @@ -48,7 +48,7 @@ def self.[](type) type_klass[type] end - def symbols + def self.symbols type_klass::SET.symbols end end -- GitLab