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

Version Path
radiant-1.0.0 ruby-debug/ruby/1.8/gems/webrat-0.7.3/lib/webrat/core/mime.rb
indirect-webrat-0.7.5 lib/webrat/core/mime.rb
indirect-webrat-0.7.4 lib/webrat/core/mime.rb
webrat-0.7.3 lib/webrat/core/mime.rb
jbd-webrat-0.7.2.rails3 lib/webrat/core/mime.rb
webrat-0.7.2 lib/webrat/core/mime.rb
webrat-0.7.2.beta.2 lib/webrat/core/mime.rb
mutle-webrat-0.7.2.beta.1 lib/webrat/core/mime.rb
thoughtbot-webrat-0.7.2.pre lib/webrat/core/mime.rb
webrat-0.7.2.beta.1 lib/webrat/core/mime.rb
honkster-webrat-0.7.1.2 lib/webrat/core/mime.rb
honkster-webrat-0.7.1.1 lib/webrat/core/mime.rb
webrat-0.7.1 lib/webrat/core/mime.rb