<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -7,19 +7,21 @@ to your Rails classes.
 
 ** Only Rails 2.1 is supported **
 
+** This plugin has a dependency on the mime-types gem 
+   sudo gem install mime-types **
+
 Configuration
 =============
 
 Tumblr4Rails can be configured to use 2 different modes:
 
-1) Application: The Tumblr email, password, read_url, write_url and upload_mime_types 
+1) Application: The Tumblr email, password, read_url and write_url
    are all statically set when the application starts. It is never necessary to 
    provide these values to the Tumblr methods call. The obvious implication of 
    this mode is that you can only access the Tumblr account that you've specified.
 
 2) Request: The Tumblr email, password, and read_url must be specified with each
-   request. upload_mime_types and write_url can be set (since they are not generally 
-   user-specific).
+   request. The write_url property can be set (since it is not generally user-specific).
 
 *** The default configuration is request if no configuration is provided. ***
 
@@ -36,8 +38,6 @@ Tumblr4Rails.configure do |settings|
     settings.password = &quot;your tumblr password&quot;
     settings.read_url = &quot;http://whatever.tumblr.com/api&quot;
     settings.write_url = &quot;The url at tumblr to post to&quot; (optional, defaults to: &quot;http://www.tumblr.com/api/write&quot;)
-    settings.upload_mime_types = {&quot;.mp3&quot; =&gt; &quot;audio/mpeg&quot;} (This must be a hash mapping file
-        extensions to mime types)
 end
 
 Configuration Explanation
@@ -45,10 +45,9 @@ Configuration Explanation
 
 For :request
     1) all that is required is setting the value of request_type to :request.
-    - it can be useful to set upload_mime_types and write_url so that they
-      do not need to be specified with each request, Although there are some logical
-      defaults for upload_mime_types and a default for write_url, so they do
-      not need to be explicitly set.
+    - it can be useful to set the write_url so that it does not need to be 
+      specified with each request, although it is not necessary since it will
+      use Tumblr's default API write url by default.
 
 For :application
     1) request_type must be set to :application.
@@ -57,8 +56,6 @@ For :application
     4) read_url must be set to the name of your tumblr log (ie: http://(log_name).tumblr.com/api)
     5) write_url can optionally be set. It defaults to http://www.tumblr.com/api/write
     - Setting any other value will result in an exception being thrown.
-    6) upload_mime_types - use this to specify additional mime types for uploading
-       in addition to those defined in upload.rb
 
 The API (Consists of a Read API and a Write API)
 ================================================</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -2,15 +2,13 @@ module Tumblr4Rails
   
   class Config   
     
-    attr_accessor :password, :email, :request_type, :write_url, 
-      :read_url, :upload_mime_types
+    attr_accessor :password, :email, :request_type, :write_url, :read_url
     
     DEFAULT_WRITE_URL = &quot;http://www.tumblr.com/api/write&quot;
     
     def initialize
       self.request_type = Tumblr4Rails::RequestType.request
       self.write_url = DEFAULT_WRITE_URL
-      self.upload_mime_types = {}
     end
     
     def errors</diff>
      <filename>lib/tumblr4rails/config.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,24 +1,8 @@
+require 'mime/types'
+
 module Tumblr4Rails
   
   class Upload
-   
-    @@default_mime_types = {
-      &quot;.jpg&quot;=&gt;&quot;image/jpeg&quot;,
-      &quot;.jpeg&quot;=&gt;&quot;image/jpeg&quot;,
-      &quot;.wmv&quot;=&gt;&quot;video/x-msvideo&quot;,
-      &quot;.gif&quot;=&gt;&quot;image/gif&quot;,
-      &quot;.bmp&quot;=&gt;&quot;image/bmp&quot;,
-      &quot;.png&quot;=&gt;&quot;image/png&quot;,
-      &quot;.mp3&quot;=&gt;&quot;audio/mpeg&quot;,
-      &quot;.xml&quot;=&gt;&quot;application/xml&quot;,
-      &quot;.dvi&quot; =&gt; &quot;application/x-dvi&quot;,
-      &quot;.mp2&quot; =&gt; &quot;video/mpeg&quot;,
-      &quot;.mpa&quot; =&gt; &quot;video/mpeg&quot;,
-      &quot;.mpe&quot; =&gt; &quot;video/mpeg&quot;,
-      &quot;.mpeg&quot; =&gt; &quot;video/mpeg&quot;,
-      &quot;.qt&quot; =&gt; &quot;video/quicktime&quot;,
-      &quot;.mov&quot; =&gt; &quot;video/quicktime&quot;
-    }.freeze
     
     attr_reader :filename, :mime_type, :content
     
