Fix Mime::Type#to_sym to do @string.to_sym. Add text/yaml as alias for Mime::YAML

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3873 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jamis Buck 2006-03-15 15:12:24 +00:00
parent fa4fb50186
commit 6784749f3b

@ -42,7 +42,7 @@ def to_str
end
def to_sym
@symbol || to_sym
@symbol || @string.to_sym
end
def ===(list)
@ -64,7 +64,7 @@ def ==(mime_type)
XML = Type.new "application/xml", :xml, %w( text/xml application/x-xml )
RSS = Type.new "application/rss+xml", :rss
ATOM = Type.new "application/atom+xml", :atom
YAML = Type.new "application/x-yaml", :yaml
YAML = Type.new "application/x-yaml", :yaml, %w( text/yaml )
LOOKUP = Hash.new { |h, k| h[k] = Type.new(k) }
@ -81,7 +81,9 @@ def ==(mime_type)
LOOKUP["application/javascript"] = JS
LOOKUP["application/x-javascript"] = JS
LOOKUP["text/yaml"] = YAML
LOOKUP["application/x-yaml"] = YAML
LOOKUP["application/rss+xml"] = RSS
LOOKUP["application/atom+xml"] = ATOM
LOOKUP["application/x-yaml"] = YAML
end