Sha256: 31301e6adcfb8187b74ebc52f13fe67d21bde56c711c3e154d0bde43ed2bdbf5
Contents?: true
Size: 534 Bytes
Versions: 13
Compression:
Stored size: 534 Bytes
Contents
module Webrat #:nodoc: module MIME #:nodoc: MIME_TYPES = Rack::Mime::MIME_TYPES.dup.merge( ".multipart_form" => "multipart/form-data", ".url_encoded_form" => "application/x-www-form-urlencoded" ).freeze def mime_type(type) return type if type.nil? || type.to_s.include?("/") type = ".#{type}" unless type.to_s[0] == ?. MIME_TYPES.fetch(type) { |invalid_type| raise ArgumentError.new("Invalid Mime type: #{invalid_type}") } end module_function :mime_type end end
Version data entries
13 entries across 13 versions & 7 rubygems