aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http/mime_type.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch/http/mime_type.rb')
-rw-r--r--actionpack/lib/action_dispatch/http/mime_type.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/mime_type.rb b/actionpack/lib/action_dispatch/http/mime_type.rb
index 25156a4c75..27f27e27fe 100644
--- a/actionpack/lib/action_dispatch/http/mime_type.rb
+++ b/actionpack/lib/action_dispatch/http/mime_type.rb
@@ -2,7 +2,19 @@ require 'set'
require 'active_support/core_ext/class/attribute_accessors'
module Mime
- SET = []
+ class Mimes < Array
+ def symbols
+ @symbols ||= map {|m| m.to_sym }
+ end
+
+ %w(<< concat shift unshift push pop []= clear compact! collect!
+ delete delete_at delete_if flatten! map! insert reject! reverse!
+ replace slice! sort! uniq!).each do |method|
+ define_method(method) {|*args| @symbols = nil; super(*args) }
+ end
+ end
+
+ SET = Mimes.new
EXTENSION_LOOKUP = {}
LOOKUP = Hash.new { |h, k| h[k] = Type.new(k) unless k.blank? }