@@ -30,15 +14,12 @@ module Tumblr4Rails
     private
     
     def get_mime_type
-      lookup_mime_type(File.extname(@filename)) unless @filename.blank?
-    end
-    
-    def lookup_mime_type(extension)
-      types = @@default_mime_types.dup
-      unless Tumblr4Rails.configuration.upload_mime_types.blank?
-        types.merge!(Tumblr4Rails.configuration.upload_mime_types)
+      unless @filename.blank?
+        types = MIME::Types.type_for(@filename)
+        unless types.blank?
+          @mime_type = types.first.to_s
+        end
       end
-      types[extension.downcase]
     end
     
   end</diff>
      <filename>lib/tumblr4rails/upload.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,6 +19,7 @@ module Tumblr4Rails
       return if data.blank?
       params = data.inject([]) do |arr, (key, value)|
         if value.is_a?(Tumblr4Rails::Upload)
+          raise ArgumentError.new(&quot;A mime type must be provided.&quot;) if value.mime_type.blank?
           arr &lt;&lt; file_to_multipart(key, value.filename, value.mime_type.to_s, value.content)
         else
           arr &lt;&lt; text_to_multipart(key, value)</diff>
      <filename>lib/tumblr4rails/utility/multipart_http.rb</filename>
    </modified>
    <modified>
      <diff>@@ -33,11 +33,6 @@ describe Tumblr4Rails::Config do
     @conf.write_url.should == Tumblr4Rails::Config::DEFAULT_WRITE_URL
   end
   
-  it &quot;should have an empty hash for mime types&quot; do
-    @conf.upload_mime_types.should_not be_nil
-    @conf.upload_mime_types.should be_is_a(Hash)
-  end
-  
   describe &quot;valid?&quot; do
     
     it &quot;should call validate_for_request when request_type is :request&quot; do</diff>
      <filename>spec/tumblr4Rails/config_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -23,4 +23,11 @@ describe Tumblr4Rails::MultipartHttp do
     convert_to_multipart({}).should be_nil
   end
   
+  it &quot;should raise an exception when the mime type is unknown&quot; do
+    up = Tumblr4Rails::Upload.new(&quot;Test.fdgdd&quot;, &quot;dsdsdsdsadasd&quot;)
+    lambda {
+      convert_to_multipart({:one =&gt; &quot;test&quot;, :data =&gt; up})
+    }.should raise_error
+  end
+  
 end
\ No newline at end of file</diff>
      <filename>spec/tumblr4Rails/utility/multipart_http_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a5302a229d1b90de6992e17e69247a32c75820c8</id>
    </parent>
  </parents>
  <author>
    <name>matt</name>
    <email>paynmatt@gmail.com</email>
  </author>
  <url>http://github.com/mattapayne/tumblr4rails/commit/732829945bac54f09be22e2476d41809a4ff6813</url>
  <id>732829945bac54f09be22e2476d41809a4ff6813</id>
  <committed-date>2008-07-26T01:18:14-07:00</committed-date>
  <authored-date>2008-07-26T01:18:14-07:00</authored-date>
  <message>Removed homegrown mime type lookup in favor of the mime-types gem</message>
  <tree>08293ad11cba3f0e6ab78fb3757cc2f0f2ad8b74</tree>
  <committer>
    <name>matt</name>
    <email>paynmatt@gmail.com</email>
  </committer>
</commit>
